Crash bug in console.device

A forum for general AmigaOS 4.x support questions that are not platform-specific
User avatar
Raziel
Posts: 1170
Joined: Sat Jun 18, 2011 4:00 pm
Location: a dying planet

Crash bug in console.device

Post by Raziel »

I have for years an annoying freeze/crash when working with shell/console.
Mostly when i'm scripting and switching back and fourth between the shell and an editor while testing the script inbetween.

I was finally able to reproduce the crash and it's actually pretty easy to do.

version Kickstart/console.device.kmod file full
console.device 53.105 (25.01.2017)
version cli full
shell 53.15 (11.11.2013)

Steps to reproduce (beware of crashing/freezing)

1) Open a shell
2) Inside the shell press RETURN as often as needed to let the history scroller (right side) appear and give it a few more presses
3) Drag the history scroller to the top
4) Click anywhere on the Workbench to deactivate the shell window
5) Click into the shell window to activate it again (history scroller still on top)
6) Now press CTRL-C
Nothing happens, of course, but
7) Press Return again and drag your system down (it will freeze, no Grim Reaper shows up)

I don't know what the reason for the crash is.
It might be the history scroller acting up, it might be the Return command issuing the console redraw and the skip back to the bottom (out-of-sight) active input line, it might even be the former CTRL-C...would be extremely interesting to know what is causing this.

As i said, i have this behaviour for years, but never could point my finger to what is causing it.
I was suspecting MouseBlanker, but that clearly was not the case, then i thought it might simply be the script that i was testing, but no.
Since i do a lot of CTRL-C to interrupt my scripts while testing it showed up today again...

Please keep me updated on this one and it would be great if anyone could confirm.

Thank you

P.S: The attachment is not packed, .txt is not allowed, so i simply renamed it to .zip
Attachments
Debug_Serial.zip
Crash log from serial, no GrimReaper
(21.46 KiB) Downloaded 258 times
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
User avatar
colinw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 207
Joined: Mon Aug 15, 2011 9:20 am
Location: Brisbane, QLD. Australia.

Re: Crash bug in console.device

Post by colinw »

Confirmed !!

It does it here too, thanks for that, I had some random lockups with a CLI program I was working on
recently, when I had to break it ^C, it was sometimes crashing, but I couldn't figure out why.
User avatar
tonyw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 1479
Joined: Wed Mar 09, 2011 1:36 pm
Location: Sydney, Australia

Re: Crash bug in console.device

Post by tonyw »

Well, bugger me!

Thanks for that, Raziel. What ever would we do without people like you to take the time to find how to reproduce it.

Should be fairly easy to fix, since it shouldn't be in that area of code at all.

(Time passes...)

OK, fixed it. When you clicked in the window, the console assumed you were going to click 'n' drag to select some text and set the Selected flag to remember it. Normally you would start by typing something, which would cancel the flag again. I fixed it by not setting the Selected flag until you actually start dragging (which is how it should have been all the time).

If you want a work-around before you receive an updated version, try this:

After you have clicked in the window to regain focus, try typing: a CR, space, anything - before you type the Ctrl/C to stop the scrolling.
cheers
tony
User avatar
Raziel
Posts: 1170
Joined: Sat Jun 18, 2011 4:00 pm
Location: a dying planet

Re: Crash bug in console.device

Post by Raziel »

@colinw

/wipes sweat from forehead

Thank you for confirming...i was 50% sure i'd been chasing ghosts again :-)

@tonyw

Aww, too much credit, but thank you very much. :-D
And thank you for sharing the reasons for the crash, it's always nice to know why something does what it does (or what it shouldn't).

I'll try to remember the workaround (hopefully i can change my behaviour from roughly 7 years)

Ok, time to get MouseBlanker out of it's isolation...
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
User avatar
nbache
Beta Tester
Beta Tester
Posts: 1714
Joined: Mon Dec 20, 2010 7:25 pm
Location: Copenhagen, Denmark
Contact:

Re: Crash bug in console.device

Post by nbache »

Thanks, Colin and Tony for reacting so quickly! I had just seen that I could recreate it yesterday, but didn't have time to do more, so was planning to make a proper research and BZ and response today. But I was too slow :-).

Well, at least I know how to beta test it when the fix is ready for beta (apart from the usual regression-type tests).

Best regards,

