Bug 504793

Summary: Deleting panels and widgets occasionally causes plasmashell to crash in Plasma::Applet::~Applet()
Product: [Plasma] plasmashell Reporter: Rei kisaragi <houqiyao>
Component: generalAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: ivan.cukic, kde, nate, notmart
Priority: NOR    
Version First Reported In: 6.3.5   
Target Milestone: 1.0   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 6.5.3
Sentry Crash Report:
Attachments: kcrash report

Description Rei kisaragi 2025-05-26 01:46:57 UTC
Created attachment 181752 [details]
kcrash report

Deleting panels and widgets occasionally causes plasmashell to crash 

Application: plasmashell (6.3.5)

ApplicationNotResponding [ANR]: false
Qt Version: 6.9.0
Frameworks Version: 6.14.0
Operating System: Linux 6.14.6-zen1-1-zen x86_64
Windowing System: Wayland
Distribution: Arch Linux
DrKonqi: 6.3.5 [CoredumpBackend]

-- Information about the crash:
Deleting panels and widgets occasionally causes plasmashell to crash

The reporter is unsure if this crash is reproducible.

-- Backtrace:
Application: plasmashell (plasmashell), signal: Segmentation fault
Comment 1 Nate Graham 2025-05-27 18:34:45 UTC
#4  0x0000000000000030 in ?? ()
#5  0x00007735cb1a8dcd in QObject::disconnect(QObject const*, char const*, QObject const*, char const*) () from /usr/lib/libQt6Core.so.6
#6  0x00007735cdac4014 in Plasma::Applet::~Applet() () from /usr/lib/libPlasma.so.6
#7  0x00007735cdac4116 in Plasma::Applet::~Applet() () from /usr/lib/libPlasma.so.6
#8  0x00007735cb1a58db in QObjectPrivate::deleteChildren() () from /usr/lib/libQt6Core.so.6
#9  0x00007735cb1a42dc in QObject::~QObject() () from /usr/lib/libQt6Core.so.6
#10 0x00007735cdad3006 in Plasma::Containment::~Containment() () from /usr/lib/libPlasma.so.6
#11 0x00007735cb1a53be in QObject::event(QEvent*) () from /usr/lib/libQt6Core.so.6
#12 0x00007735cd2fed9e in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt6Widgets.so.6
#13 0x00007735cb15a018 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt6Core.so.6
#14 0x00007735cb15a3f2 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/libQt6Core.so.6
#15 0x00007735cb3cfea8 in ?? () from /usr/lib/libQt6Core.so.6
#16 0x00007735c9cad1e4 in ?? () from /usr/lib/libglib-2.0.so.0
#17 0x00007735c9d10e97 in ?? () from /usr/lib/libglib-2.0.so.0
#18 0x00007735c9cac615 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#19 0x00007735cb3cd59d in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt6Core.so.6
#20 0x00007735cb165376 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt6Core.so.6
#21 0x00007735cb15d159 in QCoreApplication::exec() () from /usr/lib/libQt6Core.so.6
#22 0x000061d2b3a9170a in ?? ()
#23 0x00007735caa376b5 in ?? () from /usr/lib/libc.so.6
#24 0x00007735caa37769 in __libc_start_main () from /usr/lib/libc.so.6
#25 0x000061d2b3a91c45 in ?? ()
Comment 2 Bug Janitor Service 2025-11-07 11:59:36 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/libplasma/-/merge_requests/1386
Comment 3 Marco Martin 2025-11-07 13:40:25 UTC
Git commit 092e52c2518f28226c60a39e4187b658fa809f79 by Marco Martin.
Committed on 07/11/2025 at 11:52.
Pushed by mart into branch 'master'.

Always clean contextualActions when they are deleted

Applet on close disconnects from all its contextualActions
but they are QML owned, so they can be deleted anytime
it did not clean when the applet was in destroyed mode,
causing a potential crash if the contextual action
itself was deleted while applet is in destroyed mode

M  +0    -2    src/plasma/private/applet_p.cpp

https://invent.kde.org/plasma/libplasma/-/commit/092e52c2518f28226c60a39e4187b658fa809f79
Comment 4 Marco Martin 2025-11-07 13:41:02 UTC
Git commit 1b49126b8a6f99823761007751a5ce3cf296703f by Marco Martin.
Committed on 07/11/2025 at 13:40.
Pushed by mart into branch 'Plasma/6.5'.

Always clean contextualActions when they are deleted

Applet on close disconnects from all its contextualActions
but they are QML owned, so they can be deleted anytime
it did not clean when the applet was in destroyed mode,
causing a potential crash if the contextual action
itself was deleted while applet is in destroyed mode


(cherry picked from commit 092e52c2518f28226c60a39e4187b658fa809f79)

092e52c2 Always clean contextualActions when they are deleted

Co-authored-by: Marco Martin <notmart@gmail.com>

M  +0    -2    src/plasma/private/applet_p.cpp

https://invent.kde.org/plasma/libplasma/-/commit/1b49126b8a6f99823761007751a5ce3cf296703f