Bug 14029

Summary: xcb "Lock assertion failure" in XkbRefreshKeyboardMapping/XkbGetMapChanges
Product: xorg Reporter: Jim Ramsay <i.am>
Component: Lib/XlibAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium    
Version: 7.3 (2007.09)   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 10101    

Description Jim Ramsay 2008-01-11 12:57:07 UTC
I have encountered a double 'LockDisplay' situation inside XkbRefreshKeyboardMapping.  It calls LockDisplay, then XkbGetMapChanges:

        if ((rtrn=XkbGetMapChanges(dpy,xkbi->desc,&changes))!=Success) {

Then XKBGetMapChanges *also* calls LockDisplay:

XkbGetMapChanges(Display *dpy,XkbDescPtr xkb,XkbMapChangesPtr changes)
    xkbGetMapReq *req;

    if ((dpy->flags & XlibDisplayNoXkb) ||
        (!dpy->xkb_info && !XkbUseExtension(dpy,NULL,NULL)))
        return BadAccess;

This only really is a problem when using xcb, due to the more strict  locking assertions.

The actual situation which led me to this discovery occurred in the 'synergys' application (http://synergy2.sourceforge.net/) which gave me the following traceback:

Locking assertion failure.  Backtrace:
#0 /usr/lib/libxcb-xlib.so.0 [0x2aff31e949ec]
#1 /usr/lib/libxcb-xlib.so.0(xcb_xlib_lock+0x15) [0x2aff31e94a77]
#2 /usr/lib/libX11.so.6 [0x2aff30ee8e32]
#3 /usr/lib/libX11.so.6(XkbGetMapChanges+0x3e) [0x2aff30f2bb08]
#4 /usr/lib/libX11.so.6(XkbRefreshKeyboardMapping+0xc7) [0x2aff30f28b4d]
#5 synergys [0x42f4a0]
#6 synergys [0x4311c8]
#7 synergys [0x457ac9]
#8 synergys [0x409206]
#9 synergys [0x4094ab]
#10 synergys [0x409ced]
#11 /lib/libc.so.6(__libc_start_main+0xf4) [0x2aff319681f4]
#12 synergys(__gxx_personality_v0+0x1e9) [0x4063c9]
synergys: xcb_xlib.c:73: xcb_xlib_lock: Assertion `!c->xlib.lock' failed.
Comment 1 Adam Jackson 2008-02-24 16:58:19 UTC
I had this patched in Fedora, thought I'd fixed it upstream too, but I guess not.

Fixed now anyway.  Thanks!

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.