This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#6189 - 'Out of menus' error check
Attached to Project:
Rockbox
Opened by absurdlyobfuscated (DrSpud) - Sunday, 15 October 2006, 08:13 GMT+2
Last edited by Jonathan Gordon (jdgordon) - Saturday, 16 June 2007, 15:00 GMT+2
Opened by absurdlyobfuscated (DrSpud) - Sunday, 15 October 2006, 08:13 GMT+2
Last edited by Jonathan Gordon (jdgordon) - Saturday, 16 June 2007, 15:00 GMT+2
|
DetailsBoth menu_run and menu_exit don't check to see if they have been passed a valid menu slot. This causes a freeze/segfault if menu_find_free fails in an 'Out of menus' condition and no error checking is done on the result. This simple patch adds checks, though we'd probably want a visual error message displayed somewhere too.
|
This task depends upon
Closed by Jonathan Gordon (jdgordon)
Saturday, 16 June 2007, 15:00 GMT+2
Reason for closing: Out of Date
Saturday, 16 June 2007, 15:00 GMT+2
Reason for closing: Out of Date
Now prevents
FS#6010from crashing :)It does some really weird things if you try to reproduce
FS#6010.First hit the limit of 6 iterations, then press left to back out. Watch the screen go crazy.
Pressing left enough times eventually freezes my player.
I suppose this patch isn't as necessary now (as long we make sure MAX_MENUS is big enough), since your patch fixed the cause that made the lack of checks a problem (thanks a lot for that, by the way). It doesn't add much to the code size, however...
FS#6010and it didn't fix that. It didn't crash due to too many recursions but just having one recursion was already enough to cause some internal corruption when going back down the call list (by pressing left)Checking the return value is needed too with an error message, which is why I didn't close this entry yet ;)