[Xcb] Nested XLockDisplay

Elias Naur elias.naur at gmail.com
Wed Jan 3 15:50:51 PST 2007


I managed to reproduce the assertion crash locally, with these
libraries installed in a parallel directory and using LD_LIBRARY_PATH
to select them instead of the system X11 libraries:

compositeproto-0.3.1.tar.bz2
damageproto-1.0.3.tar.bz2
libpthread-stubs-0.1.tar.bz2
libX11-1.1.1.tar.bz2
libXau-1.0.2.tar.bz2
libxcb-1.0.tar.bz2
libXcomposite-0.3.1.tar.bz2
libXcursor-1.1.8.tar.bz2
libXdamage-1.0.4.tar.bz2
libXdmcp-1.0.2.tar.bz2
libXext-1.0.2.tar.bz2
libXfixes-4.0.3.tar.bz2
libXp-1.0.0.tar.bz2
libXrandr-1.1.2.tar.bz2
libXrender-0.9.2.tar.bz2
libXtst-1.0.1.tar.bz2
libXxf86vm-1.0.1.tar.bz2
printproto-1.0.3.tar.bz2
recordproto-1.13.2.tar.bz2
xcb-proto-1.0.tar.bz2
xcb-util-0.1.tar.bz2

The minimal test program was this:

#include <X11/X.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/extensions/Xrandr.h>

int main() {
    Display *disp = XOpenDisplay(NULL);
    int num_sizes;
    XRRSizes(disp, 0, &num_sizes);
}

giving this backtrace in gdb:

#0  0xffffe410 in __kernel_vsyscall ()
#1  0xb7d40770 in raise () from /lib/tls/i686/cmov/libc.so.6
#2  0xb7d41ef3 in abort () from /lib/tls/i686/cmov/libc.so.6
#3  0xb7d39dbb in __assert_fail () from /lib/tls/i686/cmov/libc.so.6
#4  0xb7d15834 in xcb_xlib_lock (c=0x804a7f8) at xcb_xlib.c:41
#5  0xb7e99a8c in _XCBLockDisplay (dpy=0x804a008) at xcb_lock.c:20
#6  0xb7e886b6 in XQueryExtension (dpy=0x804a008, name=0xb7e59188
"RANDR", major_opcode=0xbfbfb2c0, first_event=0xbfbfb2c4,
first_error=0xbfbfb2c8)
    at QuExt.c:46
#7  0xb7e7d49b in XInitExtension (dpy=0x804a008, name=0xb7e59188
"RANDR") at InitExt.c:49
#8  0xb7cf8073 in XextAddDisplay (extinfo=0xb7e591d0, dpy=0x804a008,
ext_name=0xb7e59188 "RANDR", hooks=0xb7e591a0, nevents=1, data=0x0) at
extutil.c:108
#9  0xb7e57f3a in XRRFindDisplay (dpy=0x804a008) at Xrandr.c:139
#10 0xb7e58a87 in _XRRValidateCache (dpy=0x0, screen=6) at Xrandr.c:242
#11 0xb7e58bf7 in XRRSizes (dpy=0x804a008, screen=0,
nsizes=0xbfbfb39c) at Xrandr.c:284
#12 0x080484ae in main ()


Unfortunately, I failed to try the latest git checkout of libXrandr
because of this:

elias at elias-laptop:~/git/libXrandr$ ./autogen.sh
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal  --output=aclocal.m4t
aclocal: configure.ac: 60: macro `AM_CFLAGS' not found in library
autoreconf: aclocal failed with exit status: 1

on ubuntu 6.10.

- elias

On 1/3/07, Elias Naur <elias.naur at gmail.com> wrote:
> Hi Jeremy,
>
> I'm not sure what version he is using, apparently the Debian testing
> libraries as described in http://lwn.net/Articles/211808/. However, my
> question was: does the assertion mean that you can't nest
> XLockDisplay? If so, why has this changed from the old xlib which
> seems to document that nesting is allowed?
>
>  - elias
>
> On 1/2/07, Jeremy A. Kolb <jkolb at brandeis.edu> wrote:
> > Hi Elias,
> >
> > What version of the X11 server and libraries is the user using?  As far as
> > I know all of the known LockDisplay/UnlockDisplay issues have been
> > resolved in the latest versions.
> >
> > Jeremy
> >
> > On Tue, 2 Jan 2007, Elias Naur wrote:
> >
> > > Hi,
> > >
> > > Sorry if this is trivial or have been addressed before, but my
> > > searching failed to bring up anything conclusive. My problem is the
> > > LockDisplay/UnlockDisplay assertion failures in the xlib-on-xcb
> > > library. I've got a LWJGL (http://lwjgl.org) user that complains that
> > > the "xcb_xlib.c:41: xcb_xlib_lock: Assertion `!c->xlib.lock' failed."
> > > occurs with aany test program. This is a java based library, but I
> > > haven't yet tried to find out if the Sun java implementation or the
> > > LWJGL library is at fault. As far as I can tell, the assertion means
> > > that XLockDisplay has been called while the lock was already held.
> > > However, the xlib manual at
> > > http://tronche.com/gui/x/xlib/display/XLockDisplay.html states that
> > > "Nested calls to XLockDisplay() work correctly; the display will not
> > > actually be unlocked until XUnlockDisplay() has been called the same
> > > number of times as XLockDisplay()". Have I misunderstood something or
> > > has the spec changed with xlib-on-xcb to disallow nested XLockDisplay
> > > (I can understand the other common assertion failure that occurs when
> > > XUnlockDisplay is called without holding the lock)?
> > >
> > >  - elias
> > > _______________________________________________
> > > Xcb mailing list
> > > Xcb at lists.freedesktop.org
> > > http://lists.freedesktop.org/mailman/listinfo/xcb
> > >
> >
> >
>


More information about the Xcb mailing list