Plasmashell crashes every time on screen timeout when second monitor attached

Hi, I am asking for help here before posting a bug because I was told to do that here first.
Following problem: My plasmashell is crashing every time my screen automatically turns off (configured display timeout) causing my second monitor to turn on again.

How can I debug this problem? I have a /var/crash/_usr_bin_plasmashell.1000.crash file.
Thanks!

Edit: it does not matter which monitor is selected as primary

Did you compile KDE/Plasma yourself or are you using a Distribution?

Oh, completely forgot: using Kubuntu 23.04, Plasma 5.27.4, fresh install. Thanks!

Sorry this is happening. To debug it, we’ll need a backtrace of the crash inside a bug report. See:

I will try to get that. However, I cannot install “systemd-coredump” (providing the coredumpctl) without it uninstalling some other system packages. Is that intended?

❯ sudo nala install systemd-coredump
====================================================================================================================
 Installing                                                                                                         
====================================================================================================================
  Package:                              Version:                                                             Size:  
  systemd-coredump                      252.5-2ubuntu3                                                       70 KB  
                                                                                                                    
====================================================================================================================
 Auto-Removing                                                                                                      
====================================================================================================================
  Package:                              Version:                                                             Size:  
  apport-symptoms                       0.24                                                                 62 KB  
  kubuntu-notification-helper           19.10ubuntu2                                                        757 KB  
  libkubuntu1                           18.04ubuntu2                                                         98 KB  
  python3-systemd                       235-1build2                                                         216 KB  
  qapt-batch                            3.0.5-2                                                             609 KB  
                                                                                                                    
====================================================================================================================
 Removing                                                                                                           
====================================================================================================================
  Package:                              Version:                                                             Size:  
  apport                                2.26.1-0ubuntu2                                                     668 KB  
  apport-kde                            2.26.1-0ubuntu2                                                      79 KB  
                                                                                                                    
====================================================================================================================
 Summary                                                                                                            
====================================================================================================================
 Install     1 Packages                                                                                             
 Auto-Remove 5 Packages                                                                                             
 Remove      2 Packages                                                                                             
                                                                                                                    
 Total download size   70 KB   
 Disk space to free   2.2 MB   
                               
Do you want to continue? [Y/n]

How bizarre. They should be fine to remove but you’ll be losing apport, which is Ubuntu’s own crash reporting tool. Of course crashes reported using it don’t go to KDE but rather the Launchpad black hole. I think they should be fine to remove, but if you don’t want to, I guess you can use apport to get a backtrace as well.

Thanks @ngraham! Indeed - I got a stacktrace using apport-retrace. I attached it. Is that what you are looking for? Can you find the cause from that log?

❯ apport-retrace --stdout /var/crash/_usr_bin_plasmashell.1000.crash
E: You must put some 'deb-src' URIs in your sources.list
dpkg-source: warning: -sn is not a valid option for Dpkg::Source::Package::V3::Quilt
gpgv: Signature made Do 06 Apr 2023 10:39:42 CEST
gpgv:                using RSA key 0CCBCFACAEBDBB9C2C8F34B622A04BEF9168BAD5
gpgv:                issuer "rikmills@kde.org"
gpgv: Can't check signature: No public key
dpkg-source: warning: cannot verify inline signature for /tmp/tmpkwv2zout/plasma-workspace_5.27.4.1-0ubuntu1.dsc: no acceptable signature found
--- stack trace ---
#0  __GI___pthread_sigmask (how=1, newmask=<optimized out>, oldmask=0x0) at ./nptl/pthread_sigmask.c:43
        local_newmask = {__val = {140614625315952, 32, 41, 8461816663211521631, 7596498852877118840, 140721675512768, 42, 140614580516352, 2, 1, 140721675512768, 140614578825823, 140614625322248, 140721675513024, 140614580532896, 140614625322248}}
        result = 0
#1  0x00007fe36203c6ad in __GI___sigprocmask (how=<optimized out>, set=<optimized out>, oset=<optimized out>) at ../sysdeps/unix/sysv/linux/sigprocmask.c:25
        result = <optimized out>
