Deadlock in XCB enabled libX11
Submitted by spa..@..il.com
Assigned to Xorg Project Team
Description
OS: Ubuntu 12.04.1 libx11-1.4.99.1
I have a multi-thread application written with XLib which ends in a deadlock on Ubuntu 12.04.1. The app has worked fine on previous Ubuntu releases (I'm not sure if there was an XCB enabled libX11).
I noticed the following 2 scenarios:
Thread 2 (Thread 0xb7c64b40 (LWP 23423)):
#0 0xb7e94a27 in poll_for_event (dpy=0x8182498) at ../../src/xcb_io.c:248
#1 0xb7e94bdf in poll_for_response (dpy=0x8182498) at ../../src/xcb_io.c:288
#2 0xb7e95286 in _XReadEvents (dpy=0x8182498) at ../../src/xcb_io.c:423
#3 0xb7e83cf0 in XNextEvent (dpy=0x8182498, event=0xb7c642fc) at ../../src/NextEvent.c:50
#4 0x0804cfba in xwndw_loop (unused=0x0) at ../../../bnns/src/eloop.c:370
#5 0xb7e48d4c in start_thread (arg=0xb7c64b40) at pthread_create.c:308
#6 0xb7d86d3e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130
Thread 1 (Thread 0xb7c656c0 (LWP 23422)):
#0 _XReply (dpy=0x8182498, rep=0xbffff548, extra=0, discard=1) at ../../src/xcb_io.c:623
#1 0xb7e7b598 in _XGetWindowAttributes (dpy=0x8182498, w=88080399, attr=0xbffff5d8) at ../../src/GetWAttrs.c:114
#2 0xb7e7b6e5 in XGetWindowAttributes (dpy=0x8182498, w=88080399, attr=0xbffff5d8) at ../../src/GetWAttrs.c:149
#3 0x08053dc2 in open_extview_xwndw (width=200, height=200) at ../../../bnns/src/vis.c:561
#4 0x0804a823 in bsh () at ../../../bnns/src/bsh.c:230
#5 0x0804a07e in bsh_init (patterns_path=0xbffffa5a "/home/uzak/projects/bnns/patterns", log_path=0x805738b "./log", task_name=0xbffffa82 "spiral", up=0xbffff7c0, cp=0xbffff7b8, eep=0xbffff7bc) at ../../../bnns/src/bsh.c:94
#6 0x0804e2f0 in main (argc=9, argv=0xbffff8c4) at ../../../bnns/src/main.c:299
Thread 2 (Thread 0xb7c64b40 (LWP 23742)):
#0 0xb7fdd424 in __kernel_vsyscall ()
#1 0xb7d785f0 in __GI___poll (fds=0xb7c641f8, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:87
#2 0xb7c7f120 in ?? () from /usr/lib/i386-linux-gnu/libxcb.so.1
#3 0xb7c80da9 in xcb_wait_for_event () from /usr/lib/i386-linux-gnu/libxcb.so.1
#4 0xb7e952d7 in _XReadEvents (dpy=0x8182498) at ../../src/xcb_io.c:400
#5 0xb7e83cf0 in XNextEvent (dpy=0x8182498, event=0xb7c642fc) at ../../src/NextEvent.c:50
#6 0x0804cfba in xwndw_loop (unused=0x0) at ../../../bnns/src/eloop.c:371
#7 0xb7e48d4c in start_thread (arg=0xb7c64b40) at pthread_create.c:308
#8 0xb7d86d3e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130
Thread 1 (Thread 0xb7c656c0 (LWP 23741)):
#0 _XReply (dpy=0x8182498, rep=0xbffff548, extra=0, discard=1) at ../../src/xcb_io.c:623
#1 0xb7e7b598 in _XGetWindowAttributes (dpy=0x8182498, w=88080399, attr=0xbffff5d8) at ../../src/GetWAttrs.c:114
#2 0xb7e7b6e5 in XGetWindowAttributes (dpy=0x8182498, w=88080399, attr=0xbffff5d8) at ../../src/GetWAttrs.c:149
#3 0x08053dc2 in open_extview_xwndw (width=200, height=200) at ../../../bnns/src/vis.c:565
#4 0x0804a823 in bsh () at ../../../bnns/src/bsh.c:230
#5 0x0804a07e in bsh_init (patterns_path=0xbffffa5a "/home/uzak/projects/bnns/patterns", log_path=0x805738b "./log", task_name=0xbffffa82 "spiral", up=0xbffff7c0, cp=0xbffff7b8, eep=0xbffff7bc) at ../../../bnns/src/bsh.c:94
#6 0x0804e2f0 in main (argc=9, argv=0xbffff8c4) at ../../../bnns/src/main.c:299