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

Disconnect all -> crash in QAccessibilityCache

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 6.8
    • None
    • Linux/X11, Windows

    Description

      It says in here that `Note: Disconnecting all signal-slot connections will also disconnect the QObject::destroyed() signal if it is connected. Doing so can adversely affect classes that rely on this signal for cleaning up resources. It is recommended to disconnect only the specific signals that were connected by application code.`

      However, disconnecting all should not result in crashes like in the attached project.

      To reproduce:

      • Open and run the attached application
      • press the button in mainwindow
      • close the empty dialog
      • press the button again
      • CRASH!

      The crash is due to QAccessibleCache's over-reliance on `QObject::destroyed`. I'm not exactly sure in which qt version this crash first appears, but it did not appear in Qt 6.1.3, but appeared in Qt 6.8.1.

      NB! In the project I've used placement new merely to make the crash deterministic. Without placement new the crash might take more clicks to get the system to reuse the same memory address for the QDialog, which is needed for the crash to occur.

      Attachments

        1. disconnect_crash.pro
          0.6 kB
          Marcus Leivo
        2. mainwindow.h
          0.8 kB
          Marcus Leivo
        3. mainwindow.ui
          1.0 kB
          Marcus Leivo
        4. main.cpp
          0.2 kB
          Marcus Leivo
        5. stack_trace.txt
          7 kB
          Marcus Leivo
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            marcusle Marcus Leivo
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes