Bug 460814 - plasmashell crashed at StatusNotifierItemHost::~StatusNotifierItemHost()
Summary: plasmashell crashed at StatusNotifierItemHost::~StatusNotifierItemHost()
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: System Tray widget (other bugs)
Version First Reported In: 5.26.0
Platform: Other Linux
: NOR crash
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2022-10-21 16:27 UTC by Fushan Wen
Modified: 2022-10-22 00:59 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 5.26.2
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fushan Wen 2022-10-21 16:27:46 UTC
SUMMARY
Not reproducible, looks like it will only happen when restarting plasmashell.


STEPS TO REPRODUCE
1. Restart plasmashell using systemctl
2. 
3. 

OBSERVED RESULT
plasmashell crashed and restarted again

EXPECTED RESULT
No crash

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.26.80
KDE Frameworks Version: 5.100
Qt Version: 5.15.6

ADDITIONAL INFORMATION
(gdb) bt
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=11, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007fdd21f0f893 in __pthread_kill_internal (signo=11, threadid=<optimized out>) at pthread_kill.c:78
#2  0x00007fdd21ebc846 in __GI_raise (sig=11) at ../sysdeps/posix/raise.c:26
#3  0x00007fdd24be2dae in KCrash::defaultCrashHandler(int) (sig=11) at /usr/src/debug/kcrash-5.99.0git.20221009T202607~ebfa91e-ku.3.2.x86_64/src/kcrash.cpp:633
#4  0x00007fdd21ebc910 in <signal handler called> () at /lib64/libc.so.6
#5  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=11, no_tid=no_tid@entry=0) at pthread_kill.c:44
#6  0x00007fdd21f0f893 in __pthread_kill_internal (signo=11, threadid=<optimized out>) at pthread_kill.c:78
#7  0x00007fdd21ebc846 in __GI_raise (sig=11) at ../sysdeps/posix/raise.c:26
#8  0x00007fdd21ebc910 in <signal handler called> () at /lib64/libc.so.6
#9  0x00007fdd21f0a024 in __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x46ec7b0) at futex-internal.c:57
#10 __futex_abstimed_wait_common (futex_word=futex_word@entry=0x46ec7b0, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0, cancel=cancel@entry=true) at futex-internal.c:87
#11 0x00007fdd21f0a0af in __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x46ec7b0, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at futex-internal.c:139
#12 0x00007fdd21f0ccf0 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x46ec760, cond=0x46ec788) at pthread_cond_wait.c:503
#13 ___pthread_cond_wait (cond=0x46ec788, mutex=0x46ec760) at pthread_cond_wait.c:618
#14 0x00007fdd224a474b in QWaitConditionPrivate::wait(QDeadlineTimer) (deadline=..., this=0x46ec760) at thread/qwaitcondition_unix.cpp:146
#15 QWaitCondition::wait(QMutex*, QDeadlineTimer) (this=this@entry=0x45ebb30, mutex=mutex@entry=0x45ebb28, deadline=...) at thread/qwaitcondition_unix.cpp:225
#16 0x00007fdd2320085f in QDBusPendingCallPrivate::waitForFinished() (this=this@entry=0x45ebaf0) at qdbuspendingcall.cpp:240
#17 0x00007fdd231bd376 in QDBusConnectionPrivate::sendWithReply(QDBusMessage const&, int, int) (this=0x7fdd18001c00, message=<optimized out>, sendMode=1, timeout=<optimized out>) at qdbusintegrator.cpp:2088
#18 0x00007fdd231a8d2b in QDBusConnection::call(QDBusMessage const&, QDBus::CallMode, int) const (this=this@entry=0x7fdd1800b0f8, message=..., mode=mode@entry=QDBus::Block, timeout=<optimized out>) at qdbusconnection.cpp:680
#19 0x00007fdd231c71fc in QDBusAbstractInterface::callWithArgumentList(QDBus::CallMode, QString const&, QList<QVariant> const&) (this=this@entry=0x7fdd180081a0, mode=QDBus::Block, mode@entry=QDBus::AutoDetect, method=..., args=...) at qdbusabstractinterface.cpp:494
#20 0x00007fdd231c7adf in QDBusAbstractInterface::doCall(QDBus::CallMode, QString const&, QVariant const*, unsigned long) (this=this@entry=0x7fdd180081a0, mode=mode@entry=QDBus::AutoDetect, method=..., args=args@entry=0x7fffbb107900, numArgs=numArgs@entry=1) at qdbusabstractinterface.cpp:921
#21 0x00007fdd231ad0ef in QDBusAbstractInterface::call<QString const&>(QString const&, QString const&) (method=..., this=0x7fdd180081a0) at ../../include/QtDBus/../../src/dbus/qdbusabstractinterface.h:111
#22 QDBusConnectionInterface::unregisterService(QString const&) (this=0x7fdd180081a0, serviceName=...) at qdbusconnectioninterface.cpp:331
#23 0x00007fdd231a9461 in QDBusConnection::unregisterService(QString const&) (this=this@entry=0x7fffbb1079a8, serviceName=...) at qdbusconnection.cpp:1170
#24 0x00007fdd088bcd70 in StatusNotifierItemHost::~StatusNotifierItemHost() (this=0x7fdd088f0e20 <(anonymous namespace)::Q_QGS_privateStatusNotifierItemHostSelf::innerFunction()::holder>, __in_chrg=<optimized out>) at /mnt/data/home/qydw/Develop/KDE/Plasma/plasma-workspace/applets/systemtray/statusnotifieritemhost.cpp:37
#25 0x00007fdd088bce09 in StatusNotifierItemHostSingleton::~StatusNotifierItemHostSingleton() (this=<optimized out>, __in_chrg=<optimized out>) at /mnt/data/home/qydw/Develop/KDE/Plasma/plasma-workspace/applets/systemtray/statusnotifieritemhost.cpp:18
#26 Holder::~Holder() (this=<optimized out>, __in_chrg=<optimized out>) at /mnt/data/home/qydw/Develop/KDE/Plasma/plasma-workspace/applets/systemtray/statusnotifieritemhost.cpp:24
#27 0x00007fdd21ebf0c5 in __run_exit_handlers (status=1, listp=0x7fdd22064820 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:113
#28 0x00007fdd21ebf250 in __GI_exit (status=<optimized out>) at exit.c:143
#29 0x00007fdd1e190e81 in QXcbConnection::processXcbEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0xa10e30, flags=...) at qxcbconnection.cpp:1049
#30 0x00007fdd1e1bf0e3 in xcbSourceDispatch(GSource*, GSourceFunc, gpointer) (source=<optimized out>) at qxcbeventdispatcher.cpp:103
#31 0x00007fdd20996a50 in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
#32 0x00007fdd20996e08 in  () at /lib64/libglib-2.0.so.0
#33 0x00007fdd20996e9c in g_main_context_iteration () at /lib64/libglib-2.0.so.0
#34 0x00007fdd226dc806 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0xada790, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#35 0x00007fdd22683beb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7fffbb107c80, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#36 0x00007fdd2268bd56 in QCoreApplication::exec() () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#37 0x00007fdd22ad8e5c in QGuiApplication::exec() () at kernel/qguiapplication.cpp:1870
#38 0x00007fdd23429375 in QApplication::exec() () at kernel/qapplication.cpp:2829
#39 0x00000000004248c6 in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /mnt/data/home/qydw/Develop/KDE/Plasma/plasma-workspace/shell/main.cpp:235
Comment 2 Fushan Wen 2022-10-22 00:58:40 UTC
Git commit 4d6ff63939310f8395b613306734ed8aef7d8a5d by Fushan Wen, on behalf of David Edmundson.
Committed on 22/10/2022 at 00:58.
Pushed by fusionfuture into branch 'master'.

