We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1313

Summary: Segfault on SDL_CreateWindow when gl lib cannot be loaded
Product: SDL Reporter: Carles Pagès <carles.pages>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.0   
Hardware: x86   
OS: Linux   

Description Carles Pagès 2011-10-12 01:45:15 UTC
Hi,

I'm getting a segfault in SDL_CreateWindow, when running an app using virtualgl. The problem is that the return value of SDL_GL_LoadLibrary is not checked in that function (SDL_video.c: 1154), and later on the call to:
vinfo = _this->gl_data->glXChooseVisual(display, screen, attribs); (in SDL_x11opengl.c: 394)
segfaults as gl_data is zero.

I still have to check why the gl library does not load, but checking the return code of SDL_GL_LoadLibrary should prevent the segfault.

Thanks!
Comment 1 Sam Lantinga 2012-01-07 21:04:28 UTC
It's okay for loading the OpenGL library to fail, but the window code should handle it.
This is fixed in the latest snapshot:
http://hg.libsdl.org/SDL/rev/e29f01fa2750

Thanks!