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

Destroying an object connected to a QBatteryInfo can lead to deadlock

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P5: Not important P5: Not important
    • None
    • 5.12.8
    • Other
    • None
    • Ubuntu 20.04 with X11.
    • Linux/X11

      I couldn't find the component for QtSystems.

      Destroying an object connected to QBatteryInfo calls `QBatteryInfo::disconnectNotify` which calls isSignalConnected. However, disconnectNotify documentation is very clear: it cannot call QObject methods that locks the QObject mutex, such as isSignalConnected.

      This causes a deadlock when the connected QObject shares the same QMutex with the QBatteryInfo object.

      It is easy to reproduce by resizing the _q_ObjectMutexPool size to 1.

      Tested on Linux, but should also be the case on Windows and Android.

      Tested with Qt 5.12.8, but should also be the case on Qt5.15 and Qt6 if QtSystems is ported.

        1. qbatterybug.tgz
          0.8 kB
          Hugo Laloge
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            vhilshei Volker Hilsheimer
            hugal31 Hugo Laloge
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes