I just finished to port 2 of my games to Mac OSX from
Windows/DirectX/D3D, using SDL v1.2.12 + SDL_image v1.2.6 + SDL_mixer
v1.2.8, with OpenGL for display.
Unfortunately, both games get random crashes, sometimes just at start
or after a few minutes, sometimes after a hour, sometimes never.
Unfortunately, on my system, it seems to be never, so it's not easy
for me to debug and find the cause.
It seems the crash occures from the Cocoa event system, both with
nextEventMatchingMask & sendEvent, by wanting to reach an incorrect
object address, and thus crashing in
objc_msgSend (or objc_msgSend_rtp).
My games are in C++, so I'm using only 2 obj-c sources (one being
obj-c++), I put them here : http://www.managames.com/crash-mm-code.txt
The 1st one is the SDL default file. I tried both with and without
using a custom .Nib file.
The 2nd one is mainly used to add a custom menu with a few entries,
but 2 of my users reported me to still get the random crashes, even
after have disabled the creation of this menu.
I got some few crash reports from within my code, and I already
corrected them, but it didn't help to fix the random crashes...
On my system, I used NSZombieEnabled, CFZombie, MallocGuardEdges &
MallocScribble, without any result.
I have my own buffer overrun detection system in debug mode, and it
didn't catch anything.
After the initialization, there's no more Cocoa activity from my
code, it's only C++.
2 more points:
- it still crashes with the sound off
- it seems to crash a lot more often in fullscreen than in windowed mode