Closed tjkirch closed 1 year ago
So it actually works if I set the bindings generation script to generate a linux-specific binding and then I use that instead of the playdate binding file (which it defaults to when not on macOS)
I wonder if it's related to that or if that just hides some undefined behavior somewhere
Also this example definitely used to work in the simulator on Linux a while ago
It's surprising that it worked at all with the arm32 bindings on x64. This is definitely the right way to approach it.
When I try to run the life example in the simulator, I get this:
The same segfault happens with the 1.13.0 and 1.13.1-beta2 SDKs. This is on Linux with crankstart 8178447895d62d12b170fdbc0250ea090dddf592.
gdb shows
Thread 1 "PlaydateSimulat" received signal SIGSEGV, Segmentation fault.
with the following backtrace:I'm not sure yet how to efficiently debug Playdate game crashes. I played around by adding panics at various places until I saw
rust_begin_unwind
in the backtrace, but it seems that no matter where I intentionally panic, it always takes the place of the segfault.However, by luck, I managed to find a couple of workarounds, and I'm hoping these will point to a culprit. First, if I clear graphics before calling randomize, everything works fine:
It also works fine if I draw something to the screen before randomization, which doesn't seem anything like a real solution, but may be interesting data:
So, I suspect that something is reading from or writing to uninitialized state in some way..? I'm not experienced in this area.
If I build with
--device
it works fine on my 1.12.3 Playdate, oddly enough. [edit: also works on device after updating to 1.13.1.]