Multithreading with QtDBus

Thiago Macieira thiago at kde.org
Thu Nov 1 08:03:38 PDT 2012


On quinta-feira, 1 de novembro de 2012 14.14.11, Ogden, Nick wrote:
> Greetings,
> 
> I have a program that does the following:
> 1) Creates a QCoreApplication
> 2) Creates a third party component (read: black box) which internally spawns
> multiple threads 3) Creates a QDBusConnection and connects to some DBus
> signals
> 4) Enters the main Qt event loop
> 
> From here onwards, the third party black box makes calls, on whatever thread
> it feels is appropriate, to some handler functions in the application, that
> are required to retrieve some data via DBus. Each thread creates its own
> proxy object and makes a blocking call over DBus by means of
> QDBusPendingReply::waitForFinished(). These proxy objects share the same
> underlying QDBusConnection object.
> 
> My first question is whether or not this usage scenario is supported /
> expected to work with QtDBus?

I don't see anything that shouldn't work.

> I am experiencing frequent crashes from deep in libdbus-1 when running this
> application on Windows (I have not tested on Linux etc). I have attached a
> small test case which is representative of the usage scenario and
> reproduces this crash 100% of the time. Could someone please confirm
> whether this is a bug, or an unsupported use case for QtDBus and I will
> file a bug report as appropriate.

I can reproduce the crash here too, on Linux.

process 10929: arguments to dbus_pending_call_block() were incorrect, 
assertion "pending != NULL" failed in file dbus-pending-call.c line 704.

Backtrace:

#2  0x0000003a3c630035 in _dbus_abort () at dbus-sysdeps.c:94
#3  0x0000003a3c6270c5 in _dbus_warn_check_failed (format=
    0x3a3c636290 "arguments to %s() were incorrect, assertion \"%s\" failed in 
file %s line %d.\nThis is normally a bug in some application using the D-Bus 
library.\n") at dbus-internals.c:289
#4  0x000000397182144a in q_dbus_pending_call_block (pending=0x0)
    at /home/thiago/src/qt/qt-4.8/src/dbus/qdbus_symbols_p.h:313
#5  QDBusConnectionPrivate::waitForFinished(QDBusPendingCallPrivate*) 
(this=0x621220, pcall=0x7fffcc002fc0)
    at /home/thiago/src/qt/qt-4.8/src/dbus/qdbusintegrator.cpp:1776

Clearly a QtDBus bug because it passed a null where it shouldn't. Please file 
your bug report.
-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20121101/0145eca2/attachment.pgp>


More information about the dbus mailing list