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

[REG 5.12.3 -> 5.12.4] Floating QDialogs after title bar close cause seqfaults in mapTo when relaunched

    XMLWordPrintable

Details

    • Linux/X11, macOS
    • deac052a40c93633041da058d5c73c9e91aa76c7 (qt/qtbase/5.12)

    Description

      The lastest Qt 5.12.4 has severely broken our app Sigil. It seems that any time a floating QDialog is closed via the titlebar x close, it corrupts something resulting in syncBackingStore invoking QWidget::mapTo which segfaults when it sees the eventual parent (w) is null (ie the window is top level with a null parent).

      I have attached a standalone test case to illustrate the issue. It uses a QWebEngineView in a floating non-modal QDialog but any content that needs a backing store is enough to cause the crash.

      Note the crash only happens with Qt 5.12.4 (all earlier Qt 5.12.X version work just fine).

      To reproduce on macOS (and Linux):

      unzip bug.zip
      cd bug
      export PATH=~/Qt512.4/bin:${PATH}
      qmake
      make
      lldb ./bug.app

      A floating QDialog will be shown. Hit the close x on its title bar.

      Once the close is detected, the MainWindow will try to show the QDialog again but
      will either show nothing (rare) or will segfault in QWidget::mapTo.

      Here is the original backtrace on Linux from Sigil:

      (see attachment)

      And here is the segfault backtrace from this test program on macOS.

      (see attachment)

      Please note, calling close directly on the QDialog has no problems. So somehow invoking the close x on the titlebar is changing or corrupting something.

      FWIW, the same problem happens with undocked QDockWidget windows.

      INtroduced by "Reset QWidget's winId when backing window surface is destroyed" a9246c7132a2c8864d3ae6cebd260bb9ee711fcb https://codereview.qt-project.org/c/qt/qtbase/+/261247

      Attachments

        1. bug.zip
          4 kB
          Kevin B. Hendricks
        2. bugv3.zip
          4 kB
          Kevin B. Hendricks
        3. macOS_backtrace_from_bug_sample_code.txt
          3 kB
          Kevin B. Hendricks
        4. original_linux_backtrace_from_Sigil.txt
          2 kB
          Kevin B. Hendricks

        Issue Links

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

          Activity

            People

              vestbo Tor Arne Vestbø
              kevinhendricks Kevin B. Hendricks
              Votes:
              3 Vote for this issue
              Watchers:
              16 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes