Keep Qt's own message dialogs on Plasma (fixes SIGSEGV in ~QMessageBox) - #69
Open
wehrwolfmann wants to merge 1 commit into
Open
Keep Qt's own message dialogs on Plasma (fixes SIGSEGV in ~QMessageBox)#69wehrwolfmann wants to merge 1 commit into
wehrwolfmann wants to merge 1 commit into
Conversation
On Plasma our message boxes go through KDEPlatformMessageDialogHelper. It creates its own QMessageBox, sets Qt::WA_DeleteOnClose on it and keeps a raw pointer to it. QDialog::exec() deletes that dialog when it closes, so the helper is left with a dangling pointer; the later hide() call from ~QMessageBox dereferences freed memory and kills the app with SIGSEGV. The defect is in plasma-integration, but every QMessageBox in the app is exposed to it, so keep Qt's own dialogs instead. Nothing changes visually - the "native" Plasma dialog is a QMessageBox as well. Measured with the patch: 10 About/License cycles under a debugger, zero helper dialogs created and zero setNativeDialogVisible calls. Without it the helper dialog is created and destroyed before our own box on every click.
wehrwolfmann
force-pushed
the
crash-native-message-dialog
branch
from
August 22, 2026 21:58
4eb0adb to
39ac19f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #68 — the analysis and the core-dump frames are there.
Short version: on Plasma
KDEPlatformMessageDialogHelpercreates its ownQMessageBox, setsQt::WA_DeleteOnCloseon it and keeps a raw pointer.QDialog::exec()deletes that dialog when it closes, so the helper is left with a dangling pointer, and thehide()call from~QMessageBoxwalks into freed memory.The real defect is in plasma-integration and I am reporting it there as well, but every
QMessageBoxin this app is exposed to it, so this one line keeps Qt's own dialogs. Nothing changes visually — the "native" Plasma dialog is aQMessageBoxtoo.Measured: with the patch, 10 About/License cycles under a debugger produce zero helper dialogs and zero
setNativeDialogVisiblecalls, app alive. Without it the helper dialog is created and destroyed before the app's own box on every single About click.