systemtray: Avoid dbus calls after exit

StatusNotifierItemHost has the lifespan of the application. If we have
the lifespan of the application calling unregister isn't achieving
anything useful.

It's problematic to do DBus calls after the event loop has stop.

See https://errors-eval.kde.org/organizations/kde/issues/178/
FIXED-IN: 5.26.2

M  +0    -1    applets/systemtray/statusnotifieritemhost.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/4d6ff63939310f8395b613306734ed8aef7d8a5d
Comment 3 Fushan Wen 2022-10-22 00:59:11 UTC
Git commit 89eb2eb653ff05de3c07029296d886cc059df824 by Fushan Wen, on behalf of David Edmundson.
Committed on 22/10/2022 at 00:59.
Pushed by fusionfuture into branch 'Plasma/5.26'.

systemtray: Avoid dbus calls after exit

StatusNotifierItemHost has the lifespan of the application. If we have
the lifespan of the application calling unregister isn't achieving
anything useful.

It's problematic to do DBus calls after the event loop has stop.

See https://errors-eval.kde.org/organizations/kde/issues/178/
FIXED-IN: 5.26.2


(cherry picked from commit 4d6ff63939310f8395b613306734ed8aef7d8a5d)

M  +0    -1    applets/systemtray/statusnotifieritemhost.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/89eb2eb653ff05de3c07029296d886cc059df824