Niels
User avatar
Raziel
Posts: 1170
Joined: Sat Jun 18, 2011 4:00 pm
Location: a dying planet

Re: Crash bug in console.device

Post by Raziel »

Hey there,

i wasn't sure if i should post a new thread, since it is so similar (and maybe even the same) to the bug i already posted, so i refrained from it.

I found (what i believe is) are two bugs and a potential new crash (but i'm not sure, if it is the same from above).

Here goes:
1st bug (command too long)
see attached screenshot
The "command" seems to overrun some buffer, which leads to the shell only displaying part of the copmmand, but no more.
No error messages (e.g. command not found), no nothing

2nd and 3rd bugs intro
1) type random characters until they roll over to the next line (multi line "command")
Make sure it's random characters and not a sane command (see hidden text for example)
2) press return
3) press cursor up to get the command back
4) press return again
5) rinse and repeat until the history bar starts to scroll down and give it a few more lines
6) move the cursor to the left until you are in the first line of the multi line "command"
NOTE: BE SURE TO ACTUALLY MOVE THE CURSOR!
If you don't, the scroll bar will NOT wander away!!! (which makes me believe even more this is a bug)
7) click anyhwere outside the shell to make it inactive
8) click into the shell to make it active again

2nd bug (history scroller steals focus)
9) drag the resize gadget to the left to make the shell window smaller
Now the history scroller will wander upwards and out of focus (for whatever reason) placing the "command" line out of sight

3rd bug (crash)
While the line is out of focus and the history scroller is way up
10) press cursor down
As soon as the "command" line is back in focus *and* "erased" (due to cursor down) the system wull go down aswell.

I'm aware of the similarity of the steps and the crash i reported already, so it might very well be the same *crash*, but i'm reporting it anyway, because in the serial log it doesn't look like it's the same (at least for a noob like me) and there's always a chance that it's something else (can't test with your beta builds, so sorry if it's a duplicate)

To make it easier on typing, copy the below, paste it into shell and foloow the steps from 2
Hidden Text - Click to Show :
jdjkfhjdfghdjkfghjfdsgdfkjghdalkgkasdlgkasdlgnakdfbnskdlvakdfgdafäoghjjgfäadkfn asdgisdghsdagjso ÄGJOPS JOSDJFGOASDJGFLKSDjfgsdkkJAOEDFGJ DOJGHDSFJGSDJGOLDAJFGLKDFSJGKLDFSJGHDKLAFJGH DAJGOLDAJFG DFLJ GODF OLDFJGDAFJGLÖD JSAODFKGODF JOGÄD FJSDF JGOD AÄFGJOPÄDF
As always, please can anyone confirm and please keep me updated

Thank you and jolly saturnalia everyone
Attachments
AmigaShell.png
Debug_Serial_1.zip
(21.49 KiB) Downloaded 243 times
Debug_Serial.zip
(21.16 KiB) Downloaded 234 times
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
User avatar
colinw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 207
Joined: Mon Aug 15, 2011 9:20 am
Location: Brisbane, QLD. Australia.

Re: Crash bug in console.device

Post by colinw »

I can tell you right now that #1 is because the shell CLI commandline buffer is maxed out at 256 bytes.
After that, it will just truncate anything else entered or stop accepting input altogether.
User avatar
Raziel
Posts: 1170
Joined: Sat Jun 18, 2011 4:00 pm
Location: a dying planet

Re: Crash bug in console.device

Post by Raziel »

@colinw

Thank you for the quick reply.

Wouldn't it be better to at least print the error message too?

And what about the crash?
Is it the same?

Thank you
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
User avatar
tonyw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 1479
Joined: Wed Mar 09, 2011 1:36 pm
Location: Sydney, Australia

Re: Crash bug in console.device

Post by tonyw »

Hi Raziel,

Sorry I haven't seen this before, but I haven't been keeping up with the forum lately.

I can't make anything bad happen using your test instructions and the current beta version of the console, so the fault may have been fixed in one of the recent console updates.
cheers
tony
User avatar
Raziel
Posts: 1170
Joined: Sat Jun 18, 2011 4:00 pm
Location: a dying planet

Re: Crash bug in console.device

Post by Raziel »

@tonyw

Thank you for getting back to me and don't sweat over the delay...I can wait :-)

So it could have been the same cause, nice.
Thank you for checking
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
Post Reply