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

Deadlock when destroying server while a thread is in qDBusNewConnection

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.12
    • Fix Version/s: 5.9.9, 5.12.5, 5.14.0 Alpha
    • Component/s: D-Bus
    • Labels:
      None
    • Commits:
      6d3a4546934827955f0eb2b07a9928f82790ba37 (qt/qtbase/5.12) 2ed7831ff636f4fbaec27524d416d63c2fd773bf (qt/qtbase/5.9)

      Description

      Noticed in a test failure: https://testresults.qt.io/logs/qt/qtbase/efd2577fdc2cdbddbddc688e2f1d0e2db0ba3d85/LinuxRHEL_7_4x86_64LinuxRHEL_7_4x86_64GCCqtci-linux-RHEL-7.4-x86_64-fa00a5Release_NoUseGoldLinker_ForceDebugInfo_SeparateDebugInfo/2a48a3b7dcb9652b1532a3ad14de7580b5b9b1ee/test_1553184371/log.txt.gz

       

      The issue seems to occur when `void tst_QDBusConnection::connectToPeer()` fails on ` QVERIFY(con.isConnected());` after ` QDBusConnection::disconnectFromBus("bubu");`. That causes a 'return' and the server is starts destructing.

      QDBusServer::~QDBusServer() locks `d->lock` followed by `QDBusConnectionManager::instance()->mutex`.

      `static void qDBusNewConnection(DBusServer *server, DBusConnection *connection, void *data)` locks the same locks, but in the opposite order.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            • Assignee:
              manordheim Mårten Nordheim
              Reporter:
              manordheim Mårten Nordheim
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes