Subject: Bug#467: Segfault when using SDL_Init()

From: [email-masked]
Date: Sat, 29 Mar 2014 19:01:01 +0100

Package: nxagent
Version: 3.5.0.22

-- Description --

When using SDL_Init() in SDL2 I get a segfault in libNX_X11.so. This does not happen using SDL1.

OS: Manjaro Linux 64-bit (Arch Linux based)

$ x2goversion 
x2goagent: 3.5.0.22
x2goserver: 4.0.1.13
x2goserver-compat: 4.0.1.13
x2goserver-extensions: 4.0.1.13
x2goserver-fmbindings: 4.0.1.13
x2goserver-printing: 4.0.1.13
x2goserver-pyhoca: 4.0.1.13

-- GDB Backtrace --

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff4dafcb0 in _X11TransWritev () from /usr/lib/nx/X11/libNX_X11.so.6

#0  0x00007ffff4dafcb0 in _X11TransWritev () from /usr/lib/nx/X11/libNX_X11.so.6
#1  0x00007ffff4d93b8e in _XSend () from /usr/lib/nx/X11/libNX_X11.so.6
#2  0x00007ffff4d88e69 in XQueryExtension () from /usr/lib/nx/X11/libNX_X11.so.6
#3  0x00007ffff4d7eaf2 in XInitExtension () from /usr/lib/nx/X11/libNX_X11.so.6
#4  0x00007ffff50627bb in XextAddDisplay () from /usr/lib/nx/X11/libNX_Xext.so.6
#5  0x00007ffff5271ee1 in XPanoramiXQueryExtension () from /usr/lib/nx/X11/Xinerama/libXinerama.so.1
#6  0x00007ffff7b8d514 in ?? () from /usr/lib/libSDL2-2.0.so.0
#7  0x00007ffff7b906be in ?? () from /usr/lib/libSDL2-2.0.so.0
#8  0x00007ffff7b84181 in ?? () from /usr/lib/libSDL2-2.0.so.0
#9  0x00007ffff7aec5ff in ?? () from /usr/lib/libSDL2-2.0.so.0
#10 0x00000000004006bb in main () at a.c:4

-- Reproduce --

$ gcc -o a a.c -lSDL2 -I/usr/include/SDL2
$ cat a.c 
#include <SDL.h>

int main() {
    SDL_Init(SDL_INIT_EVERYTHING);

    SDL_Quit();
    return 0;
}
$./a
Segmentation fault (core dumped)