Strange window in X

Hi all,

I’m not sure if this part of the API is changed in 1.3 (it seems to be
backward compatible if nothing else, and many of the tests still use

But using revision 4301 I get a very strange window which seems to
consume my entire display whenever the window has focus. I’m using
Xorg on Debian stable/Etch. Below is the entire program text. When I
quit the application, I get a segmentation fault. Below are a gdb
session with backtrace, the test program source code, the compilation
line, and the configuration line I used for SDL.

donny at teamspace:~/SDL$ gdb testo
GNU gdb 6.4.90-debian
Copyright © 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type “show copying” to see the conditions.
There is absolutely no warranty for GDB. Type “show warranty” for details.
This GDB was configured as “i486-linux-gnu”…Using host libthread_db
library “/lib/tls/i686/cmov/”.

(gdb) run
Starting program: /home/donny/SDL/testo
Failed to read a valid object file image from memory.
[Thread debugging using libthread_db enabled]
[New Thread -1210333504 (LWP 14480)]
Sending text event q

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1210333504 (LWP 14480)]
0xb7cbef0d in XCloseDevice () from /usr/lib/
(gdb) bt
#0 0xb7cbef0d in XCloseDevice () from /usr/lib/
#1 0xb7fa7ed5 in XCloseDevice (a=0x804bb58, b=0x4)
at ./src/video/x11/SDL_x11sym.h:231
#2 0xb7fab0b5 in X11_FreeMouse (mouse=0x8057af8)
at ./src/video/x11/SDL_x11mouse.c:34
#3 0xb7f5669b in SDL_DelMouse (index=1) at ./src/events/SDL_mouse.c:140
#4 0xb7f566e9 in SDL_MouseQuit () at ./src/events/SDL_mouse.c:165
#5 0xb7f54b90 in SDL_StopEventLoop () at ./src/events/SDL_events.c:217
#6 0xb7f9cb27 in SDL_VideoQuit () at ./src/video/SDL_video.c:2327
#7 0xb7f48bd0 in SDL_QuitSubSystem (flags=65535) at ./src/SDL.c:233
#8 0xb7f48c5e in SDL_Quit () at ./src/SDL.c:260
#9 0x080486cf in main (argc=-1078090744, argv=0xb7dfbea8) at test.c:35

/* test.c */
#include <SDL.h>
#include <stdio.h>
SDL_Surface *screen;
int main(int argc, char **argv) {
SDL_bool run = SDL_TRUE;

    printf("SDL_Init() error: %s\n", SDL_GetError());
    return -1;

screen = SDL_SetVideoMode(640, 480, 0, 0);
if (!screen) {
    printf("SDL_SetVideoMode() error: %s\n", SDL_GetError());
    return -1;

while (run) {
    SDL_Event event;
    switch (event.type) {
        case SDL_QUIT:
            run = SDL_FALSE;
        case SDL_KEYDOWN: switch(event.key.keysym.sym) {
            case 'q':
            case SDLK_ESCAPE:
                run = SDL_FALSE;

return 0;


Compile the test

cc -Wall -gstabs+ -ggdb3 sdl-config --cflags --libs -o testo test.c

Configure SDL

./configure --enable-video-gl --disable-mmx --disable-3dnow
–disable-ssemath --disable-sse --disable-sse2

I disabled generating code for supplemental instruction sets because
my copy of gcc (below) was generating illegal instructions when
dereferencing an LVALUE when converting a floating point value (e.g.
*X1 = (int)fValue)

donny at teamspace:~/SDL/test$ gcc --version
gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
Copyright © 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO

donny at teamspace:~/SDL/test$ Xorg -version

X Window System Version 7.1.1
Release Date: 12 May 2006
X Protocol Version 11, Revision 0, Release 7.1.1
Build Operating System: UNKNOWN
Current Operating System: Linux teamspace 2.6.18-6-486 #1 Fri Dec 12
16:18:30 UTC 2008 i686
Build Date: 29 May 2008
Before reporting problems, check
to make sure that you have the latest version.
Module Loader present

This is already fixed in subversion. Go ahead and update.

See ya!
-Sam Lantinga, Founder and President, Galaxy Gameworks LLC

Seems to be fixed in 4319–