[Xcb] print backtraces in case an assert fails inside xlib/xcb

Jamey Sharp jamey at minilop.net
Sun Jun 10 16:44:31 PDT 2007


On Thu, Jun 07, 2007 at 05:24:01PM -0700, Donnie Berkholz wrote:
> FWIW, here's the Gentoo bug related to XCB issues (Look at the "depends
> on" area for the bugs it's related to):

Thanks for the pointer. Recently, Josh and I tried to track down bug
reports filed in various distros' bug tracking systems. It sucked.

> The two main issues are 1) Java and 2) libtool .la contamination ...

Looking over the Gentoo reports I found a third class of bug I hadn't
been aware of. Turns out deleting a single underscore from libX11 fixes
it, at least for me:

http://gitweb.freedesktop.org/?p=xorg/lib/libX11.git;a=commitdiff;h=c2f88cdf5cd9c94b77e5bfdac572b5ac06ab4aa8

I'd comment on the Gentoo bug but it's Bugzilla and requires a login.

After some fiddling (I haven't used XIM for years) I was able to
reproduce this bug:

$ export XMODIFIERS="@im=fcitx"; export QT_IM_MODULE=xim; fcitx & kwrite
...
kwrite: xcb_xlib.c:82: xcb_xlib_unlock: Assertion `c->xlib.lock' failed.
...
#7  0xb7d2546d in __assert_fail () from /lib/libc.so.6
#8  0xb67949a0 in xcb_xlib_unlock (c=0x8056f88) at xcb_xlib.c:82
#9  0xb69a8a7d in _XReply (dpy=0x8056860, rep=0xbfd5b894, extra=0, discard=1)
    at xcb_io.c:368
#10 0xb6987ae7 in _XGetWindowAttributes (dpy=0x8056860, w=58720263, 
    attr=0xbfd5b8f8) at GetWAttrs.c:116
#11 0xb69c4ca1 in _XimGetWindowEventmask (ic=0x824d498) at imDefLkup.c:469
#12 0xb69c4ce8 in _XimTriggerNotify (im=0x824a410, ic=0x824d498, mode=0, 
    idx=0) at imDefLkup.c:521
#13 0xb69bef28 in _XimOnKeysCheck (ic=0x824d498, ev=<value optimized out>)
    at imDefFlt.c:102
#14 0xb69bf09a in _XimFilterKeypress (d=0x8056860, w=58720263, ev=0xbfd5cd48, 
    client_data=0x824d498 "???\020??$\bH??$\b\a") at imDefFlt.c:180
#15 0xb69822fa in XFilterEvent (ev=0xbfd5cd48, window=58720263)
    at FilterEv.c:100

We fixed a double-lock bug with XFilterEvent callbacks by making it
unlock before invoking callbacks. As it turns out, in this case that fix
results in a double-unlock bug because _XimGetWindowEventmask calls a
version of XGetWindowAttributes that doesn't take the Display lock.
Sigh.

--Jamey
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/xcb/attachments/20070610/d79237b5/attachment.pgp 


More information about the Xcb mailing list