#2  0x00007fe364caafcf in KCrash::setCrashHandler(void (*)(int)) () from /lib/x86_64-linux-gnu/libKF5Crash.so.5
No symbol table info available.
#3  0x00007fe364cad4fb in KCrash::defaultCrashHandler(int) () from /lib/x86_64-linux-gnu/libKF5Crash.so.5
No symbol table info available.
#4  <signal handler called>
No locals.
#5  0x000055e1cccb5594 in ?? ()
No symbol table info available.
#6  0x000055e1cccd01b0 in ?? ()
No symbol table info available.
#7  0x00007fe362af39af in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#8  0x00007fe362af798e in QTimer::timeout(QTimer::QPrivateSignal) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#9  0x00007fe362ae7bf5 in QObject::event(QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#10 0x00007fe36376bf92 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
No symbol table info available.
#11 0x00007fe362abae38 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#12 0x00007fe362b14201 in QTimerInfoList::activateTimers() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#13 0x00007fe362b14b34 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#14 0x00007fe36164949d in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#15 0x00007fe3616a4178 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#16 0x00007fe3616481b0 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#17 0x00007fe362b14e7a in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#18 0x00007fe362ab97cb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#19 0x00007fe362ac1c1a in QCoreApplication::exec() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#20 0x000055e1ccca3a47 in ?? ()
No symbol table info available.
#21 0x00007fe362023a90 in __libc_start_call_main (main=main@entry=0x55e1ccca2b60, argc=argc@entry=2, argv=argv@entry=0x7ffc517b4758) at ../sysdeps/nptl/libc_start_call_main.h:58
        self = <optimized out>
        result = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140721675519832, 6126046093259532022, 0, 140721675519856, 94428292395256, 140614630350848, -6125822929155168522, -6142115552448256266}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x7ffc517b4758, 0x7ffc517b4758}, data = {prev = 0x0, cleanup = 0x0, canceltype = 1367033688}}}
        not_first_call = <optimized out>
#22 0x00007fe362023b49 in __libc_start_main_impl (main=0x55e1ccca2b60, argc=2, argv=0x7ffc517b4758, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffc517b4748) at ../csu/libc-start.c:360
No locals.
#23 0x000055e1ccca3b65 in ?? ()
No symbol table info available.
--- source code stack trace ---
#0  __GI___pthread_sigmask (how=1, newmask=<optimized out>, oldmask=0x0) at ./nptl/pthread_sigmask.c:43
  [Error: pthread_sigmask.c was not found in source tree]
#1  0x00007fe36203c6ad in __GI___sigprocmask (how=<optimized out>, set=<optimized out>, oset=<optimized out>) at ../sysdeps/unix/sysv/linux/sigprocmask.c:25
  [Error: sigprocmask.c was not found in source tree]
#2  0x00007fe364caafcf in KCrash::setCrashHandler(void (*)(int)) () from /lib/x86_64-linux-gnu/libKF5Crash.so.5
#3  0x00007fe364cad4fb in KCrash::defaultCrashHandler(int) () from /lib/x86_64-linux-gnu/libKF5Crash.so.5
#4  <signal handler called>
#5  0x000055e1cccb5594 in ?? ()
#6  0x000055e1cccd01b0 in ?? ()
#7  0x00007fe362af39af in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007fe362af798e in QTimer::timeout(QTimer::QPrivateSignal) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#9  0x00007fe362ae7bf5 in QObject::event(QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#10 0x00007fe36376bf92 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#11 0x00007fe362abae38 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#12 0x00007fe362b14201 in QTimerInfoList::activateTimers() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#13 0x00007fe362b14b34 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#14 0x00007fe36164949d in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#15 0x00007fe3616a4178 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#16 0x00007fe3616481b0 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#17 0x00007fe362b14e7a in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#18 0x00007fe362ab97cb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#19 0x00007fe362ac1c1a in QCoreApplication::exec() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#20 0x000055e1ccca3a47 in ?? ()
#21 0x00007fe362023a90 in __libc_start_call_main (main=main@entry=0x55e1ccca2b60, argc=argc@entry=2, argv=argv@entry=0x7ffc517b4758) at ../sysdeps/nptl/libc_start_call_main.h:58
  [Error: libc_start_call_main.h was not found in source tree]
#22 0x00007fe362023b49 in __libc_start_main_impl (main=0x55e1ccca2b60, argc=2, argv=0x7ffc517b4758, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffc517b4748) at ../csu/libc-start.c:360
  [Error: libc-start.c was not found in source tree]
#23 0x000055e1ccca3b65 in ?? ()

Getting there. We’re missing a lot of debug symbols. Can you install them for plasma-desktop and plasma-workspace and do it again?

I wish this process were easier on Ubuntu.

Okay, I think I got all the debug symbols now:

(gdb) bt
#0  __GI___pthread_sigmask (how=1, newmask=<optimized out>, oldmask=0x0) at ./nptl/pthread_sigmask.c:43
#1  0x00007fe36203c6ad in __GI___sigprocmask (how=<optimized out>, set=<optimized out>, oset=<optimized out>)
    at ../sysdeps/unix/sysv/linux/sigprocmask.c:25
#2  0x00007fe364caafcf in KCrash::setCrashHandler (handler=handler@entry=0x0) at ./src/kcrash.cpp:414
#3  0x00007fe364cad4fb in KCrash::defaultCrashHandler (sig=11) at ./src/kcrash.cpp:625
#4  <signal handler called>
#5  QWeakPointer<QObject>::internalData (this=0x58) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qsharedpointer_impl.h:696
#6  QPointer<QScreen>::data (this=0x58) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qpointer.h:77
#7  QPointer<QScreen>::operator QScreen* (this=0x58) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qpointer.h:83
#8  DesktopView::screenToFollow (this=0x0) at /usr/src/plasma-workspace-4:5.27.4.1-0ubuntu1/shell/desktopview.cpp:124
#9  0x000055e1cccd01b0 in ShellCorona::screenInvariants (this=0x55e1ce3e9610)
    at /usr/src/plasma-workspace-4:5.27.4.1-0ubuntu1/shell/shellcorona.cpp:828
