dbus deadlock

frederic heem frederic.heem at telsey.it
Mon Jan 15 09:07:42 PST 2007


Hi,
An application using QtDbus stopped working today, it prints the following 
message and hangs 
QMutex::lock: Deadlock detected in thread -1208973632
At the stage of initializing D-Bus, the application doesn't use thread so what 
a surprise to see a thread related bug in a single thread application
Actually, the qt message seems to be wrong, it is not a dead lock but an error 
related a non recursive mutex that is lock 2 times by the same thread.
Here is the code in  qmutex.cpp 
          if (d->owner == self) {
                qWarning("QMutex::lock: Deadlock detected in thread %ld", 
d->owner);
            }

            // didn't get the lock, wait for it
            d->wait(); /////<<<<<< STUCK HERE

Here is the backtrace:

(gdb) backtrace 
#0  0x009a97a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1  0x00462b26 in pthread_cond_wait@@GLIBC_2.3.2 () 
from /lib/tls/libpthread.so.0
#2  0x00404b17 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/libc.so.6
#3  0x00836f08 in QMutexPrivate::wait (this=0x9702dd8) at 
thread/qmutex_unix.cpp:59
#4  0x00834362 in QMutex::lock (this=0x9702dc8) at thread/qmutex.cpp:192
#5  0x00de173b in DBusMutex::mutex_lock (mutex=0x9702dc8) at 
qdbusthread.cpp:48
#6  0x00f33666 in _dbus_mutex_lock (mutex=0x9702dc8) at dbus-threads.c:150
#7  0x00f13794 in _dbus_bus_notify_shared_connection_disconnected_unlocked 
(connection=0x96c5420) at dbus-bus.c:353
#8  0x00f18628 in _dbus_connection_get_dispatch_status_unlocked 
(connection=0x96c5420) at dbus-connection.c:3788
#9  0x00f19fb8 in _dbus_connection_flush_unlocked (connection=0x96c5420) at 
dbus-connection.c:3239
#10 0x00f1b7c0 in _dbus_connection_block_pending_call (pending=0x96c5720) at 
dbus-connection.c:2234
#11 0x00f2dcab in dbus_pending_call_block (pending=0x96c5720) at 
dbus-pending-call.c:707
#12 0x00f1c60f in dbus_connection_send_with_reply_and_block 
(connection=0x96c5420, message=0x96c5870, timeout_milliseconds=-1, 
error=0x96a6bac) at dbus-connection.c:3186
#13 0x00f138fa in dbus_bus_register (connection=0x96c5420, error=0x96a6bac) at 
dbus-bus.c:646
#14 0x00f13cfc in internal_bus_get (type=DBUS_BUS_SYSTEM, private=1, 
error=0x96a6bac) at dbus-bus.c:445
#15 0x00db5391 in QDBusConnection::connectToBus 
(type=QDBusConnection::SystemBus, name=@0xbfe9e870) at 
qdbusconnection.cpp:330
#16 0x00db547a in QDBusConnection::systemBus () at qdbusconnection.cpp:864
#17 0x08082c24 in OpalTesterProcess::SnifferInitialise (this=0x96a5758) 
at /home/heefre/svn/trunk/voxgratia/OpalTester/src/Main.cxx:543

Anyone has already experienced the problem ?
Should I create a bug report ?
Here is the systen: CentOs4.4/dbus-1.0,/QtDBus 4.2
Thanks,
Frederic Heem


More information about the dbus mailing list