Hi all,
I’ve been debugging a problem with SDL on OSX for quite a while,
without getting much further. Maybe somebody here can shed some light
on the issue.
The code in question runs fine on Linux and Windows. It also runs fine
if I set the SDL_VIDEODRIVER to X11 on OSX. So I would assume it is
not necessarily a problem in the code, but something that is related
to SDL on OSX specifically. That aside, it’s occurring on both my
iBook G3 running 10.4.11 and my MacBook Pro 3.1 running 10.5.6 under
SDL 1.2.12, 1.2.13 and recent SVN. Haven’t tried anything earlier.
There are two shots that show how the screen is supposed to look like
and what I actually get on the Mac:
http://adonthell.berlios.de/linux.png
http://adonthell.berlios.de/mac.png
On the Mac it’s also flickering like crazy and when I quit the program
it segfaults:
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
0x00000000 in ?? ()
(gdb) bt
#0 0x00000000 in ?? ()
#1 0x020317d8 in SDL_FreeSurface (surface=0x1551960) at
./src/video/SDL_surface.c:915
#2 0x02033fac in SDL_VideoQuit () at ./src/video/SDL_video.c:1354
#3 0x02009300 in SDL_QuitSubSystem (flags=32) at ./src/SDL.c:202
#4 0x002d778c in gfx::cleanup () at …/…/…/adonthell/src/gfx/gfx.cc:172
#5 0x00665700 in adonthell::app::cleanup (this=0x7260) at
…/…/…/adonthell/src/main/adonthell.cc:249
#6 0x007d7b94 in -[SDLMain applicationDidFinishLaunching:] ()
#7 0x90b04e1c in _nsnote_callback ()
#8 0x902d8ec0 in __CFXNotificationPost ()
#9 0x902d0f20 in _CFXNotificationPostNotification ()
#10 0x90aef224 in -[NSNotificationCenter
postNotificationName:object:userInfo:] ()
#11 0x9ea40be8 in -[NSApplication _postDidFinishNotification] ()
#12 0x9ea40ad4 in -[NSApplication _sendFinishLaunchingNotification] ()
#13 0x9ea4061c in -[NSApplication(NSAppleEventHandling) _handleAEOpen:] ()
#14 0x9ea401c4 in -[NSApplication(NSAppleEventHandling)
_handleCoreEvent:withReplyEvent:] ()
#15 0x90b05e28 in -[NSAppleEventManager
dispatchRawAppleEvent:withRawReply:handlerRefCon:] ()
#16 0x90b05c88 in _NSAppleEventManagerGenericHandler ()
#17 0x964ae960 in aeDispatchAppleEvent ()
#18 0x964ae7fc in dispatchEventAndSendReply ()
#19 0x964ae654 in aeProcessAppleEvent ()
#20 0x9e5e32e0 in AEProcessAppleEvent ()
#21 0x9ea3e90c in _DPSNextEvent ()
#22 0x9ea3e3f8 in -[NSApplication
nextEventMatchingMask:untilDate:inMode:dequeue:] ()
#23 0x9ea3a93c in -[NSApplication run] ()
#24 0x007d7ae4 in CustomApplicationMain ()
#25 0x007d7bbc in main_init ()
#26 0x006663ac in adonthell::app::init (this=0x7260) at
…/…/…/adonthell/src/main/adonthell.cc:237
#27 0x00666418 in main (argc=3, argv=Cannot access memory at address 0x0
Cannot access memory at address 0x0
0x1551960) at …/…/…/adonthell/src/main/main.cc:81
The problem is, despite the seemingly trivial output, the program
behind it is pretty big already and all attempts at providing a small,
self-contained test case to reproduce the issue failed. That’s why I
am hoping that somebody can possibly figure out the problem by looking
at the symptoms.
If somebody really wants to experience the issue firsthand, get the
code by following these instructions:
http://adonthell.berlios.de/doc/index.php/Development:QuickStart
Instead of worldtest (a much more complex program that runs fine on
the Macs) run guitest.
Any insight into the issue would be appreciated. As are hints how code
to reproduce the issue might look like.
Regards,
Kai