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 1319 - Segfault after glXChooseVisual returns null
Summary: Segfault after glXChooseVisual returns null
Status: RESOLVED DUPLICATE of bug 1333
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-23 03:25 UTC by Carles Pagès
Modified: 2012-01-07 20:01 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-23 03:25:38 UTC
If I run the gl test (testgl.c) with -fsaa option, I get a segfault in SDL_SetVideoMode. Here's the backtrace:
Program received signal SIGSEGV, Segmentation fault.
0xb7f4744c in X11_DestroyWindowFramebuffer (_this=0x804e7f8, window=0x8070048)
    at src/video/x11/SDL_x11framebuffer.c:196
196         Display *display = data->videodata->display;
(gdb) bt
#0  0xb7f4744c in X11_DestroyWindowFramebuffer (_this=0x804e7f8, window=0x8070048)
    at src/video/x11/SDL_x11framebuffer.c:196
#1  0xb7f3c77f in SDL_DestroyWindow (window=0x8070048) at src/video/SDL_video.c:1949
#2  0xb7f3a945 in SDL_CreateWindow (title=0x0, x=536805376, y=536805376, w=640, h=480, flags=6)
    at src/video/SDL_video.c:1187
#3  0xb7e7d245 in SDL_SetVideoMode (width=640, height=480, bpp=16, flags=67108864)
    at src/SDL_compat.c:538
#4  0x0804a30e in RunGLTest (argc=2, argv=0xbfffeeb4, logo=0, logocursor=0, slowly=0, bpp=16, gamma=0, 
    noframe=0, fsaa=1, sync=0, accel=-1) at testgl.c:471
#5  0x0804aeaa in main (argc=2, argv=0xbfffeeb4) at testgl.c:768

After some debugging, I see that there are two calls to X11_GL_GetVisual, in which glXChooseVisual returns null. Each time the error is ignored.

I still don't understand why the call returns null, as GLX_ARB_multisample is listed in my extensions. Any hint?
Comment 1 Sam Lantinga 2012-01-07 20:01:40 UTC
I'm not sure why glXChooseVisual() returns NULL.  Maybe ask on the SDL mailing list?
http://www.libsdl.org/mailing-list.php

The crash when that happens though I just fixed:
http://hg.libsdl.org/SDL/rev/744ae9bdf5da

*** This bug has been marked as a duplicate of bug 1333 ***