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

Deadlock on dbus

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • None
    • 5.3.0
    • D-Bus
    • None

    Description

      libdbus-1 has a recursive lock on its DBusConnection. When the signal arrives, the lock is acquired and the sginal handler is run. The signal handler can make DBus calls (which also require the lock) because the lock is recursive. QtDBus also has a lock that is always acquired before the libdbus-1 connection lock is acquired.

      Unfortuntaely, the QtDBus lock is not acquired in the case of the incoming call from DBus – only the DBus lock is.

      If another thread tries to do an unrelated DBus call meanwhile, it will acquire the QtDBus lock first and then the DBus lock (which is held because of the signal that arrived). Once the signal handler gets to the point of wanting to make a DBus call (in order to query the properties of the just-added network device) it will attempt to acquire the QtDBus lock. This is a lock-inversion deadlock.

      QtDBus could be fixed in order to avoid this sort of lock inversion problem.

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            tsdgeos_canonical Albert Astals Cid (Canonical) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes