Closed prust closed 2 months ago
Thanks for the report (and the stack!).
No need to use verbose, in debug you should already have all the logs.
Are using the current git master branch version? Your stack lines number don't seem to match the current code exactly.
I think the issue might come from the current error prone way we use a pointer for layer->material
, that needs to point to an actual material of the image, and not to one in the undo stack. I suspect at some point in the code this constraint is broken (maybe in goxel_get_render_layers
?)
Now I am thinking that I should replace those pointers with some sort of index to simplify.
I was able to reproduce a similar crash by opening an empty image on top of an empty image. I push a fix for that, that might also fix this crash as well.
@guillaumechereau:
Are using the current git master branch version? Your stack lines number don't seem to match the current code exactly.
I did make one commit on top of master
that touches a few files, the diff is here. I'm planning to open a pull request to see if you're interested. It introduces an autosave feature, which my son appreciated, given the crashes. But I thought I should make the autosave interval configurable (right now it always autosaves every 3 minutes), and I haven't done that yet.
push a fix for that, that might also fix this crash as well
Thank you, I'll give it a shot!
@guillaumechereau: I pulled in your fix and last night my son used Goxel for over half an hour and didn't experience any crashes, so it may have fixed the issue. Thanks again!
@guillaumechereau: My son used Goxel for hours since this fix (e875881c4) and hasn't had a crash, so I'll close this issue as Completed. Thank you again so much!
@guillaumechereau: Thank you for writing, maintaining & open-sourcing this amazing tool!
My son has been using it heavily and has been experiencing regular crashes. I compiled the latest
master
(292588c) in debug mode in hopes that that would produce helpful debugging information:In summary, it looks like the material that was originally allocated in
image_undo()
->image_restore()
->material_copy()
, but was later freed inimage_undo()
->image_restore()
->material_delete()
, was -- for some reason -- referenced inrender_volume()
.I've looked through
image_restore()
but haven't been able to spot the issue there. I'm wondering if maybe he's doing something else, between the undos, that might be triggering the bug.He's able to reproduce the crash regularly, just by working in goxel for 10 minutes or so, but doesn't have specific repro steps. I haven't been successful at producing minimal repro steps either, though I've tried undoing and redoing a lot.
Would it produce more helpful logs if I recompile with GOX_LOG_VERBOSE? In debug mode, there isn't anything logged after startup, besides the occasional "Save" / "Saved" logs. Can you think of any other diagnostics I could do, or places I could look in the code to help me spot the issue? (I'm not very familiar with manual memory management but am trying to get better at it)
Update: I forgot to mention that I'm running in Linux Mint Cinnamon on an old iMac. To compile in debug mode, I added this to the Makefile: