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 - Segfault on SDL_CreateWindow when gl lib cannot be loaded
Summary: Segfault on SDL_CreateWindow when gl lib cannot be loaded
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: x86 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-12 01:45 UTC by Carles Pagès
Modified: 2012-01-07 21:04 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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!