Archived messages from: gitter.im/red/bugs from year: 2023

mikeyaunish
15:26Just checking to confirm this.
Using: Red 0.6.4 for Windows built 29-Dec-2022/13:00:14-07:00 commit #6af0b70
and running the following:
view [
    vid-code: area 300x200 {
        tab-panel1: tab-panel 
            "tab-panel1" [
                "Tab-A" [tab-a-btn1: button "tab-A-btn1"] 
                "Tab-B" [tab-b-btn1: button "tab-B-btn1"]
            ]    
    }
    output-panel: panel 200x200 gray
    button "Refresh Panel" [
        output-panel/pane: layout/only load vid-code/text
    ]
]

Then press "Refresh Panel" around 15-20 times will crash Red.
Last version of Red that I have that won't crash is: Red 0.6.4 for Windows built 2-Jun-2022/0:50:38-07:00 commit #671dae6
luce80
15:33Another that won't crash is: Red 0.6.4 for Windows built 4-Jul-2022/9:48:56+01:00 commit #ccc7e08
hiiamboris
15:42Confirmed, good catch @mikeyaunish !
15:42Stack traces seem to vary from time to time.
15:43red+view-debug-master-2022-09-09-2ba8188.exe and before doesn't crash
red+view-debug-master-2022-09-11-85fa7e7.exe and after all crashing
mikeyaunish
15:57Is this a open issue or should I open a problem @hiiamboris ?
hiiamboris
15:59Open it please
mikeyaunish
hiiamboris
16:31You omitted the view [ part @mikeyaunish
mikeyaunish
22:10Oops. looks like markdown ate it. Fixed now.
hiiamboris
22:48thanks :+1:

dsunanda
19:54SORT/COMPARE does not seem to work if it has /LOCAL words. Is this a known problem?
hiiamboris
20:05no.. have an example?
20:07looks ok:
>> sort/compare [7 3 4 9 8 1 6 4 3] function [a b] [x: 0 a < b]
== [1 3 3 4 4 6 7 8 9]
dsunanda
20:12Try with or without either of the PRINT lines to get different results .... including the occasional console crash:
o1: make object! [x: 1 y: 90]
o2: make object! [x: 2 y: 1]
o3: make object! [x: 2 y: 2]

data: reduce [o1 o2 o3]

sort/compare data func [a b /local ra rb][
   ra: a/x + a/y
   print [ra a/x a/y]
   rb: b/x + b/y
   print [rb b/x b/y]
   return ra < rb
   ]
 probe data

At least, that is what I am seeing (Windows, couple of weeks old release)
hiiamboris
20:18interesting
20:20this reminds me of https://github.com/red/red/issues/4543
20:21and https://github.com/red/red/issues/4854
20:22please make an issue
dsunanda
20:58@hiiamboris Thanks. It's 5265
hiiamboris
21:01:+1:
dsunanda
21:11.Thanks for adding error examples....I did not bother to do so as I have seen such a large range of strange errors (including PRINT no longer doing an implicit REDUCE on its block).
hiiamboris
21:15we will be looking at this issue years ahead, maybe trying with a different Red build, so it's important to capture the behavior

dsunanda
11:42@qtxie Thanks for the quick fix on 5265 - it seems to work well.
11:45In testing the fix, I found it is possible to break SORT/COMPARE with a refinement in the function spec. Don't know if this should be a new issue, or is part of the previous one:
o1: make object! [x: 1 y: 90]
o2: make object! [x: 2 y: 1]
o3: make object! [x: 2 y: 2]
data: random reduce [o1 o2 o3 o1 o1 o2 o3 o2]

s-func: func [a b /x /local ra rb][
   ra: a/x + a/y
   print [ra a/x a/y]
   rb: b/x + b/y
  print [rb b/x b/y]
   return ra < rb
   ]
sort/compare data :s-func

*** Script Error: rb is missing its value argument
*** Where: rb
*** Near : return ra < rb

hiiamboris
11:51the fix counts locals, so it misses refinements
11:51add this info to the issue pls
dsunanda
12:24@hiiamboris Done - thanks! (I have never had a usage-case for refinements in sort functions....Just stumbled on this edge case)
hiiamboris
12:34:+1:

hiiamboris
16:17R2:
>> sort [a /a]
== [a /a]
>> sort/reverse [a /a]
== [/a a]
>> sort/case [a /a]
== [a /a]
>> sort/case/reverse [a /a]
== [/a a]

Red:
>> sort [a /a]
== [a /a]
>> sort/reverse [a /a]
== [a /a]
>> sort/case [a /a]
== [a /a]
>> sort/case/reverse [a /a]
== [a /a]

@dockimbel bug or feature? ;)
luce80
16:32Script A:
Red [] catch [do %scriptB.red]