#10 0x00007fe362af39af in QtPrivate::QSlotObjectBase::call (a=0x7ffc517b40f0, r=0x55e1ce3e9610, this=0x55e1ce69da80)
    at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#11 doActivate<false> (sender=0x55e1ce3e9738, signal_index=3, argv=0x7ffc517b40f0) at kernel/qobject.cpp:3923
#12 0x00007fe362aeca47 in QMetaObject::activate (sender=<optimized out>, m=m@entry=0x7fe362d5a2e0 <QTimer::staticMetaObject>, 
    local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7ffc517b40f0) at kernel/qobject.cpp:3983
#13 0x00007fe362af798e in QTimer::timeout (this=<optimized out>, _t1=...) at .moc/moc_qtimer.cpp:205
#14 0x00007fe362ae7bf5 in QObject::event (this=0x55e1ce3e9738, e=0x7ffc517b4240) at kernel/qobject.cpp:1369
#15 0x00007fe36376bf92 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x55e1ce3e9738, e=0x7ffc517b4240)
    at kernel/qapplication.cpp:3640
#16 0x00007fe362abae38 in QCoreApplication::notifyInternal2 (receiver=0x55e1ce3e9738, event=0x7ffc517b4240)
    at kernel/qcoreapplication.cpp:1064
#17 0x00007fe362abb012 in QCoreApplication::sendEvent (receiver=<optimized out>, event=<optimized out>)
    at kernel/qcoreapplication.cpp:1462
#18 0x00007fe362b14201 in QTimerInfoList::activateTimers (this=0x55e1ce3bb7f0) at kernel/qtimerinfo_unix.cpp:643
#19 0x00007fe362b14b34 in timerSourceDispatch (source=<optimized out>) at kernel/qeventdispatcher_glib.cpp:183
#20 idleTimerSourceDispatch (source=<optimized out>) at kernel/qeventdispatcher_glib.cpp:230
#21 0x00007fe36164949d in g_main_dispatch (context=0x7fe358000ee0) at ../../../glib/gmain.c:3460
#22 g_main_context_dispatch (context=0x7fe358000ee0) at ../../../glib/gmain.c:4200
#23 0x00007fe3616a4178 in g_main_context_iterate.constprop.0 (context=0x7fe358000ee0, block=<optimized out>, dispatch=1, 
    self=<optimized out>) at ../../../glib/gmain.c:4276
#24 0x00007fe3616481b0 in g_main_context_iteration (context=0x7fe358000ee0, may_block=1) at ../../../glib/gmain.c:4343
#25 0x00007fe362b14e7a in QEventDispatcherGlib::processEvents (this=0x55e1ce3bbaf0, flags=...)
--Type <RET> for more, q to quit, c to continue without paging--
    at kernel/qeventdispatcher_glib.cpp:423
#26 0x00007fe362ab97cb in QEventLoop::exec (this=this@entry=0x7ffc517b4480, flags=..., flags@entry=...)
    at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#27 0x00007fe362ac1c1a in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#28 0x00007fe362f35db0 in QGuiApplication::exec () at kernel/qguiapplication.cpp:1863
#29 0x00007fe36376bf09 in QApplication::exec () at kernel/qapplication.cpp:2832
#30 0x000055e1ccca3a47 in main (argc=<optimized out>, argv=<optimized out>)
    at /usr/src/plasma-workspace-4:5.27.4.1-0ubuntu1/shell/main.cpp:235
(gdb) 

Let me know, if that helps, thanks!!

Aha, this is 468430 – Plasmashell X11 crashes in DesktopView::screenToFollow() when adding or removing a screen from a multimonitor setup, which is fixed in Plasma 5.27.5. But using Kubuntu, you don’t have that yet.

2 Likes

I just updated to Kubuntu 23.10, which includes Plasma 5.27.8.
However, the problem still persists, as described initially. And it has to be related to some machine-specific issue as it only happens with this one.

When the screen timeout is reached (as configured) the laptop and external monitor turn off. Shortly after that the plasmashell crashes and both displays turn on again. At this point you just notice plasmashell being restarted and the panel reappearing.

What can I do? Maybe the panel (incl. any widgets) itself might be the cause?

The same happens to me in Arch Linux. Flashing the screen until a message of ‘crashing’ from the plasma shell appears. In fact, it also crashes when I connect the screen turned on to the laptop as opposite as in windows. I mean, I have to connect the HDMI, and then turn on the screen, which is natural, but just to say something… Also, if I manually close the lid of the laptop, and then I open it again (leaving the HDMI plugged) the system crashes too.

The exact same thing also happens to me on Kubuntu 23.10 with Plasma 5.27.10