Hiya. Have been debugging for several hours trying to isolate a crash that happens pretty reliably on device. Log below. The most common location is the one at 0805cc14. Unfortunately I can't tell exactly when this happens, but I think it might have to do with reading and writing files, possibly in close succession.
Did do, but given the addresses are lr:0 and pc:08nnn, there were no useful symbols found. Interestingly the script still extracted a func name+file+line number for the 0x08 addresses, but they didn't actually correspond to anything meaningful, e.g. "memset" as the function, on a line outside of any function, in a file that doesn't call that directly at all.
The first two are in malloc_consolidate(), down in the memory manager. The mmfar value is the address it's trying to access, causing the memory access fault. My guess is the problem is memory corruption from writing past array bounds, overwriting the malloc bookkeeping data between allocation blocks.
Have you tried running this in the simulator with the memory pool disabled? If you can get it to trigger a crash there as well, we might be able to use OS tools to pinpoint it--Address Sanitizer on macOS and Linux should help, no idea about Windows tho. What platform are you on?
Thanks! It took a bit because I didn't have a clean repro, but Address Sanitizer eventually found it for me. Flew too close to the sun: was using negative numbers as error codes in a return value that unwittingly made its way into an pointer offset, and boom, wrote a zero in the byte before an allocation. My bad!
Anyone else who's here because you googled any of the terms on this page along with Playdate, please try Address Sanitizer too! As Dave mentions, be sure to turn off the memory pool. In hindsight it's obvious why sanitizer won't work with the pool, but that took me several minutes to realize too.
For the record, just switched back to the Mac last month. Still getting back into Xcode!