Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.12.4
-
None
-
-
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
Issue Links
- is duplicated by
-
QTBUG-80979 When combobox widget popup, clicking other widgets causes the crash
- Closed
-
QTBUG-76661 Segmentation Fault When Scrolling Window Contents
- Closed
-
QTBUG-76824 QDialog subclass does not paint on second show. Moving scrollbar in the QDialog subclass then causes ASSERT failure in QWidget::mapTo(const QWidget *parent, const QPoint &pos): "parent must be in parent hierarchy", file kernel/qwidget.cpp, line 4253
- Closed
-
QTBUG-77458 Application crash when dialog-based window was closed and then shown again.
- Closed
-
QTBUG-77021 [Reg 5.12.3-> 5.12.4] Reopen a closed dialog/widget by click Windows [x] the dialog/widget is blank.
- Closed
- relates to
-
QTBUG-77619 [REG 5.9.4->5.12.4] Dialog "white out" (only frame paint of dialog/window)
- Closed
- replaces
-
QTCREATORBUG-22725 Qt Creator crashes while mouse wheel on locator popup
- Closed
-
QTBUG-76791 [5.12.4] Assert at QWidget::mapTo()
- Closed
-
QTBUG-77068 Often crashes in MacOS 10.15 Beta when editing C++ code
- Closed
- resulted from
-
QTBUG-69289 Crash on macOS when using winId() after hiding/showing QMainWindow (introduced in Qt 5.11)
- Closed