Note that there are some explanatory texts on larger screens.

plurals
  1. POxlib/ xcb deadlock or block
    text
    copied!<p>I’ve a program developed using xlib and cairo. Just for the reference I do mix calls between cairo and xlib, although I’m not sure If that might be the cause of the error. I get a deadlock or a block in some situations. I’ve three threads that work with xlib. One is the main UI thread which makes calls to both xlib and cairo, another uses it just to send a XClientMessage and third makes some xlib calls like XCopyArea and at the end send an XClientMessage (those are for some animations). I’ve called InitThreads in the beginning of the program. I’ve also guarded all xlib calls with XLockDisplay (cairo calls are also guarded with XLockDisplay). I’m using ubuntu 10.10. The stack traces are:</p> <blockquote> <p>(gdb) thread 1<br> 0 in __kernel_vsyscall ()<br> 1 in poll () from /lib/tls/i686/cmov/libc.so.6<br> 2 in ?? () from /usr/lib/libxcb.so.1<br> 3 in ?? () from /usr/lib/libxcb.so.1<br> 4 in xcb_writev () from /usr/lib/libxcb.so.1<br> 5 in _XSend () from /usr/lib/libX11.so.6<br> 6 in _XEventsQueued () from /usr/lib/libX11.so.6<br> 7 in XPending () from /usr/lib/libX11.so.6<br> (gdb) thread 6<br> 0 in __kernel_vsyscall ()<br> 1 in __lll_lock_wait () from<br> /lib/tls/i686/cmov/libpthread.so.0<br> 2 in _L_lock_752 () from /lib/tls/i686/cmov/libpthread.so.0<br> 3 in pthread_mutex_lock () from /lib/tls/i686/cmov/libpthread.so.0<br> 4 in ?? () from /usr/lib/libX11.so.6<br> 5 in XLockDisplay () from /usr/lib/libX11.so.6<br> (gdb) thread 7<br> 0 in __kernel_vsyscall ()<br> 1 in __lll_lock_wait () from /lib/tls/i686/cmov/libpthread.so.0<br> 2 in _L_lock_752 () from /lib/tls/i686/cmov/libpthread.so.0<br> 3 in pthread_mutex_lock () from /lib/tls/i686/cmov/libpthread.so.0<br> 4 in ?? () from /usr/lib/libX11.so.6<br> 5 in XLockDisplay () from /usr/lib/libX11.so.6<br> Where thread 1 is the main ui thread, currently calling XPending (it has already called XLockDisplay) in an event loop, thead 7 is the thread that just sends XClientMessage and thread 6 is the thread that has made some calls to XCopyArea and is now about to make a call to XSendMessage (it is waiting along with thread 7 for thread 1 to finish). But thread 1 never seem to return from poll. I’m not sure it is relevant (I’m by no means an expert on linux or libc), but I’ve another thread waiting in poll (it’s a thread for TCP/IP network communication) (gdb) thread 2<br> 0 in __kernel_vsyscall ()<br> 1 in poll () from /lib/tls/i686/cmov/libc.so.6<br> Has anyone experience similar deadlock/block? Can this be a bug in xcb and is it worth trying to compile xlib without xcb? Thanks</p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload