[Pkg-sdl-maintainers] Bug#354524: libsdl1.2: 1.2.9-1 crashes windowed SDL programs

Mike Kasick mkasick at club.cc.cmu.edu
Mon Feb 27 04:09:40 UTC 2006


On Sun, Feb 26, 2006 at 09:42:09PM -0500, Jeff Bonham wrote:

> When downgraded to 1.2.9-0 packages this bug disappears.  I reproduced
> it with dosbox and enigma.

I noticed the same problem when running qemu after upgrading this evening.
The emulator would segfault right after startup.  Here's the gdb trace:

22:44:04 epitome:/usr/local/src/qemu-0.8.0# gdb i386-softmmu/qemu
GNU gdb 6.4-debian
Copyright 2005 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/libthread_db.so.1".

(gdb) r -cdrom /dev/hdc
Starting program: /scratch/local/src/qemu-0.8.0/i386-softmmu/qemu -cdrom /dev/hdc
[Thread debugging using libthread_db enabled]
[New Thread -1212106464 (LWP 27309)]
Could not open '/dev/kqemu' - QEMU acceleration layer not activated

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1212106464 (LWP 27309)]
0xb7c74d57 in XLookupString () from /usr/X11R6/lib/libX11.so.6
(gdb) bt
#0  0xb7c74d57 in XLookupString () from /usr/X11R6/lib/libX11.so.6
#1  0xb7f26617 in X11_TranslateKey () from /usr/lib/libSDL-1.2.so.0
#2  0xb7f26be3 in X11_SetKeyboardState () from /usr/lib/libSDL-1.2.so.0
#3  0xb7f270f9 in X11_PumpEvents () from /usr/lib/libSDL-1.2.so.0
#4  0xb7f3fd25 in SDL_PumpEvents () from /usr/lib/libSDL-1.2.so.0
#5  0xb7f3fd67 in SDL_PollEvent () from /usr/lib/libSDL-1.2.so.0
#6  0x0809ae48 in sdl_refresh (ds=0x8118ce0)
    at /usr/local/src/qemu-0.8.0/sdl.c:465
#7  0x0804f720 in gui_update (opaque=0x0)
    at /usr/local/src/qemu-0.8.0/vl.c:3674
#8  0x0804b8b7 in qemu_run_timers (ptimer_head=0x8118d24, current_time=4631556)
    at /usr/local/src/qemu-0.8.0/vl.c:767
#9  0x0804fe3d in main_loop_wait (timeout=0)
    at /usr/local/src/qemu-0.8.0/vl.c:3887
#10 0x0804ffd8 in main_loop () at /usr/local/src/qemu-0.8.0/vl.c:3945
#11 0x080512bb in main (argc=3, argv=0xbfbd9d94)
    at /usr/local/src/qemu-0.8.0/vl.c:5051

Since I just upgraded the SDL packages to 1.2.9-1, it seemed suspect.
Here's what the change log says:

  * debian/patches/005_x11_keysym_fix.diff:
    + Patch courtesy of Jochen Voss to fix lookup of keys using eg. the
      AltGr modifier (Closes: #299864).

And the patch:

--- SDL-1.2.7+1.2.8cvs20041007.orig/src/video/x11/SDL_x11events.c       2005-03-16 23:39:50.000000000 +0000
+++ SDL-1.2.7+1.2.8cvs20041007/src/video/x11/SDL_x11events.c    2005-03-16 23:43:49.000000000 +0000
@@ -614,11 +614,12 @@
 SDL_keysym *X11_TranslateKey(Display *display, XKeyEvent *xkey, KeyCode kc,
                             SDL_keysym *keysym)
 {
+       char buffer[8];
        KeySym xsym;

        /* Get the raw keyboard scancode */
        keysym->scancode = kc;
-       xsym = XKeycodeToKeysym(display, kc, 0);
+       XLookupString(xkey, buffer, 8, &xsym, NULL);
 #ifdef DEBUG_KEYS
        fprintf(stderr, "Translating key 0x%.4x (%d)\n", xsym, kc);
 #endif

So I don't know what the proper invocation of XLookupString() is, but I bet
this is passing a bogus pointer.  Someone should look at this patch more
carefully.




More information about the Pkg-sdl-maintainers mailing list