Crash when resizing window on OS X

I’m encountering occasional segfaults when resizing an SDL window on
OS X. My test app which exhibits this uses OpenGL and SDL 1.2
compatibility functions, and my SDL version is 1.3 built from Hg. I’ve
attached a simple test program and a short interaction with GDB
showing the backtrace and some structures at the time of the crash.

Sun Jun 6 20:26:29 Mothership.local videofilter[79117] :
CGDisplayBounds: Fixing up display ID 0x4272902 for offline mux head
to 0x4272900
Sun Jun 6 20:26:29 Mothership.local videofilter[79117] :
CGDisplayBounds: Fixing up display ID 0x4272902 for offline mux head
to 0x4272900

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: 13 at address: 0x0000000000000000
0x00000001000c418f in SDL_OnWindowFocusLost (window=0x102322b40) at
src/video/SDL_video.c:1428
1428 if (display->gamma && _this->SetDisplayGammaRamp) {
(gdb) backtrace
#0 0x00000001000c418f in SDL_OnWindowFocusLost (window=0x102322b40)
at src/video/SDL_video.c:1428
#1 0x0000000100044812 in SDL_SendWindowEvent (window=0x102322b40,
windowevent=12 ‘\f’, data1=0, data2=0) at
src/events/SDL_windowevents.c:141
#2 0x0000000100042ebe in SDL_SetKeyboardFocus (window=0x1002338d0) at
src/events/SDL_keyboard.c:609
#3 0x00000001000d2fa3 in -[Cocoa_WindowListener windowDidBecomeKey:]
(self=0x1023213b0, _cmd=0x7fff83d1ba96, aNotification=0x10250a150) at
src/video/cocoa/SDL_cocoawindow.m:130
#4 0x00007fff8252186e in _nsnote_callback ()
#5 0x00007fff814f6aea in __CFXNotificationPost ()
#6 0x00007fff814e3098 in _CFXNotificationPostNotification ()
#7 0x00007fff825187d8 in -[NSNotificationCenter
postNotificationName:object:userInfo:] ()
#8 0x00007fff8361eaa4 in -[NSWindow becomeKeyWindow] ()
#9 0x00007fff8361e0db in -[NSWindow _changeKeyAndMainLimitedOK:] ()
#10 0x00007fff8361dd6c in -[NSWindow _makeKeyRegardlessOfVisibility] ()
#11 0x00007fff8361dcd2 in -[NSWindow makeKeyAndOrderFront:] ()
#12 0x00000001000d4114 in Cocoa_ShowWindow (_this=0x100223150,
window=0x1002338d0) at src/video/cocoa/SDL_cocoawindow.m:514
#13 0x00000001000c39e8 in SDL_ShowWindow (window=0x1002338d0) at
src/video/SDL_video.c:1231
#14 0x00000001000c2f82 in SDL_CreateWindow (title=0x10023e670
"VideoFilterTest", x=0, y=44, w=1322, h=327, flags=22) at
src/video/SDL_video.c:944
#15 0x0000000100005f06 in SDL_SetVideoMode (width=1322, height=327,
bpp=32, flags=83886080) at src/SDL_compat.c:572
#16 0x0000000100000d4d in main (argc=<value temporarily unavailable,
due to optimizations>, argv=<value temporarily unavailable, due to
optimizations>) at videofilter.cpp:60
Current language: auto; currently c
(gdb) p _this->SetDisplayGammaRamp
$1 = (int (*)(SDL_VideoDevice *, SDL_VideoDisplay *, Uint16 *)) 0
(gdb) p display
$2 = (SDL_VideoDisplay *) 0x205d37313139375b
(gdb) p display->gamma
Cannot access memory at address 0x205d3731313937ab
(gdb) p *display
Cannot access memory at address 0x205d37313139375b
(gdb) info locals
display = (SDL_VideoDisplay *) 0x205d37313139375b
(gdb) p *window
$3 = {
magic = 0x10232107a,
id = 9,
title = 0x68746f4d20390008 <Address 0x68746f4d20390008 out of bounds>,
x = 1752396389,
y = 1814982761,
w = 1818321775,
h = 1684633120,
flags = 1768320357,
display = 0x205d37313139375b,
renderer = 0x676e696e7261573c,
fullscreen_mode = {
format = 2112062,
w = 825309495,
h = 1528847671,
refresh_rate = 541346133,
driverdata = 0x9
},
userdata = 0x9,
driverdata = 0x20656761730003,
prev = 0x7000000000009,
next = 0x3730333835373231
}
-------------- next part --------------
A non-text attachment was scrubbed…
Name: videofilter.cpp
Type: application/octet-stream
Size: 1664 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20100606/55c0ac8a/attachment.obj