Script B:
Red [] throw 1

And then:
*** Throw Error: no catch for throw: 1
*** Where: transcode
*** Near : do %scriptB.red
*** Stack: probe do-file load

Not sure it's a bug but just to mention.
hiiamboris
16:36no, it's not: do contains an implicit catch, so you need to catch your throws within the script that throws them (or resort to do/expand load %scriptB.red)
luce80
16:42Wow! this is quite deep, thanks for the trick !
hiiamboris
16:43but you're onto something here... because halt works somehow... ;)
16:53I've reported the discrepancy https://github.com/red/red/issues/5267
17:13after studying the code of do* native I've come to agree that what you reported is also a bug, since code intends to re-throw catches (but for some reason they aren't caught)
17:14https://github.com/red/red/blob/c7ceccff1e0022b22e35f25abdbac40940264c9c/runtime/natives.reds#L627-L641

zwortex
16:36Good day all.
I am trying to reactive a script I've written in Red some time ago. and I bumped into an error. It shows
*** Script Error: pick does not allow none! for its index argument
*** Where: pick
*** Near : all [word = 'selected block? data find [] ]
*** Stack: do-file

Not very helpful. However, I tracked the error down to the face text-list. I try to unselect the selected row using face/selected: none. It used to work as documented : « selected
Index of selected string or none value if no selection (read/write) ». see
https://github.com/red/docs/blob/master/en/view.adoc#text-list
Is it a bug, or a documentation defect ? Regards.
view [
   l: text-list 100x100 data ["One" "Two"]
   with [ selected: 1 ]
   button {click me to get the error} [ l/selected: none ]
   button {works with 0} [ l/selected: 0 ]
   button {works with 2} [ l/selected: 2 ]
   button {silent with -1} [ l/selected: -1 ]
   button {silent with 3} [ l/selected: 3 ]
]

hiiamboris
16:40Hey, long time no see @zwortex :)
16:40Due to your luck (or lack of) it was fixed yesterday. So just update :)
16:41https://github.com/red/red/issues/5260
zwortex
16:42That is merry christmas then ! Thank you all for your kind support.
hiiamboris
16:43:+1:

hiiamboris
19:38If I press Alt+Enter in Red GUI console it blinks, may lose focus, but if I switch from it and try to run mpv with direct3d video output it says "unable to init video output" and terminates. Until I get back to GUI console and press Alt+Enter again, or quit it.
19:38Worth an issue?

mikeyaunish
21:30[![console-truncate.gif](https://files.gitter.im/5902e8c1d73408ce4f5b94ba/5j08/thumb/console-truncate.gif)](https://files.gitter.im/5902e8c1d73408ce4f5b94ba/5j08/console-truncate.gif)
21:31Is anyone else getting truncated errors to the console? If I open the console and enter:
view layout [ button "Error text" [ print xyz ]]
. Then click on the 'Error text' button. When the output gets to the bottom of the console it is truncated like this:
ne1uno
21:46no auto scroll, seeing in win10
hiiamboris
21:56for me it scrolls on every second click
21:56![](https://i.gyazo.com/5768ce9f75e6b7ff77e85ac086c08b5a.gif)
21:57I suggest commenting on https://github.com/red/red/issues/5250

mikeyaunish
14:04Will do