Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-135848

Data race when calling QDBusConnection::registerService from multiple threads

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 6.9.0
    • D-Bus
    • None
    • Linux/X11

      Imagine an application which exposes multiple objects to DBus. Those objects all derive from common a base class "DBusService", which does:

             QDBusConnection connection = QDBusConnection::sessionBus();
             connection.registerObject("/" + mObjectIdentity, this);
             connection.registerService(mServiceName);

      If those objects are created in multiple threads, it should still work fine (right?), but these concurrent calls to QDBusConnection::registerService create a data race on the lastError variable in QDBusConnectionPrivate.

      tst_qdbusconnection.cpp.diff

      dbusconnection-tsan.log

        1. dbusconnection-tsan.log
          269 kB
          David Faure
        2. tst_qdbusconnection.cpp.diff
          2 kB
          David Faure
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Unassigned Unassigned
            dfaure_kdab David Faure
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes