SDL_SoftStretch crash on SDL 1.2.13 on MacOS

Hi, I’m experiencing a crash on MacOS X when setting up an SDL OpenGL window.
I’m using MacOS Leopard 10.5.2, and SDL 1.2.13 on a new MacBook Pro.

This code worked flawlessly in Ubuntu Feisty Fawn, btw.

The line that makes it crash is this one:
surface = SDL_SetVideoMode (windowWidth, windowHeight, windowDepth, videoFlags);

Variables status:

  • windowWidth : 800
  • windowHeight: 600
  • windowDepth: 24
  • videoFlags : 0x20000017

I’m taking the videoFlags based on SDL_GetVideoInfo, which returns a
struct with all fields set to 0 except for these ones:

  • vfmt: 0x120910
  • wm_available: 1
  • current_h: 900
  • current_w: 1440

Unfortunately, I couldn’t get much more of a backtrace than this from XCode:
#4 0x000b2d8f in SDL_SoftStretch ()
No symbol table info available.
#5 0x000b1a5c in SDL_SoftStretch ()
No symbol table info available.
#6 0x000a53e7 in SDL_SetVideoMode ()
No symbol table info available.

Looking at SDL 1.2.13 changelog, I’ve seen that a crash related to
SDL_SoftStretch has been fixed in this SDL version. Maybe this is
somehow related to that?

Thanks in advance for any help or hints.

BTW, the code that makes it crash is this classical initialization stuff:

------------------------------------------------------8<------------------------------------------------------
int videoFlags;
const SDL_VideoInfo *videoInfo;

if (SDL_Init (SDL_INIT_VIDEO) < 0)
{
	fprintf (stderr, "Video initialization failed: %s\n",SDL_GetError ());
	exit(-1);
}
atexit (SDL_Quit);

videoInfo = SDL_GetVideoInfo ();
if (!videoInfo)
{
	fprintf (stderr, "Video query failed: %s\n", SDL_GetError ());
	exit(-1);
}
videoFlags  = SDL_OPENGL |SDL_GL_DOUBLEBUFFER |SDL_HWPALETTE | SDL_RESIZABLE;

if (videoInfo->hw_available)
	videoFlags |= SDL_HWSURFACE;
else
	videoFlags |= SDL_SWSURFACE;

if (videoInfo->blit_hw)
	videoFlags |= SDL_HWACCEL;

SDL_EnableKeyRepeat (30, SDL_DEFAULT_REPEAT_INTERVAL);
SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, 1);

surface = SDL_SetVideoMode (windowWidth, windowHeight, windowDepth,

videoFlags);
------------------------------------------------------>8------------------------------------------------------

Hi, I’m experiencing a crash on MacOS X when setting up an SDL OpenGL window.
I’m using MacOS Leopard 10.5.2, and SDL 1.2.13 on a new MacBook Pro.

The line that makes it crash is this one:
surface = SDL_SetVideoMode (windowWidth, windowHeight, windowDepth, videoFlags);

Unfortunately, I couldn’t get much more of a backtrace than this from XCode:
#4 0x000b2d8f in SDL_SoftStretch ()
No symbol table info available.

I don’t think this is actually crashing in SDL_SoftStretch(), since that’s
not called anywhere in video mode initialization.

Can you grab the SDL source code and build a debug version of the framework?

See ya,
-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment

Ok, here’s the interesting part of a full backtrace with an SDL
compiled from source, having changed the gcc option -O2 to -O0 in the
Makefile (so as to give some meaningful debugging info)

Any ideas?

Thanks in advance

-------------------------------------------------------------------8<-------------------------------------------------------------------
#4 0x0019cd8f in SDL_SoftStretch ()
No symbol table info available.
#5 0x000f94ea in QZ_SetVideoWindowed (this=0x802600,
current=0x220a60, width=800, height=600, bpp=0xbffff790, flags=22) at
SDL_QuartzVideo.m:745
style = 15
contentRect = {
origin = {
x = 0,
y = 0
},
size = {
width = 800,
height = 600
}
}
isCustom = 0 '\000’
center_window = 1
origin_x = 979691520
origin_y = 208301545
fade_token = 0
#6 0x000f9f79 in QZ_SetVideoMode (this=0x802600, current=0x220a60,
width=800, height=600, bpp=32, flags=22) at SDL_QuartzVideo.m:873
No locals.
#7 0x000ebda4 in SDL_SetVideoMode (width=800, height=600, bpp=24,
flags=22) at SDL_video.c:666
video = (SDL_VideoDevice *) 0x802600
this = (SDL_VideoDevice *) 0x802600
prev_mode = (SDL_Surface *) 0x220a60
mode = (SDL_Surface *) 0xffffffff
video_w = 800
video_h = 600
video_bpp = 24
is_opengl = 1
saved_grab = SDL_GRAB_OFF

------------------------------------------------------------------->8-------------------------------------------------------------------On Tue, Mar 18, 2008 at 1:30 PM, Sam Lantinga wrote:

Hi, I’m experiencing a crash on MacOS X when setting up an SDL OpenGL window.
I’m using MacOS Leopard 10.5.2, and SDL 1.2.13 on a new MacBook Pro.

I don’t think this is actually crashing in SDL_SoftStretch(), since that’s
not called anywhere in video mode initialization.

Can you grab the SDL source code and build a debug version of the framework?