SIGSEGV in ~QMessageBox on Plasma - native message dialog helper is used after free
Maintainer thường phản hồi trong vòng 1 ngày
@wehrwolfmann đang làm issue này rồi.
Từ ngày 22/8/2026.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 85/100
Hướng nghiên cứu
Bắt đầu trong src/main.cpp, quanh main(), nơi các thuộc tính của ứng dụng được cấu hình, và xem xét cài đặt hộp thoại native đã được báo cáo. Chạy thử các hộp thoại About và License dưới trình gỡ lỗi, như trong báo cáo. Được xem là hoàn tất khi Plasma helper QMessageBox không được khởi tạo, setNativeDialogVisible không được gọi và việc lặp lại các chu kỳ hộp thoại không gây crash.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
cachyos-pi 1.6.2, Qt 6.11.2, plasma-integration 6.7.4, Plasma 6 / Wayland.
What I did: a package install was running (pkexec pacman -S krita), I pressed "About" and
closed the About box. The app died with SIGSEGV. The core dump is kept, key frames below.
What happens: on Plasma our message boxes are shown as native dialogs.
KDEPlatformMessageDialogHelper::show() 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 keeps a dangling pointer. Later, when our QMessageBox is destroyed,
~QMessageBox -> QMessageBoxPrivate::setVisible(false) -> QDialogPrivate::setNativeDialogVisible(false)
-> helper->hide() -> m_dialog->hide() reads the freed object and calls through a garbage vtable.
Key frames from the core:
#0 0x0000000000000071 <- jump through freed vtable
#1 QDialogPrivate::setNativeDialogVisible(bool)
#2 QMessageBoxPrivate::setVisible(bool)
#3 QMessageBox::~QMessageBox()
#4 about::display_about_msgbox() (src/about.cpp:16)
In the core: nativeDialogInUse = 1, m_platformHelper is a KDEPlatformMessageDialogHelper, and
its m_dialog member points into a freed 40-byte block. Its hide() is literally
`mov 0x20(%rdi),%rdi; jmp QWidget::hide` - no null check, no QPointer.
The defect itself is in plasma-integration and I am reporting it there too, but every
QMessageBox in the app is exposed to it, so the patch below simply keeps Qt's own dialogs.
Nothing changes visually - the "native" Plasma dialog is a QMessageBox as well.
What I measured: with the patch the helper dialog is never created - 10 About/License cycles
under a debugger, zero helper QMessageBox constructions and zero setNativeDialogVisible calls,
app alive. Without the patch the helper dialog is created and destroyed before our own box on
every single About click, i.e. the dangling pointer is there every time.
Patch
diff --git a/src/main.cpp b/src/main.cpp
index bd9fb40..a1b964a 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -138,6 +138,12 @@ auto main(int argc, char** argv) -> std::int32_t {
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
+ // Keep using Qt's own dialogs. The Plasma platform theme creates a helper QMessageBox
+ // for every native message dialog, marks it WA_DeleteOnClose and keeps a raw pointer
+ // to it. QDialog::exec() deletes that helper dialog when it closes, so the later
+ // hide() call from ~QMessageBox dereferences freed memory and can kill the app.
+ QApplication::setAttribute(Qt::AA_DontUseNativeDialogs);
+
/// 2. Application identification
QApplication::setOrganizationName("cachyos");
QApplication::setOrganizationDomain("cachyos.org");
- Ngôn ngữ chính
- C++
- Star
- 43
- Fork
- 39
- Merge trung bình
- 1 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 12
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của CachyOS/packageinstaller
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
CachyOS/packageinstaller#144 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
CachyOS/packageinstaller#133 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
CachyOS/packageinstaller#76 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
CachyOS/packageinstaller#143 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
CachyOS/packageinstaller#136 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của CachyOS/packageinstaller
Issue tương tự
-
documentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
TomerAberbach/profiler-md#951 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] Default key routing (JavaStringHash) picks a different partition than the Java client for about half of keysCó thể đã có người làm @0z5a đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
apache/pulsar-client-go#1575 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
pocoproject/poco#5764 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug cpp-core-guidelines low-priority
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
NatronGitHub/openfx-supportext#164 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày