Ugly patch for nasty crash with certain Linux OpenGL driver

Hi SDLers,

I got reproducible crashes in XCloseDisplay called from X11_VideoQuit
upon the second call to SDL_SetVideoMode (first time worked without
problems).

Closer inspection showed that the problem was reopening the second
display connection GFX_Display. Video drivers with ‘Tungsten’ in the
OpenGL vendor string (e.g. Intel integrated chipsets, Radeon 7000) then
crashed.

The brute-force hack is to keep the GFX_Display connection open:

In src/video/x11/SDL_x11video.c

replace
GFX_Display = XOpenDisplay(display);
with
if (!GFX_Display) GFX_Display = XOpenDisplay(display);

delete
/* Close the X11 graphics connection */
if ( GFX_Display != NULL ) {
XCloseDisplay(GFX_Display);
GFX_Display = NULL;
}

Apologies that I don’t have a minimal case example at hand, but I hope
the above is enough for insiders to know what goes wrong and come up
with a proper ‘clean’ fix… :wink:

CU,
Elmar–
Elmar Krieger, PhD
YASARA Biosciences & CMBI Outstation Austria
Neue-Welt-Hoehe 13/b
A-8042 Graz
Austria/Europe

             Ww
           c(@@)c

================()==OUu============
=WHAT IF YASARA knows the answer?!=
=----- http://www.yasara.org -----=
=- http://www.cmbi.kun.nl/whatif -=
============OOo====================
() ()
/ /

Have you reported this problem to the freedesktop
( http://bugs.freedesktop.org/ when the web site comes back) folks?On Sat, 2007-05-05 at 07:14 +0200, Elmar Krieger wrote:

Hi SDLers,

I got reproducible crashes in XCloseDisplay called from X11_VideoQuit
upon the second call to SDL_SetVideoMode (first time worked without
problems).

Closer inspection showed that the problem was reopening the second
display connection GFX_Display. Video drivers with ‘Tungsten’ in the
OpenGL vendor string (e.g. Intel integrated chipsets, Radeon 7000) then
crashed.


Sitsofe | http://sucs.org/~sits/