SteffenBauer/PocketPuzzles

program segfaults with a specific sgtpuzzles.cfg

m4mmon opened this issue · 6 comments

Hello,
I have installed and played a little bit with 0.7.5 on a PB632 (Touch HD3).
Then suddenly the program started crashing when trying to start any game (apparently, I've tried 5 or 6).
It is possible to get the program working again by removing /mnt/ext1/system/state/sgtpuzzles.cfg.
The problematic cfg file is provided here as attachment in case the problem is investigated.
It is not completely blocking since one can get out from this situation by resetting presets but one could be annoyed losing progression.

sgtpuzzles.zip

If it helps, setting bitmap_tap member to null in the first init loop chooser.c:chooserSetupButtons might solve it.

Thanks for catching this sneaky bug. Your second observation absolutely makes sense; the chooser buttons are not completely initialized. I now wonder why the app doesn't crash more often.

I plan some tests this week-end, hopefully releasing V 0.7.6 then.

You're welcome. In fact I took some time, traced the crash to the button_to_tapped function when calling StretchBitmap, and found the member had not been set.
It's a very little mistake in a quite big and elegant port to PB.
By the way, I love that "pearls" game.

Yes, I could reproduce the bug with the cfg file you provided. I observed that the encoded savegame there is quite long, looks like you played several games of pearl in succession. After I initialize the inverse button bitmaps correctly to NULL, all is fine again.

I assume that the uninitialized inverse chooser buttons weren't a problem until a long savegame somehow caused byte fragments in the part of the memory heap where the uninitialized pointers were pointing to. Boom.

Thanks again, looks solved now, I will release 0.7.6 asap.

Hopefully solved with b8b286f

thank you very much
and yes I discovered pearl and now I am hooked :D