Bug 60560 - Deadlock in XCB enabled libX11
Summary: Deadlock in XCB enabled libX11
Status: RESOLVED MOVED
Alias: None
Product: xorg
Classification: Unclassified
Component: Lib/Xlib (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-09 22:33 UTC by spaceduzi
Modified: 2018-08-10 20:10 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description spaceduzi 2013-02-09 22:33:03 UTC
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
Comment 1 Uli Schlachter 2013-02-09 23:47:07 UTC
This is a bug in Xlib (xcb_io.c is part of Xlib, not xcb). There are some known thread-safety issues with xcb-enabled Xlib, so this might be a duplicate of some other bug. However, a quick search didn't find anything obvious.
Comment 2 GitLab Migration User 2018-08-10 20:10:26 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/lib/libx11/issues/26.


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.