Bug#101055: Simple file segfaults
Package: xlibs
Version: 4.0.3-4
Severity: normal
Compile the attached file with g++ -g -o xft xft.cpp -lqt
Yes, it is involving libqt-dev as such I CC'd debian-kde.
While attempting to determine what was going on, I installed xlibs-dbg,
apt-get source xlibs, pointed gdb at everything, stepped, bt'd, etc..
I even managed to produce a segfault in gdb !!-(
After compiling, this simple file when run produces this BT:
#0 XAddExtension (dpy=0x0) at InitExt.c:80
#1 0x2b2fc048 in _XftDisplayInfoGet (dpy=0x0) at xftdpy.c:75
#2 0x2b2fc0e6 in XftDefaultHasRender (dpy=0x0) at xftdpy.c:99
#3 0x2ac2cf6e in qt_use_xft () from /usr/lib/libqt.so.2
#4 0x804863b in main () at xft.cpp:7
#5 0x2b00b38b in __libc_start_main () from /lib/libc.so.6
After much digging, (I'm new to X source ..), I found it has a problem
with LockDisplay(dpy).
LockDisplay is a macro from xc/lib/X11/Xlibint.h:
#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
#define LockDisplay(d) if ((d)->lock_fns)
(*(d)->lock_fns->lock_display)((d),__FILE__,__LINE__)
...
#else
#define LockDisplay(d) if ((d)->lock_fns)
(*(d)->lock_fns->lock_display)(d)
At this point, I note that dpy is type = struct _XDisplay, and
LockDisplay is called with dpy as the arg from InitExt.c. I used gdb to
(gdb) ptype dpy->lock_fns
type = struct _XLockPtrs {
void (*lock_display)();
void (*unlock_display)();
} *
(gdb) p
Segmentation fault (core dumped)
So there appears to be a problem here... this ^^ is gdb segfaulting..
while trying to debug this simple little program. Anyone have any clues?
*** xft.cpp
#define QT_XFT
#include <qt_x11.h>
#include <qcolor.h>
int
main ()
{
int x = qt_use_xft ();
return x;
}
-- System Information
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux debian-home 2.2.19 #1 Sat May 19 16:25:04 CDT 2001 i686
Locale: LANG=en_US, LC_CTYPE=en_US
Versions of packages xlibs depends on:
ii libc6 2.2.3-6 GNU C Library: Shared libraries an
ii libfreetype6 2.0.2.20010514-1 FreeType 2 font engine, shared lib
ii xfree86-common 4.0.3-4 X Window System (XFree86) infrastr
ii xlibs 4.0.3-4 X Window System client libraries
--
Gordon Sadler
Reply to: