Multithreading with QtDBus

Ogden, Nick nick.ogden at
Thu Nov 1 08:32:16 PDT 2012

Thanks for your help Thiago.

I've filed a bug at:

Nick Ogden

-----Original Message-----
From: at [ at] On Behalf Of Thiago Macieira
Sent: 01 November 2012 15:04
To: dbus at
Subject: Re: Multithreading with QtDBus

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.


#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) - thiago (AT)
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

The details of this company are as follows:
G4S Technology Limited, Registered Office: Challenge House, International Drive, Tewkesbury, Gloucestershire GL20 8UQ, Registered in England No. 2382338.

This communication may contain information which is confidential, personal and/or privileged.

It is for the exclusive use of the intended recipient(s).
If you are not the intended recipient(s), please note that any distribution, forwarding, copying or use of this communication or the information in it is strictly prohibited.

Any personal views expressed in this e-mail are those of the individual sender and the company does not endorse or accept responsibility for them.

Prior to taking any action based upon this e-mail message, you should seek appropriate confirmation of its authenticity.

This e-mail has been scanned for all viruses by MessageLabs.

More information about the dbus mailing list