Xlib can deadlock when using mutlithreaded
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libx11 (Ubuntu) |
Fix Released
|
High
|
Unassigned |
Bug Description
When Xlib is used aggresivly in multi thread environments it can deadlock although XInitThreads is set.
Samplecode is attached. To compile use
g++ -g xlibtest.cpp -o xlibtest -lX11 -lpthread
When you run it, the program should come to no end (as it continously sends XGetGeometry messages in two threads), but here it deadlocks.
gdb output:
[Switching to thread 2 (Thread 0x4258c950 (LWP 19625))]#0 0x000000304ae0ab99 in
pthread_
(gdb) bt
#0 0x000000304ae0ab99 in pthread_
from /lib/libpthread
#1 0x000000304ca47bba in ?? () from /usr/lib/
#2 0x000000304ca47fa5 in _XReply () from /usr/lib/
#3 0x000000304ca254f6 in XGetGeometry () from /usr/lib/
#4 0x0000000000400c71 in func (data=0x7fffef8
#5 0x000000304ae063f7 in start_thread () from /lib/libpthread
#6 0x000000304a2d7b2d in clone () from /lib/libc.so.6
#7 0x0000000000000000 in ?? ()
(gdb) thread 3
[Switching to thread 3 (Thread 0x42d8d950 (LWP 19626))]#0 0x000000304ae0ab99 in
pthread_
(gdb) bt
#0 0x000000304ae0ab99 in pthread_
from /lib/libpthread
#1 0x000000304ca47bba in ?? () from /usr/lib/
#2 0x000000304ca47fa5 in _XReply () from /usr/lib/
#3 0x000000304ca254f6 in XGetGeometry () from /usr/lib/
#4 0x0000000000400c71 in func (data=0x7fffef8
#5 0x000000304ae063f7 in start_thread () from /lib/libpthread
#6 0x000000304a2d7b2d in clone () from /lib/libc.so.6
#7 0x0000000000000000 in ?? ()
When switching to one working thread (change num to 1 in line 29) it works.
Changed in libx11: | |
assignee: | bryceharrington → nobody |
Changed in libx11: | |
status: | Triaged → Incomplete |
Ubuntu version is 8.04 Hardy AMD64