Bug 420160 - Plasma crashes when monitor goes into standby
Summary: Plasma crashes when monitor goes into standby
Status: RESOLVED DUPLICATE of bug 438839
Alias: None
Product: plasmashell
Classification: Plasma
Component: generic-crash (show other bugs)
Version: 5.20.0
Platform: Other Linux
: NOR crash
Target Milestone: 1.0
Assignee: Mircea Kitsune
URL:
Keywords: wayland
Depends on:
Blocks:
 
Reported: 2020-04-16 14:19 UTC by Mircea Kitsune
Modified: 2021-10-04 14:25 UTC (History)
43 users (show)

See Also:
Latest Commit:
Version Fixed In:
tpgxyz: Wayland+


Attachments
kwin_wayland --exit-with-session konsole (1.77 KB, text/plain)
2020-10-05 15:38 UTC, Mircea Kitsune
Details
valgrind log (1.20 MB, text/plain)
2021-09-13 03:03 UTC, Tony
Details
Plasma after turning off and on the monitor (3.82 MB, image/png)
2021-09-13 03:08 UTC, Tony
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mircea Kitsune 2020-04-16 14:19:11 UTC
The Wayland Plasma session crashes to the login manager when the screen is set to power off. The monitor will first go into standby once the mouse hasn't been moved for the given amount of minutes, but will immediately wake up afterward. When it does I can briefly see the console, followed by the login screen from which I need to log in again. This prevents being able to power off my screen and preserve its lifetime as well as electricity consumption.

I discussed this on the openSUSE forum and someone pointed me to a bug from Redhat which indicates Wayland crashes when no monitors are present. As mine is connected over a DisplayPort cable which (alongside HDMI) no longer seems to support classic standby mode, the display will become entirely disconnected; In X11 it worked but when the screen came back online, the system detected a new HDMI audio device as if it was just plugged in. Here's the bug mentioned, unfortunately it seems to be unmaintained with no activity:

https://bugzilla.redhat.com/show_bug.cgi?id=1705121

Indeed this seems to be my issue too; I enabled my secondary display (a cheap VR headset) then turned monitor standby back on. While the screens still didn't stay in standby and apparently switched order, I didn't experience a session crash this time.

I reported this to the Wayland but tracker first. Its developers stated it's not a protocol issue and I should report this with KDE so I moved it here. I'm assuming Powerdevil is the component responsible for managing display devices under WL... if that's incorrect please set it to the proper product.
Comment 1 Greg Martyn 2020-08-23 20:04:36 UTC
Same thing happens here with Plasma 5.18.5
Comment 2 Mircea Kitsune 2020-09-16 14:49:09 UTC
Still getting this under the latest openSUSE Tumbleweed snapshot (20200914): libQt5Core5 5.15.1 / plasma-framework 5.73.0 / plasma5-workspace 5.19.5.

This is presently the only reason why I'm unable to use Plasma Wayland and am forced to stay on the older Plasma X11. Any chance we could please find the reason behind this issue soon, and provide any quick fix to avoid the session crash and allow the monitor to stay in standby over DisplayPort?
Comment 3 David Edmundson 2020-09-16 15:37:07 UTC
Ultimately if the session crashes, we need a backtrace.
Comment 4 Mircea Kitsune 2020-09-16 15:55:00 UTC
(In reply to David Edmundson from comment #3)
> Ultimately if the session crashes, we need a backtrace.

It might be difficult to get one in this case. Someone once gave me a command to run a mini-session in a window from within my normal session, which I remember using to backtrace another session crash that occurred under Wayland in the past.

In this case however the crash is triggered by the monitor turning off: I can't put the monitor in standby for a specific session, it's either powered on or off. However if I was to run a WL session from under an X11 session where I don't have this problem, I could hopefully trigger the issue only in the test session?

What was the command to open a login in a new window from within your original session? Also how do I use GDB to capture crashes of that session?
Comment 5 David Edmundson 2020-10-05 11:33:32 UTC
Also how do I use GDB to capture crashes of that session?

This guide is good: https://www.proli.net/2020/04/03/developing-kwin-wayland/
Comment 6 David Edmundson 2020-10-05 11:34:36 UTC
If kwin is crashing, then it's a kwin bug. Moving there.
Comment 7 Mircea Kitsune 2020-10-05 15:38:41 UTC
Created attachment 132132 [details]
kwin_wayland --exit-with-session konsole

I followed that tutorial but was unable to successfully run the debug session. Running "kwin_wayland" from a console caused a new session window to appear briefly, then my original session (X11) crashed to the login screen and I had to reboot. Running it from a different runlevel (Control + Alt + F1) resulted in a black screen in that run level. I was able to run "kwin_wayland --exit-with-session konsole" which also resulted in a black window but didn't crash... I attached the console output of that in case it explains what's not working.
Comment 8 Mircea Kitsune 2020-10-05 15:51:22 UTC
Clarification: I get the exact same behavior when using "startplasma-wayland", I only see a splash screen briefly then any session I have active crashes.
Comment 9 Vlad Zahorodnii 2020-10-08 06:50:38 UTC
You could also ssh from another computer and attach gdb or lldb to the running instance of kwin_wayland.

    gdb --pid `pidof kwin_wayland` 2>&1 | tee kwin.gdb

from https://community.kde.org/KWin/Debugging
Comment 10 Rainer Finke 2020-10-15 15:15:10 UTC
I've seen as well several crashes of Kwin. Mostly when my system goes to standby, my monitor is turning itself to sleep then after 20min. When my system wakes up, I get a black screen with a cursor. I will try to get a backtrace.

Operating System: Arch Linux
KDE Plasma Version: 5.20.0
KDE Frameworks Version: 5.75.0
Qt Version: 5.15.1
Kernel Version: 5.9.0-arch1-1
OS Type: 64-bit
Processors: 24 × AMD Ryzen 9 3900X 12-Core Processor
Memory: 31.4 GiB of RAM
Graphics Processor: AMD Radeon VII
Comment 11 Mircea Kitsune 2020-10-16 15:40:45 UTC
Still an issue in Plasma 5.20.0 / Framework 5.75.0. Only difference now is that the session as a whole no longer crashes when the monitor enters standby: Some other system process(es) do(es) causing the monitor to immediately come out of standby once more. As it does I'm met with a mangled desktop I need to reboot out of, with desktop effects no longer working among other visual glitches.
Comment 12 Martin Insulander 2020-11-27 10:57:51 UTC
This sounds very similar to what I experience. The computer is brand-new, so I have not yet figured out any details. Sometimes Konqi crashes ~20 times, sometimes other applications and sometimes the session goes down. It may depend on if I have an external monitor connected or if I put it to sleep manually. i will keep close look at it.

I saw that Rainer also is running AMD if that could be a common denominator.

Operating System: Debian Testing (KDE from Preining)
KDE Plasma Version: 5.20.3
KDE Frameworks Version: 5.76.0
Qt Version: 5.15.1
Kernel Version: 5.9.0-3-amd64
OS Type: 64-bit
Processors: 8 × AMD Ryzen 7 3700U
Memory: 13,7 GiB of RAM
Graphics Processor: AMD Radeon Vega 10
Comment 13 Tavian Barnes 2020-11-28 15:27:12 UTC
Here's a stack trace without debug symbols.  I'm rebuilding with debug info now.

#0  0x00007f73c69cb615 in raise () at /usr/lib/libc.so.6
#1  0x00007f73c69b4912 in abort () at /usr/lib/libc.so.6
#2  0x00007f73c69b4747 in _nl_load_domain.cold () at /usr/lib/libc.so.6
#3  0x00007f73c69c3bf6 in  () at /usr/lib/libc.so.6
#4  0x00007f73c6df4ea8 in  () at /usr/lib/libepoxy.so.0
#5  0x00007f73c6daa1aa in  () at /usr/lib/libepoxy.so.0
#6  0x00007f73bf7528f9 in  () at /usr/lib/qt/plugins/org.kde.kwin.scenes/KWinSceneOpenGL.so
#7  0x00007f73bf752949 in  () at /usr/lib/qt/plugins/org.kde.kwin.scenes/KWinSceneOpenGL.so
#8  0x00007f73bf755134 in  () at /usr/lib/qt/plugins/org.kde.kwin.scenes/KWinSceneOpenGL.so
#9  0x00007f73c717bdd6 in  () at /usr/lib/libQt5Core.so.5
#10 0x00007f73c717bdd6 in  () at /usr/lib/libQt5Core.so.5
#11 0x00007f73bffb8d89 in KWin::DrmBackend::updateOutputs() ()
    at /usr/lib/qt/plugins/org.kde.kwin.waylandbackends/KWinWaylandDrmBackend.so
#12 0x00007f73bffb9e51 in  ()
    at /usr/lib/qt/plugins/org.kde.kwin.waylandbackends/KWinWaylandDrmBackend.so
#13 0x00007f73c717bdd6 in  () at /usr/lib/libQt5Core.so.5
#14 0x00007f73c717f340 in QSocketNotifier::activated(QSocketDescriptor, QSocketNotifier::Type, QSocketNotifier::QPrivateSignal) () at /usr/lib/libQt5Core.so.5
#15 0x00007f73c717fb4d in QSocketNotifier::event(QEvent*) () at /usr/lib/libQt5Core.so.5
#16 0x00007f73c7c0e752 in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
    at /usr/lib/libQt5Widgets.so.5
#17 0x00007f73c7144a7a in QCoreApplication::notifyInternal2(QObject*, QEvent*) ()
    at /usr/lib/libQt5Core.so.5
#18 0x00007f73c719a9d4 in QEventDispatcherUNIXPrivate::activateSocketNotifiers() ()
    at /usr/lib/libQt5Core.so.5
#19 0x00007f73c719ae55 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
    at /usr/lib/libQt5Core.so.5
#20 0x00007f73c138993e in  () at /usr/lib/qt/plugins/platforms/KWinQpaPlugin.so
#21 0x00007f73c71433fc in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
    at /usr/lib/libQt5Core.so.5
#22 0x00007f73c714b894 in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
#23 0x000055941086b84e in  ()
#24 0x00007f73c69b6152 in __libc_start_main () at /usr/lib/libc.so.6
#25 0x000055941086c0de in _start ()
Comment 14 Mircea Kitsune 2020-11-28 16:36:10 UTC
(In reply to Tavian Barnes from comment #13)

Thanks for the helpful information, hopefully it can aid in solving this sooner! As my system is for desktop use I can't easily experiment with debugging the session or installing debug compiled versions of KDE components.
Comment 15 Tavian Barnes 2020-11-28 17:19:55 UTC
I haven't reproduced it yet with debug symbols, but I did some additional debugging on the core dump from the last crash.  It looks like the crash is this assertion failure in libepoxy: "Couldn't find current GLX or EGL context."

https://github.com/anholt/libepoxy/blob/1.5.4/src/dispatch_common.c#L863

The proc being looked up is glDeleteProgram.  The only call to glDeleteProgram() I see in kwin is in ~GLShader():

https://github.com/KDE/kwin/blob/v5.20.3/libkwineffects/kwinglutils.cpp#L159

I'm guessing the screen/display is disappearing when it turns off/sleeps, and when stuff gets torn down the destructors try to touch a GL context that isn't there any more.
Comment 16 Tavian Barnes 2020-11-28 17:55:12 UTC
Reproduced it.  First I get this on the console (typed manually, hopefully no mistakes):

qt.qpa.wayland: Ignoring unexpected wl_surface.leave received for output with id: 44 screen name: "DP-1" screen model: "DP-1-DELL U2718Q/4K8X703G06LL" This is most likely a bug in the compositor.
qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
kwin_wayland: ../libepoxy/src/dispatch_common.c:863: epoxy_get_proc_address: Assertion `0 && "Couldn't find current GLX or EGL context.\n"' failed.
The Wayland connection broke. Did the Wayland compositor die?

Here's the backtrace:

#0  0x00007f7fe8856615 in raise () at /usr/lib/libc.so.6
#1  0x00007f7fe883f912 in abort () at /usr/lib/libc.so.6
#2  0x00007f7fe883f747 in _nl_load_domain.cold () at /usr/lib/libc.so.6
#3  0x00007f7fe884ebf6 in  () at /usr/lib/libc.so.6
#4  0x00007f7fe8c7fea8 in  () at /usr/lib/libepoxy.so.0
#5  0x00007f7fe8c351aa in  () at /usr/lib/libepoxy.so.0
#6  0x00007f7fe18ac8f9 in QScopedPointerDeleter<KWin::GLShader>::cleanup(KWin::GLShader*)
    (pointer=0x556c47f8e4c0) at /usr/include/qt/QtCore/qscopedpointer.h:52
        oldD = 0x556c47f8e4c0
#7  QScopedPointerDeleter<KWin::GLShader>::cleanup(KWin::GLShader*) (pointer=0x556c47f8e4c0)
    at /usr/include/qt/QtCore/qscopedpointer.h:52
        oldD = 0x556c47f8e4c0
#8  QScopedPointer<KWin::GLShader, QScopedPointerDeleter<KWin::GLShader> >::~QScopedPointer()
    (this=0x556c47fb95c8, __in_chrg=<optimized out>) at /usr/include/qt/QtCore/qscopedpointer.h:107
        oldD = 0x556c47f8e4c0
#9  KWin::LanczosFilter::~LanczosFilter() (this=0x556c47fb95a0, __in_chrg=<optimized out>)
    at /usr/src/debug/kwin-5.20.3/plugins/scenes/opengl/lanczosfilter.cpp:47
#10 0x00007f7fe18ac949 in KWin::LanczosFilter::~LanczosFilter()
    (this=0x556c47fb95a0, __in_chrg=<optimized out>)
    at /usr/src/debug/kwin-5.20.3/plugins/scenes/opengl/lanczosfilter.cpp:51
#11 0x00007f7fe18af134 in operator() (__closure=0x556c480aba10)
    at /usr/src/debug/kwin-5.20.3/plugins/scenes/opengl/scene_opengl.cpp:1070
        this = 0x556c46c2aef0
#12 QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, KWin::SceneOpenGL2::performPaintWindow(KWin::EffectWindowImpl*, int, const QRegion&, KWin::WindowPaintData&)::<lambda()> >::call
    (arg=<optimized out>, f=...) at /usr/include/qt/QtCore/qobjectdefs_impl.h:146
#13 QtPrivate::Functor<KWin::SceneOpenGL2::performPaintWindow(KWin::EffectWindowImpl*, int, const QRegion&, KWin::WindowPaintData&)::<lambda()>, 0>::call<QtPrivate::List<>, void> (arg=<optimized out>, f=...)
    at /usr/include/qt/QtCore/qobjectdefs_impl.h:256
#14 QtPrivate::QFunctorSlotObject<KWin::SceneOpenGL2::performPaintWindow(KWin::EffectWindowImpl*, int, const QRegion&, KWin::WindowPaintData&)::<lambda()>, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *)
    (which=<optimized out>, this_=0x556c480aba00, r=<optimized out>, a=<optimized out>, ret=<optimized out>) at /usr/include/qt/QtCore/qobjectdefs_impl.h:443
#15 0x00007f7fe9006dd6 in  () at /usr/lib/libQt5Core.so.5
#16 0x00007f7fe9006dd6 in  () at /usr/lib/libQt5Core.so.5
#17 0x00007f7fea92fd89 in KWin::DrmBackend::updateOutputs() (this=0x556c46b60e60)
    at /usr/src/debug/kwin-5.20.3/plugins/platforms/drm/drm_backend.cpp:520
        resources = {d = 0x556c46b97c00}
        oldConnectors = {d = 0x556c47ccab30}
        oldCrtcs = {d = 0x556c46b97770}
        connectedOutputs = {d = 0x556c48354530}
        pendingConnectors = {d = 0x556c482cbc50}
        removedOutputs = {d = 0x7f7fe90b9940 <QArrayData::shared_null>}
        it = <optimized out>
#18 0x00007f7fea930e51 in operator() (__closure=0x556c46c2cea0)
    at /usr/src/debug/kwin-5.20.3/plugins/platforms/drm/drm_backend.cpp:349
        device = std::unique_ptr<KWin::UdevDevice> = {get() = 0x556c46c1dd40}
        this = 0x556c46b60e60
#19 QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, KWin::DrmBackend::openDrm()::<lambda()> >::call (arg=<optimized out>, f=...) at /usr/include/qt/QtCore/qobjectdefs_impl.h:146
#20 QtPrivate::Functor<KWin::DrmBackend::openDrm()::<lambda()>, 0>::call<QtPrivate::List<>, void>
    (arg=<optimized out>, f=...) at /usr/include/qt/QtCore/qobjectdefs_impl.h:256
#21 QtPrivate::QFunctorSlotObject<KWin::DrmBackend::openDrm()::<lambda()>, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *)
    (which=<optimized out>, this_=0x556c46c2ce90, r=<optimized out>, a=<optimized out>, ret=<optimized out>) at /usr/include/qt/QtCore/qobjectdefs_impl.h:443
#22 0x00007f7fe9006dd6 in  () at /usr/lib/libQt5Core.so.5
#23 0x00007f7fe900a340 in QSocketNotifier::activated(QSocketDescriptor, QSocketNotifier::Type, QSocketNotifier::QPrivateSignal) () at /usr/lib/libQt5Core.so.5
#24 0x00007f7fe900ab4d in QSocketNotifier::event(QEvent*) () at /usr/lib/libQt5Core.so.5
#25 0x00007f7fe9a99752 in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
    at /usr/lib/libQt5Widgets.so.5
#26 0x00007f7fe8fcfa7a in QCoreApplication::notifyInternal2(QObject*, QEvent*) ()
    at /usr/lib/libQt5Core.so.5
#27 0x00007f7fe90259d4 in QEventDispatcherUNIXPrivate::activateSocketNotifiers() ()
    at /usr/lib/libQt5Core.so.5
#28 0x00007f7fe9025e55 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
    at /usr/lib/libQt5Core.so.5
#29 0x00007f7fe321493e in QUnixEventDispatcherQPA::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
    () at /usr/lib/qt/plugins/platforms/KWinQpaPlugin.so
#30 0x00007f7fe8fce3fc in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
    at /usr/lib/libQt5Core.so.5
#31 0x00007f7fe8fd6894 in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
#32 0x0000556c45fd984e in main(int, char**) (argc=<optimized out>, argv=<optimized out>)
    at /usr/src/debug/kwin-5.20.3/main_wayland.cpp:702
        userSignals = 
            {__val = {2560, 72058698113548182, 72058702408515479, 72058706703482776, 72058710998450073, 72058715293417370, 72058719588384667, 93923519090912, 93923519279112, 93923519090912, 93923519279112, 140187338641894, 1, 2, 4, 140729996154856}}
        environment = {d = {d = 0x556c46b41ff0}}
        a = 
          {<KWin::ApplicationWaylandAbstract> = {<KWin::Application> = {<QApplication> = {<No data fields>}, static staticMetaObject = {d = {superdata = {direct = 0x7f7fe9fa3900 <QApplication::staticMetaObject>}, stringdata = 0x7f7fea857800 <qt_meta_stringdata_KWin__Application>, data = 0x7f7fea8576a0 <qt_meta_data_KWin__Application>, static_metacall = 0x7f7fea69bdc0 <KWin::Application::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>, relatedMetaObjects = 0x0, extradata = 0x0}}, static crashes = 0, m_eventFilter = {d = 0x556c46b529e0}, m_configLock = false, m_config = {d = 0x556c46b55900}, m_kxkbConfig = {d = 0x556c46b7db40}, m_operationMode = KWin::Application::OperationModeWaylandOnly, m_x11Time = 0, m_rootWindow = 0, m_connection = 0x0, m_defaultScreen = 0x0, m_useKActivities = false, m_platform = 0x556c46b60e60, m_terminating = false, m_isClosingX11Connection = false}, static staticMetaObject = {d = {superdata = {direct = 0x7f7fea9021c0 <KWin::Application::staticMetaObject>}, stringdata = 0x7f7fea857660 <qt_meta_stringdata_KWin__ApplicationWaylandAbstract>, data = 0x7f7fea857620 <qt_meta_data_KWin__ApplicationWaylandAbstract>, static_metacall = 0x7f7fea68dfd0 <KWin::ApplicationWaylandAbstract::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>, relatedMetaObjects = 0x0, extradata = 0x0}}}, static staticMetaObject = {d = {superdata = {direct = 0x7f7fea902180 <KWin::ApplicationWaylandAbstract::staticMetaObject>}, stringdata = 0x556c45ffc820 <qt_meta_stringdata_KWin__ApplicationWayland>, data = 0x556c45ffc7e0 <qt_meta_data_KWin__ApplicationWayland>, static_metacall = 0x556c45fda1b0 <KWin::ApplicationWayland::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>, relatedMetaObjects = 0x0, extradata = 0x0}}, m_startXWayland = false, m_applicationsToStart = {<QList<QString>> = {<QListSpecialMethods<QString>> = {<No data fields>}, {p = {static shared_null = {ref = {atomic = {_q_value = {<std::__atomic_base<int>> = {static _S_alignment = 4, _M_i = -1}, <No data fields>}}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d = 0x7f7fe90ba450 <QListData::shared_null>}, d = 0x7f7fe90ba450 <QListData::shared_null>}}, <No data fields>}, m_inputMethodServerToStart = {static null = {<No data fields>}, d = 0x7f7fe90b9940 <QArrayData::shared_null>}, m_environment = {d = {d = 0x556c46b41ff0}}, m_sessionArgument = {static null = {<No data fields>}, d = 0x556c46b57cd0}, m_xwayland = 0x0}
        availablePlugins = {d = 0x556c46b600f0}
        hasPlugin = {__availablePlugins = @0x7ffe416e1498}
        hasSizeOption = <optimized out>
        hasOutputCountOption = <optimized out>
        hasX11Option = <optimized out>
        hasVirtualOption = <optimized out>
        hasWaylandOption = <optimized out>
        hasFramebufferOption = <optimized out>
        hasDrmOption = <optimized out>
        xwaylandOption = {d = {d = 0x556c46b61b90}}
        waylandSocketOption = {d = {d = 0x556c46b52f10}}
        framebufferOption = {d = {d = 0x556c46b60320}}
        framebufferDeviceOption = {d = {d = 0x556c46b52b90}}
        x11DisplayOption = {d = {d = 0x556c46b55920}}
        waylandDisplayOption = {d = {d = 0x556c46b55e90}}
        virtualFbOption = {d = {d = 0x556c46b602e0}}
        widthOption = {d = {d = 0x556c46b55d30}}
        heightOption = {d = {d = 0x556c46b53050}}
        scaleOption = {d = {d = 0x556c46b53090}}
        outputCountOption = {d = {d = 0x556c46b6ff30}}
        parser = {d = 0x556c46b55a80}
        libinputOption = {d = {d = 0x556c46b57940}}
        drmOption = {d = {d = 0x556c46b57980}}
        inputMethodOption = {d = {d = 0x556c46b579c0}}
        listBackendsOption = {d = {d = 0x556c46b57a00}}
        screenLockerOption = {d = {d = 0x556c46b57a40}}
        noScreenLockerOption = {d = {d = 0x556c46b57a80}}
        noGlobalShortcutsOption = {d = {d = 0x556c46b57b20}}
        exitWithSessionOption = {d = {d = 0x556c46b57bd0}}
        pluginName = 
          {static null = {<No data fields>}, d = 0x556c45ffdc20 <KWin::s_drmPlugin::{lambda()#1}::operator()() const::qstring_literal>}
        initialWindowSize = {wd = 1024, ht = 768}
        deviceIdentifier = {d = 0x7f7fe90b9940 <QArrayData::shared_null>}
        outputCount = 1
        outputScale = 1
        pluginIt = <optimized out>
        server = 0x556c46b4ede0
        flags = {i = <optimized out>}
Comment 17 Patrick Lang 2020-12-08 06:26:15 UTC
I believe I'm hitting the same issue too on Fedora rawhide (34) with KDE Plasma. When I switch my KVM, which disconnects the monitor, it crashes.

When I switch off the machine, I get a sequence like this showing USB & DP disconnection

```
Dec 07 22:06:50 xubuntu-itx-amd64 polkit-kde-authentication-agent-1[1525]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Dec 07 22:06:50 xubuntu-itx-amd64 kded5[1506]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Dec 07 22:06:50 xubuntu-itx-amd64 klauncher[1497]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Dec 07 22:06:50 xubuntu-itx-amd64 kwalletd5[1382]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Dec 07 22:06:50 xubuntu-itx-amd64 org_kde_powerdevil[1588]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Dec 07 22:06:50 xubuntu-itx-amd64 kdeconnectd[1548]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Dec 07 22:06:50 xubuntu-itx-amd64 DiscoverNotifier[1540]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Dec 07 22:06:50 xubuntu-itx-amd64 dolphin[1574]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Dec 07 22:06:50 xubuntu-itx-amd64 kactivitymanagerd[1567]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Dec 07 22:06:50 xubuntu-itx-amd64 baloorunner[2403]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Dec 07 22:06:50 xubuntu-itx-amd64 konsole[2412]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Dec 07 22:06:50 xubuntu-itx-amd64 plasmashell[1527]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Dec 07 22:06:50 xubuntu-itx-amd64 plasmashell[1527]: trying to show an empty dialog
Dec 07 22:06:50 xubuntu-itx-amd64 plasmashell[1527]: file:///usr/share/plasma/shells/org.kde.plasma.desktop/contents/views/Desktop.qml:146:19: QML Loader: Binding loop detected for property "height"
Dec 07 22:06:50 xubuntu-itx-amd64 plasmashell[1527]: file:///usr/share/plasma/shells/org.kde.plasma.desktop/contents/views/Desktop.qml:146:19: QML Loader: Binding loop detected for property "height"
Dec 07 22:06:50 xubuntu-itx-amd64 plasmashell[1527]: qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
Dec 07 22:06:50 xubuntu-itx-amd64 plasmashell[1527]: qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
Dec 07 22:06:50 xubuntu-itx-amd64 plasmashell[1527]: trying to show an empty dialog
Dec 07 22:06:50 xubuntu-itx-amd64 plasmashell[1527]: Old primary output: QScreen(0x559ffceaaee0, name="DP-1") New primary output: QScreen(0x559ffe2eb5c0, name="")
Dec 07 22:06:50 xubuntu-itx-amd64 plasmashell[1527]: qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
Dec 07 22:06:50 xubuntu-itx-amd64 plasmashell[1527]: trying to show an empty dialog
Dec 07 22:06:50 xubuntu-itx-amd64 plasmashell[1527]: file:///usr/share/plasma/shells/org.kde.plasma.desktop/contents/views/Desktop.qml:146:19: QML Loader: Binding loop detected for property "height"
Dec 07 22:06:50 xubuntu-itx-amd64 plasmashell[1527]: file:///usr/share/plasma/shells/org.kde.plasma.desktop/contents/views/Desktop.qml:146:19: QML Loader: Binding loop detected for property "height"
Dec 07 22:06:50 xubuntu-itx-amd64 plasmashell[1527]: qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
Dec 07 22:06:50 xubuntu-itx-amd64 plasmashell[1527]: qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
Dec 07 22:06:50 xubuntu-itx-amd64 plasmashell[1527]: qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
Dec 07 22:06:50 xubuntu-itx-amd64 plasmashell[1527]: trying to show an empty dialog
Dec 07 22:06:50 xubuntu-itx-amd64 plasmashell[1527]: The Wayland connection experienced a fatal error: Protocol error
Dec 07 22:06:50 xubuntu-itx-amd64 kernel: usb 4-4.4: USB disconnect, device number 4
Dec 07 22:06:50 xubuntu-itx-amd64 kernel: usb 4-4.4.1: USB disconnect, device number 5
Dec 07 22:06:51 xubuntu-itx-amd64 kded5[1506]: kscreen.kded: Config does not have at least one screen enabled, WILL NOT save this config, this is not what user wants.
Dec 07 22:06:51 xubuntu-itx-amd64 pcscd[2187]: 40310639 ccid_usb.c:857:WriteUSB() write failed (3/14): -1 LIBUSB_ERROR_IO
Dec 07 22:06:51 xubuntu-itx-amd64 pcscd[2187]: 00000088 ifdwrapper.c:364:IFDStatusICC() Card not transacted: 612
Dec 07 22:06:51 xubuntu-itx-amd64 pcscd[2187]: 00000014 eventhandler.c:336:EHStatusHandlerThread() Error communicating to: Yubico YubiKey OTP+FIDO+CCID 00 00
Dec 07 22:06:51 xubuntu-itx-amd64 kernel: usb 3-4.4.1: clear tt 1 (1112) error -71
Dec 07 22:06:51 xubuntu-itx-amd64 kernel: usb 3-4.4: USB disconnect, device number 5
Dec 07 22:06:51 xubuntu-itx-amd64 kernel: usb 3-4.4.1: USB disconnect, device number 8
Dec 07 22:06:51 xubuntu-itx-amd64 kernel: usb 3-4.4.1.2: USB disconnect, device number 11
Dec 07 22:06:51 xubuntu-itx-amd64 kernel: usb 3-4.4.1.3: USB disconnect, device number 13
Dec 07 22:06:51 xubuntu-itx-amd64 kernel: usb 3-4.4.1.4: USB disconnect, device number 14
Dec 07 22:06:51 xubuntu-itx-amd64 kernel: usb 3-4.4.2: USB disconnect, device number 10
Dec 07 22:06:51 xubuntu-itx-amd64 kernel: usb 3-4.4.4: USB disconnect, device number 12
Dec 07 22:06:51 xubuntu-itx-amd64 pcscd[2187]: 00412291 ccid_usb.c:857:WriteUSB() write failed (3/14): -4 LIBUSB_ERROR_NO_DEVICE
Dec 07 22:06:52 xubuntu-itx-amd64 plasmashell[2546]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Dec 07 22:06:52 xubuntu-itx-amd64 drkonqi[2548]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
```

After I reconnect, a bunch of crashes:

```
Dec 07 22:07:23 xubuntu-itx-amd64 systemd-coredump[2589]: Core file was truncated to 2147483648 bytes.
Dec 07 22:07:23 xubuntu-itx-amd64 abrt-dump-journal-core[1060]: Failed to obtain all required information from journald
Dec 07 22:07:26 xubuntu-itx-amd64 systemd-coredump[2589]: Process 1437 (kwin_wayland) of user 1000 dumped core.
                                                          
                                                          Stack trace of thread 1437:
                                                          #0  0x00007fb43885c365 n/a (n/a + 0x0)
Dec 07 22:07:26 xubuntu-itx-amd64 systemd[1]: systemd-coredump@0-2588-0.service: Succeeded.
Dec 07 22:07:26 xubuntu-itx-amd64 audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-coredump@0-2588-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Dec 07 22:07:26 xubuntu-itx-amd64 baloorunner[2403]: KCrash: Application 'baloorunner' crashing...
Dec 07 22:07:26 xubuntu-itx-amd64 baloorunner[2403]: KCrash: Attempting to start /usr/libexec/drkonqi
Dec 07 22:07:26 xubuntu-itx-amd64 systemd[1]: systemd-coredump@0-2588-0.service: Consumed 11.790s CPU time.
Dec 07 22:07:26 xubuntu-itx-amd64 konsole[2412]: The Wayland connection broke. Did the Wayland compositor die?
Dec 07 22:07:26 xubuntu-itx-amd64 baloorunner[2403]: The Wayland connection broke. Did the Wayland compositor die?
Dec 07 22:07:26 xubuntu-itx-amd64 audit: BPF prog-id=48 op=UNLOAD
Dec 07 22:07:26 xubuntu-itx-amd64 audit: BPF prog-id=47 op=UNLOAD
Dec 07 22:07:26 xubuntu-itx-amd64 audit: BPF prog-id=46 op=UNLOAD
Dec 07 22:07:26 xubuntu-itx-amd64 audit[1382]: ANOM_ABEND auid=1000 uid=1000 gid=1000 ses=2 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 pid=1382 comm="kwalletd5" exe="/usr/bin/kwalletd5" sig=6 res=1
Dec 07 22:07:26 xubuntu-itx-amd64 kactivitymanagerd[1567]: KCrash: Application 'kactivitymanagerd' crashing...
Dec 07 22:07:26 xubuntu-itx-amd64 kactivitymanagerd[1567]: KCrash: Attempting to start /usr/libexec/drkonqi
Dec 07 22:07:26 xubuntu-itx-amd64 dolphin[1574]: The Wayland connection broke. Did the Wayland compositor die?
Dec 07 22:07:26 xubuntu-itx-amd64 org_kde_powerdevil[1588]: The Wayland connection broke. Did the Wayland compositor die?
Dec 07 22:07:26 xubuntu-itx-amd64 kactivitymanagerd[1567]: The Wayland connection broke. Did the Wayland compositor die?
Dec 07 22:07:26 xubuntu-itx-amd64 DiscoverNotifier[1540]: The Wayland connection broke. Did the Wayland compositor die?
Dec 07 22:07:26 xubuntu-itx-amd64 plasmashell[2546]: The Wayland connection broke. Did the Wayland compositor die?
Dec 07 22:07:26 xubuntu-itx-amd64 kwalletd5[1382]: The Wayland connection broke. Did the Wayland compositor die?
Dec 07 22:07:26 xubuntu-itx-amd64 kdeconnectd[1548]: The Wayland connection broke. Did the Wayland compositor die?
Dec 07 22:07:26 xubuntu-itx-amd64 kded5[1506]: The Wayland connection broke. Did the Wayland compositor die?
Dec 07 22:07:26 xubuntu-itx-amd64 klauncher[1497]: The Wayland connection broke. Did the Wayland compositor die?
Dec 07 22:07:26 xubuntu-itx-amd64 polkit-kde-authentication-agent-1[1525]: The Wayland connection broke. Did the Wayland compositor die?
Dec 07 22:07:26 xubuntu-itx-amd64 drkonqi[2548]: The Wayland connection broke. Did the Wayland compositor die?
```
Comment 18 Patrick Lang 2020-12-08 06:27:22 UTC
(In reply to Patrick Lang from comment #17)

Operating System: Fedora 34
KDE Frameworks Version: 5.76.0
Qt Version: 5.15.2
Kernel Version: 5.10.0-0.rc6.20201202git509a15421674.91.fc34.x86_64
OS Type: 64-bit
Processors: 4 × Intel® Core™ i5-4590T CPU @ 2.00GHz
Memory: 15.5 GiB of RAM
Graphics Processor: Mesa DRI Intel® HD Graphics 4600
Comment 19 Patrick Lang 2021-01-13 07:45:31 UTC
I tried this again, still happening with updated kernel & KDE Framework. Would anyone be able to look at this if I took some core dumps?

Operating System: Fedora 34
KDE Frameworks Version: 5.78.0
Qt Version: 5.15.2
Kernel Version: 5.11.0-0.rc3.122.fc34.x86_64
OS Type: 64-bit
Processors: 4 × Intel® Core™ i5-4590T CPU @ 2.00GHz
Memory: 15.5 GiB of RAM
Graphics Processor: Mesa DRI Intel® HD Graphics 4600
Comment 20 Nate Graham 2021-01-13 18:44:54 UTC
#6  QMessageLogger::fatal (this=this@entry=0x7fffd70c5ba0, msg=msg@entry=0x7ff994ac00b8 "The Wayland connection broke. Did the Wayland compositor die?") at global/qlogging.cpp:893

This means that the compositor crashed. Due to a Qt issue, when this happens, the app using it will crash too. KDE developers submitted a fix, but sadly it was not merged. See https://codereview.qt-project.org/c/qt/qtwayland/+/308984.

Until we get better handling of this in Qt, the best we can do is debug why the compositor crashed in the first place. So can you please get a backtrace of the crash in kwin_wayland and then file a new bug report with it on kwin | wayland-generic? Thanks!

You may be able to use the `coredumpctl` utility to retrieve the backtrace. See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports#Retrieving_a_backtrace_using_coredumpctl
Comment 21 Tavian Barnes 2021-01-13 20:27:52 UTC
(In reply to Nate Graham from comment #20)
> Until we get better handling of this in Qt, the best we can do is debug why
> the compositor crashed in the first place. So can you please get a backtrace
> of the crash in kwin_wayland and then file a new bug report with it on kwin
> | wayland-generic? Thanks!

I posted one already in this thread, does it help? https://bugs.kde.org/show_bug.cgi?id=420160#c16
Comment 22 Nate Graham 2021-01-13 20:49:19 UTC
Ah so there is.
Comment 23 Argy M 2021-01-26 21:05:55 UTC
I get the same issue, kwin crashing after the display shuts off due to inactivity. For whatever reason, the coredump from systemd-coredumpd gets truncated every time. I've obtained a stack trace by manually attaching gdb. Hope it's useful, stack traces are generally my nemesis.

-------------------------------------------------------

Operating System: Fedora 33
KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.78.0
Qt Version: 5.15.2
Kernel Version: 5.10.9-201.fc33.x86_64
OS Type: 64-bit
Processors: 8 × Intel® Core™ i7-4910MQ CPU @ 2.90GHz
Memory: 15.2 GiB of RAM
Graphics Processor: Mesa DRI Intel® HD Graphics 4600

-------------------------------------------------------

[Detaching after fork from child process 2363]
[Detaching after fork from child process 2491]

Thread 1 "kwin_wayland" received signal SIGABRT, Aborted.
0x00007ff9c1b749d5 in raise () from /lib64/libc.so.6

Thread 10 (Thread 0x7ff9919fb640 (LWP 1499) "kwin_wayland"):
#0  0x00007ff9c15826c2 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff9c1927cec in QTWTF::TCMalloc_PageHeap::scavengerThread() () from /lib64/libQt5Script.so.5
#2  0x00007ff9c1927d1f in QTWTF::TCMalloc_PageHeap::runScavengerThread(void*) () from /lib64/libQt5Script.so.5
#3  0x00007ff9c157c3f9 in start_thread () from /lib64/libpthread.so.0
#4  0x00007ff9c1c38903 in clone () from /lib64/libc.so.6

Thread 9 (Thread 0x7ff992ffd640 (LWP 1496) "QQmlThread"):
#0  0x00007ff9c1c2d80f in poll () from /lib64/libc.so.6
#1  0x00007ff9bfd9a6f6 in g_main_context_iterate.constprop () from /lib64/libglib-2.0.so.0
#2  0x00007ff9bfd45d43 in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#3  0x00007ff9c23196f3 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#4  0x00007ff9c22cb57b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#5  0x00007ff9c2130b67 in QThread::exec() () from /lib64/libQt5Core.so.5
#6  0x00007ff9c0e435ec in QQmlThreadPrivate::run() () from /lib64/libQt5Qml.so.5
#7  0x00007ff9c2131df0 in QThreadPrivate::start(void*) () from /lib64/libQt5Core.so.5
#8  0x00007ff9c157c3f9 in start_thread () from /lib64/libpthread.so.0
#9  0x00007ff9c1c38903 in clone () from /lib64/libc.so.6

Thread 8 (Thread 0x7ff99b8b9640 (LWP 1494) "kwin_wa:disk$3"):
#0  0x00007ff9c15826c2 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff99d86295b in util_queue_thread_func () from /usr/lib64/dri/i965_dri.so
#2  0x00007ff99d86241b in impl_thrd_routine () from /usr/lib64/dri/i965_dri.so
#3  0x00007ff9c157c3f9 in start_thread () from /lib64/libpthread.so.0
#4  0x00007ff9c1c38903 in clone () from /lib64/libc.so.6

Thread 7 (Thread 0x7ff993fff640 (LWP 1493) "kwin_wa:disk$2"):
#0  0x00007ff9c15826c2 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff99d86295b in util_queue_thread_func () from /usr/lib64/dri/i965_dri.so
#2  0x00007ff99d86241b in impl_thrd_routine () from /usr/lib64/dri/i965_dri.so
#3  0x00007ff9c157c3f9 in start_thread () from /lib64/libpthread.so.0
#4  0x00007ff9c1c38903 in clone () from /lib64/libc.so.6

Thread 6 (Thread 0x7ff99c0ba640 (LWP 1492) "kwin_wa:disk$1"):
#0  0x00007ff9c15826c2 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff99d86295b in util_queue_thread_func () from /usr/lib64/dri/i965_dri.so
#2  0x00007ff99d86241b in impl_thrd_routine () from /usr/lib64/dri/i965_dri.so
#3  0x00007ff9c157c3f9 in start_thread () from /lib64/libpthread.so.0
#4  0x00007ff9c1c38903 in clone () from /lib64/libc.so.6

Thread 5 (Thread 0x7ff99c8bb640 (LWP 1491) "kwin_wa:disk$0"):
#0  0x00007ff9c15826c2 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff99d86295b in util_queue_thread_func () from /usr/lib64/dri/i965_dri.so
#2  0x00007ff99d86241b in impl_thrd_routine () from /usr/lib64/dri/i965_dri.so
#3  0x00007ff9c157c3f9 in start_thread () from /lib64/libpthread.so.0
#4  0x00007ff9c1c38903 in clone () from /lib64/libc.so.6

Thread 4 (Thread 0x7ff9ad8d5640 (LWP 1489) "libinput-connec"):
#0  0x00007ff9c1c2d80f in poll () from /lib64/libc.so.6
#1  0x00007ff9bfd9a6f6 in g_main_context_iterate.constprop () from /lib64/libglib-2.0.so.0
#2  0x00007ff9bfd45d43 in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#3  0x00007ff9c23196f3 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#4  0x00007ff9c22cb57b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#5  0x00007ff9c2130b67 in QThread::exec() () from /lib64/libQt5Core.so.5
#6  0x00007ff9c2131df0 in QThreadPrivate::start(void*) () from /lib64/libQt5Core.so.5
#7  0x00007ff9c157c3f9 in start_thread () from /lib64/libpthread.so.0
#8  0x00007ff9c1c38903 in clone () from /lib64/libc.so.6

Thread 3 (Thread 0x7ff9ae0d6640 (LWP 1488) "QThread"):
#0  0x00007ff9c1c2d80f in poll () from /lib64/libc.so.6
#1  0x00007ff9bfd9a6f6 in g_main_context_iterate.constprop () from /lib64/libglib-2.0.so.0
#2  0x00007ff9bfd45d43 in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#3  0x00007ff9c23196f3 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#4  0x00007ff9c22cb57b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#5  0x00007ff9c2130b67 in QThread::exec() () from /lib64/libQt5Core.so.5
#6  0x00007ff9c2131df0 in QThreadPrivate::start(void*) () from /lib64/libQt5Core.so.5
#7  0x00007ff9c157c3f9 in start_thread () from /lib64/libpthread.so.0
#8  0x00007ff9c1c38903 in clone () from /lib64/libc.so.6

Thread 2 (Thread 0x7ff9ae98d640 (LWP 1487) "QDBusConnection"):
#0  0x00007ff9c1c2d80f in poll () from /lib64/libc.so.6
#1  0x00007ff9bfd9a6f6 in g_main_context_iterate.constprop () from /lib64/libglib-2.0.so.0
#2  0x00007ff9bfd45d43 in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#3  0x00007ff9c23196f3 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#4  0x00007ff9c22cb57b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#5  0x00007ff9c2130b67 in QThread::exec() () from /lib64/libQt5Core.so.5
#6  0x00007ff9c33a710b in QDBusConnectionManager::run() () from /lib64/libQt5DBus.so.5
#7  0x00007ff9c2131df0 in QThreadPrivate::start(void*) () from /lib64/libQt5Core.so.5
#8  0x00007ff9c157c3f9 in start_thread () from /lib64/libpthread.so.0
#9  0x00007ff9c1c38903 in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7ff9bc422940 (LWP 1486) "kwin_wayland"):
#0  0x00007ff9c1b749d5 in raise () from /lib64/libc.so.6
#1  0x00007ff9c1b5d8a4 in abort () from /lib64/libc.so.6
#2  0x00007ff9c1b5d789 in __assert_fail_base.cold () from /lib64/libc.so.6
#3  0x00007ff9c1b6d026 in __assert_fail () from /lib64/libc.so.6
#4  0x00007ff9c1faf20f in epoxy_get_proc_address () from /lib64/libepoxy.so.0
#5  0x00007ff9c1f5c3aa in epoxy_glDeleteProgram_global_rewrite_ptr () from /lib64/libepoxy.so.0
#6  0x00007ff9c1aee2e4 in KWin::ContrastEffect::~ContrastEffect() () from /lib64/libkwin4_effect_builtins.so.1
#7  0x00007ff9c1aee3ad in KWin::ContrastEffect::~ContrastEffect() () from /lib64/libkwin4_effect_builtins.so.1
#8  0x00007ff9c39c0dee in KWin::EffectsHandlerImpl::destroyEffect(KWin::Effect*) () from /lib64/libkwin.so.5
#9  0x00007ff9c39c1c6d in KWin::EffectsHandlerImpl::unloadEffect(QString const&) () from /lib64/libkwin.so.5
#10 0x00007ff9c39c20ae in KWin::EffectsHandlerImpl::reloadEffect(KWin::Effect*) () from /lib64/libkwin.so.5
#11 0x00007ff9c22fc386 in void doActivate<false>(QObject*, int, void**) () from /lib64/libQt5Core.so.5
#12 0x00007ff9c37851f9 in KWin::EffectsHandler::screenGeometryChanged(QSize const&) () from /lib64/libkwineffects.so.12
#13 0x00007ff9c3aa65f8 in KWin::Workspace::desktopResized() () from /lib64/libkwin.so.5
#14 0x00007ff9c22fc3c0 in void doActivate<false>(QObject*, int, void**) () from /lib64/libQt5Core.so.5
#15 0x00007ff9c22fc386 in void doActivate<false>(QObject*, int, void**) () from /lib64/libQt5Core.so.5
#16 0x00007ff9ae166778 in KWin::DrmBackend::updateOutputs (this=<optimized out>) at /usr/src/debug/kwin-5.20.5-1.fc33.x86_64/plugins/platforms/drm/drm_backend.cpp:520
#17 0x00007ff9ae16767d in operator() (__closure=0x5595c2f96790) at /usr/src/debug/kwin-5.20.5-1.fc33.x86_64/plugins/platforms/drm/drm_backend.cpp:349
#18 QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, KWin::DrmBackend::openDrm()::<lambda()> >::call (arg=<optimized out>, f=...) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:146
#19 QtPrivate::Functor<KWin::DrmBackend::openDrm()::<lambda()>, 0>::call<QtPrivate::List<>, void> (arg=<optimized out>, f=...) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:256
#20 QtPrivate::QFunctorSlotObject<KWin::DrmBackend::openDrm()::<lambda()>, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=<optimized out>, this_=0x5595c2f96780, r=<optimized out>, a=<optimized out>, ret=<optimized out>) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:443
#21 0x00007ff9c22fc386 in void doActivate<false>(QObject*, int, void**) () from /lib64/libQt5Core.so.5
#22 0x00007ff9c22ff77a in QSocketNotifier::activated(QSocketDescriptor, QSocketNotifier::Type, QSocketNotifier::QPrivateSignal) () from /lib64/libQt5Core.so.5
#23 0x00007ff9c22fff21 in QSocketNotifier::event(QEvent*) () from /lib64/libQt5Core.so.5
#24 0x00007ff9c2d61ec3 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQt5Widgets.so.5
#25 0x00007ff9c22ccbd8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt5Core.so.5
#26 0x00007ff9c2316a4e in QEventDispatcherUNIXPrivate::activateSocketNotifiers() () from /lib64/libQt5Core.so.5
#27 0x00007ff9c2316dd4 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#28 0x00007ff9aeed91a1 in QUnixEventDispatcherQPA::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt5/plugins/platforms/KWinQpaPlugin.so
#29 0x00007ff9c22cb57b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#30 0x00007ff9c22d31b4 in QCoreApplication::exec() () from /lib64/libQt5Core.so.5
#31 0x00005595c2aee55e in main (argc=<optimized out>, argv=0x7fff0130b850) at /usr/src/debug/kwin-5.20.5-1.fc33.x86_64/main_wayland.cpp:702
A debugging session is active.

	Inferior 1 [process 1486] will be detached.

Quit anyway? (y or n) [answered Y; input not from terminal]
[Inferior 1 (process 1486) detached]
Comment 24 Vlad Zahorodnii 2021-04-05 07:35:07 UTC
(In reply to Argy M from comment #23)
> Thread 1 (Thread 0x7ff9bc422940 (LWP 1486) "kwin_wayland"):
> #0  0x00007ff9c1b749d5 in raise () from /lib64/libc.so.6
> #1  0x00007ff9c1b5d8a4 in abort () from /lib64/libc.so.6
> #2  0x00007ff9c1b5d789 in __assert_fail_base.cold () from /lib64/libc.so.6
> #3  0x00007ff9c1b6d026 in __assert_fail () from /lib64/libc.so.6
> #4  0x00007ff9c1faf20f in epoxy_get_proc_address () from /lib64/libepoxy.so.0
> #5  0x00007ff9c1f5c3aa in epoxy_glDeleteProgram_global_rewrite_ptr () from
> /lib64/libepoxy.so.0
> #6  0x00007ff9c1aee2e4 in KWin::ContrastEffect::~ContrastEffect() () from
> /lib64/libkwin4_effect_builtins.so.1
> #7  0x00007ff9c1aee3ad in KWin::ContrastEffect::~ContrastEffect() () from
> /lib64/libkwin4_effect_builtins.so.1
> #8  0x00007ff9c39c0dee in
> KWin::EffectsHandlerImpl::destroyEffect(KWin::Effect*) () from
> /lib64/libkwin.so.5
> #9  0x00007ff9c39c1c6d in KWin::EffectsHandlerImpl::unloadEffect(QString
> const&) () from /lib64/libkwin.so.5
Does libepoxy print anything related to missing OpenGL context?
Comment 25 Seqularise 2021-05-05 19:45:32 UTC
I just tried to turn off my monitor and after this i successfully returned back, only plasmashell is gone
Comment 26 Seqularise 2021-05-05 20:12:30 UTC
with plasma from master, on stable its still a crash probably
Comment 27 Santiago Cézar 2021-05-06 00:28:44 UTC
> I just tried to turn off my monitor and after this i successfully returned
> back, only plasmashell is gone

I've recently tried running Plasma on Wayland again and had exactly this behaviour

> with plasma from master, on stable its still a crash probably

I've installed Plasma 5.21.4 from Fedora 34 repositories
Comment 28 Santiago Cézar 2021-05-07 13:23:11 UTC
Here is the info I got from coredumpctl for plasmashell

           PID: 53482 (plasmashell)
           UID: 1002 (santi)
           GID: 1002 (santi)
        Signal: 6 (ABRT)
     Timestamp: Thu 2021-05-06 17:16:29 -03 (7min ago)
  Command Line: plasmashell -d -n
    Executable: /usr/bin/plasmashell
 Control Group: /user.slice/user-1002.slice/user@1002.service/app.slice/app-org.kde.konsole-c7898390fcab48f4a33a7b08fc3b0fb5.scope
          Unit: user@1002.service
     User Unit: app-org.kde.konsole-c7898390fcab48f4a33a7b08fc3b0fb5.scope
         Slice: user-1002.slice
     Owner UID: 1002 (santi)
       Boot ID: a7fa3af3286c470485bf9405b9833b2a
    Machine ID: 82ad6e578fd041e19a9ca05f32db1210
      Hostname: mini
       Storage: /var/lib/systemd/coredump/core.plasmashell.1002.a7fa3af3286c470485bf9405b9833b2a.53482.1620332189000000.zst (present)
     Disk Size: 14.1M
       Message: Process 53482 (plasmashell) of user 1002 dumped core.
                
                Stack trace of thread 53482:
                #0  0x00007f54c1a2b292 raise (libc.so.6 + 0x3d292)
                #1  0x00007f54c1a148a4 abort (libc.so.6 + 0x268a4)
                #2  0x00007f54c1e8f42d _ZNK14QMessageLogger5fatalEPKcz (libQt5Core.so.5 + 0xb142d)
                #3  0x00007f54bfd9b4d4 _ZNK15QtWaylandClient15QWaylandDisplay10checkErrorEv (libQt5WaylandClient.so.5 + 0x804d4)
                #4  0x00007f54bfd9b6ea _ZN15QtWaylandClient15QWaylandDisplay13flushRequestsEv (libQt5WaylandClient.so.5 + 0x806ea)
                #5  0x00007f54bfda8ace _ZN15QtWaylandClient14QWaylandWindow10setVisibleEb.part.0 (libQt5WaylandClient.so.5 + 0x8dace)
                #6  0x00007f54c24a2aab _ZN14QWindowPrivate10setVisibleEb (libQt5Gui.so.5 + 0x172aab)
                #7  0x000055d8f59fb755 _ZN11ShellCorona20primaryOutputChangedEv (plasmashell + 0x44755)
                #8  0x00007f54c208d4b0 _Z10doActivateILb0EEvP7QObjectiPPv (libQt5Core.so.5 + 0x2af4b0)
                #9  0x00007f54c248b606 _ZN15QGuiApplication20primaryScreenChangedEP7QScreen (libQt5Gui.so.5 + 0x15b606)
                #10 0x00007f54c24bb9bf _ZN7QScreenD1Ev (libQt5Gui.so.5 + 0x18b9bf)
                #11 0x00007f54c24bbc7d _ZN7QScreenD0Ev (libQt5Gui.so.5 + 0x18bc7d)
                #12 0x00007f54c2478d0b _ZN22QWindowSystemInterface19handleScreenRemovedEP15QPlatformScreen (libQt5Gui.so.5 + 0x148d0b)
                #13 0x00007f54bfd9e8c6 _ZN15QtWaylandClient15QWaylandDisplay22registry_global_removeEj (libQt5WaylandClient.so.5 + 0x838c6)
                #14 0x00007f54c04a0c04 ffi_call_unix64 (libffi.so.6 + 0x6c04)
                #15 0x00007f54c04a0107 ffi_call (libffi.so.6 + 0x6107)
                #16 0x00007f54c1929d10 wl_closure_invoke.constprop.0 (libwayland-client.so.0 + 0x6d10)
                #17 0x00007f54c192a42b dispatch_event.isra.0 (libwayland-client.so.0 + 0x742b)
                #18 0x00007f54c192a61c wl_display_dispatch_queue_pending (libwayland-client.so.0 + 0x761c)
                #19 0x00007f54bfd9b6d3 _ZN15QtWaylandClient15QWaylandDisplay13flushRequestsEv (libQt5WaylandClient.so.5 + 0x806d3)
                #20 0x00007f54c208d4fd _Z10doActivateILb0EEvP7QObjectiPPv (libQt5Core.so.5 + 0x2af4fd)
                #21 0x00007f54c208fb3a _ZN15QSocketNotifier9activatedE17QSocketDescriptorNS_4TypeENS_14QPrivateSignalE (libQt5Core.so.5 + 0x2b1b3a)
                #22 0x00007f54c20902d4 _ZN15QSocketNotifier5eventEP6QEvent (libQt5Core.so.5 + 0x2b22d4)
                #23 0x00007f54c2ccbe73 _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent (libQt5Widgets.so.5 + 0x1ade73)
                #24 0x00007f54c205cf48 _ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent (libQt5Core.so.5 + 0x27ef48)
                #25 0x00007f54c20aa17f _ZL28socketNotifierSourceDispatchP8_GSourcePFiPvES1_ (libQt5Core.so.5 + 0x2cc17f)
                #26 0x00007f54c05314cf g_main_context_dispatch (libglib-2.0.so.0 + 0x554cf)
                #27 0x00007f54c05854e8 g_main_context_iterate.constprop.0 (libglib-2.0.so.0 + 0xa94e8)
                #28 0x00007f54c052ec03 g_main_context_iteration (libglib-2.0.so.0 + 0x52c03)
                #29 0x00007f54c20a96f8 _ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt5Core.so.5 + 0x2cb6f8)
                #30 0x00007f54c205b9b2 _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE (libQt5Core.so.5 + 0x27d9b2)
                #31 0x00007f54c2063544 _ZN16QCoreApplication4execEv (libQt5Core.so.5 + 0x285544)
                #32 0x000055d8f59ddfd1 main (plasmashell + 0x26fd1)
                #33 0x00007f54c1a15b75 __libc_start_main (libc.so.6 + 0x27b75)
                #34 0x000055d8f59de3ee _start (plasmashell + 0x273ee)
                
                Stack trace of thread 53483:
                #0  0x00007f54c1ae39ff __poll (libc.so.6 + 0xf59ff)
                #1  0x00007f54c058547c g_main_context_iterate.constprop.0 (libglib-2.0.so.0 + 0xa947c)
                #2  0x00007f54c052ec03 g_main_context_iteration (libglib-2.0.so.0 + 0x52c03)
                #3  0x00007f54c20a96f8 _ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt5Core.so.5 + 0x2cb6f8)
                #4  0x00007f54c205b9b2 _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE (libQt5Core.so.5 + 0x27d9b2)
                #5  0x00007f54c1ec349a _ZN7QThread4execEv (libQt5Core.so.5 + 0xe549a)
                #6  0x00007f54c2959f8b _ZN22QDBusConnectionManager3runEv (libQt5DBus.so.5 + 0x1cf8b)
                #7  0x00007f54c1ec4751 _ZN14QThreadPrivate5startEPv (libQt5Core.so.5 + 0xe6751)
                #8  0x00007f54c0e87299 start_thread (libpthread.so.0 + 0x9299)
                #9  0x00007f54c1aee6a3 __clone (libc.so.6 + 0x1006a3)
                
                Stack trace of thread 53484:
                #0  0x0
Comment 29 Tomasz Paweł Gajc 2021-05-08 20:33:33 UTC
same thing happens on OpenMandriva Lx cooker with up to date Plasma 5.21.5 and framweworks 5.82.0
Comment 30 Mircea Kitsune 2021-05-09 00:41:03 UTC
(In reply to Tomasz Paweł Gajc from comment #29)

I hear Plasma 5.22 comes with some improvements for Wayland. No idea if that includes this issue, perhaps let us know if you notice a difference after its update.
Comment 31 Bernie Innocenti 2021-05-09 19:17:53 UTC
(In reply to Mircea Kitsune from comment #30)
> (In reply to Tomasz Paweł Gajc from comment #29)
> 
> I hear Plasma 5.22 comes with some improvements for Wayland. No idea if that
> includes this issue, perhaps let us know if you notice a difference after
> its update.

No, last week it was still happening on git master.
Comment 32 Rainer Finke 2021-05-14 11:22:57 UTC
I tried it on Plasma 5.22 beta. Just by turning the monitor off and on again with the power button, the plasmashell/session will crash. But Kwin kept running so I was able to manually start plasmashell again.

Operating System: Arch Linux
KDE Plasma Version: 5.21.90
KDE Frameworks Version: 5.82.0
Qt Version: 5.15.2
Kernel Version: 5.12.3-arch2-1 (64-bit)
Graphics Platform: Wayland
Processors: 24 × AMD Ryzen 9 3900X 12-Core Processor
Memory: 31.4 GiB of RAM
Graphics Processor: AMD Radeon VII
Comment 33 Mircea Kitsune 2021-06-09 11:54:18 UTC
(In reply to Rainer Finke from comment #32)
> I tried it on Plasma 5.22 beta. Just by turning the monitor off and on again
> with the power button, the plasmashell/session will crash. But Kwin kept
> running so I was able to manually start plasmashell again.
> 
> Operating System: Arch Linux
> KDE Plasma Version: 5.21.90
> KDE Frameworks Version: 5.82.0
> Qt Version: 5.15.2
> Kernel Version: 5.12.3-arch2-1 (64-bit)
> Graphics Platform: Wayland
> Processors: 24 × AMD Ryzen 9 3900X 12-Core Processor
> Memory: 31.4 GiB of RAM
> Graphics Processor: AMD Radeon VII

This is concerning: The release notes for 5.22 say the issue should have been fixed, and I was hoping to try moving to Wayland again given this was the core reason why I had to revert back to X11. I understand WL had issues knowing how to handle itself when all displays are disconnected and none are left active at a given moment, which should have been addressed in the display stack code.
Comment 34 Yannick 2021-06-09 20:45:45 UTC
I have the exact same issue as Rainer Finke described, on Plasma 5.22.0.
Plasmashell crashes just by turning my DisplayPort monitor off and on. Restarting plasmashell brings the session back.

Sadly I didn't find any related core dump with coredumpctl.

OS: Arch Linux
KDE Plasma Version: 5.22.0
KDE Frameworks Version: 5.82.0
Qt Version: 5.15.2
Kernel Version: 5.12.9
GPU: AMD RX560 (mesa drivers)
Comment 35 Nate Graham 2021-06-10 15:35:56 UTC
*** Bug 433342 has been marked as a duplicate of this bug. ***
Comment 36 Xu Zhao 2021-07-03 11:21:27 UTC
Can confirm this issue on openSUSE Tumbleweed 20210701, KDE Plasma 5.22.2, KDE Frameworks 5.83.0 on Wayland, AMD 6800 XT
Comment 37 Nate Graham 2021-07-12 13:02:40 UTC
Is this affected by the fix for Bug 438789?
Comment 38 Mircea Kitsune 2021-07-14 13:10:50 UTC
I could confirm today the issue is far from resolved in Plasma 5.22 (Manjaro Linux) albeit it has gotten a step closer to being fixed. I tried the Wayland session and let my monitor go into standby with the following results:

This time I'm taken to a black screen with a message written in large font, saying the screen locker stopped working and I need to use a systemctl command to unlock my session. Out of curiosity I jumped to another runlevel (Control + Alt + F#) logged in as root and unlocked: This time I could at least return to my session without noticing any major glitches! But icons on my taskbar were reordered, indicating plasmashell might have crashed and restarted.

The monitor obviously didn't remain in standby: It attempts going to sleep then wakes up and I'm faced with the message about the screen locker crash.
Comment 39 Xu Zhao 2021-07-14 16:41:02 UTC
(In reply to Nate Graham from comment #37)
> Is this affected by the fix for Bug 438789?

No, I tested with patched kwin, and the problem still exists.
Comment 40 Tomasz Paweł Gajc 2021-07-17 23:04:39 UTC
Openmandriva Lx Cooker with Plasma-5.22.3, Frameworks-5.84.0 and up to date patchset for Qt5 i no longer observer any plasmashell crashes with Wayland.

coredumpctl is clean when my monitor goes into standby, but yet plasmashell as a process is terminated:

Jul 18 00:50:36 omv-rockpro64 org_kde_powerdevil[97696]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Jul 18 00:50:36 omv-rockpro64 kded5[97674]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Jul 18 00:50:36 omv-rockpro64 plasmashell[97698]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Jul 18 00:50:36 omv-rockpro64 plasmashell[97698]: trying to show an empty dialog
Jul 18 00:50:36 omv-rockpro64 plasmashell[97698]: file:///usr/share/plasma/shells/org.kde.plasma.desktop/contents/views/Desktop.qml:146:19: QML Loader: Binding loop detected for property "height"
Jul 18 00:50:36 omv-rockpro64 plasmashell[97698]: file:///usr/share/plasma/shells/org.kde.plasma.desktop/contents/views/Desktop.qml:146:19: QML Loader: Binding loop detected for property "height"
Jul 18 00:50:36 omv-rockpro64 plasmashell[97698]: qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
Jul 18 00:50:36 omv-rockpro64 plasmashell[97698]: qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
Jul 18 00:50:36 omv-rockpro64 plasmashell[97698]: trying to show an empty dialog
Jul 18 00:50:36 omv-rockpro64 plasmashell[97698]: Old primary output: QScreen(0x3a12a290, name="HDMI-A-1") New primary output: QScreen(0x3bd30840, name="")
Jul 18 00:50:36 omv-rockpro64 plasmashell[97698]: qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
Jul 18 00:50:36 omv-rockpro64 plasmashell[97698]: trying to show an empty dialog
Jul 18 00:50:36 omv-rockpro64 plasmashell[97698]: file:///usr/share/plasma/shells/org.kde.plasma.desktop/contents/views/Desktop.qml:146:19: QML Loader: Binding loop detected for property "height"
Jul 18 00:50:36 omv-rockpro64 plasmashell[97698]: file:///usr/share/plasma/shells/org.kde.plasma.desktop/contents/views/Desktop.qml:146:19: QML Loader: Binding loop detected for property "height"
Jul 18 00:50:36 omv-rockpro64 plasmashell[97698]: qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
Jul 18 00:50:36 omv-rockpro64 plasmashell[97698]: qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
Jul 18 00:50:36 omv-rockpro64 plasmashell[97698]: qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
Jul 18 00:50:36 omv-rockpro64 plasmashell[97698]: trying to show an empty dialog
Jul 18 00:50:36 omv-rockpro64 plasmashell[97698]: qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
Jul 18 00:50:36 omv-rockpro64 plasmashell[97698]: trying to show an empty dialog
Jul 18 00:50:36 omv-rockpro64 plasmashell[97698]: qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
Jul 18 00:50:36 omv-rockpro64 plasmashell[97698]: trying to show an empty dialog
Jul 18 00:50:36 omv-rockpro64 plasmashell[97698]: file:///usr/share/plasma/shells/org.kde.plasma.desktop/contents/views/Desktop.qml:121: TypeError: Cannot read property 'x' of null
Jul 18 00:50:36 omv-rockpro64 plasmashell[97698]: file:///usr/share/plasma/shells/org.kde.plasma.desktop/contents/views/Desktop.qml:135: TypeError: Cannot read property 'y' of null
Jul 18 00:50:36 omv-rockpro64 systemd[84533]: Started dbus-:1.2-org.kde.KSplash@2.service.
Jul 18 00:50:37 omv-rockpro64 kded5[97674]: kscreen.kded: Config does not have at least one screen enabled, WILL NOT save this config, this is not what user wants.
Jul 18 00:50:37 omv-rockpro64 plasmashell[97698]: The Wayland connection experienced a fatal error: Błąd protokołu
Jul 18 00:50:40 omv-rockpro64 kded5[97674]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Jul 18 00:50:40 omv-rockpro64 org_kde_powerdevil[97696]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Jul 18 00:50:40 omv-rockpro64 kded5[97674]: kscreen.kded: Config does not have at least one screen enabled, WILL NOT save this config, this is not what user wants.
Jul 18 00:51:17 omv-rockpro64 klauncher[97917]: Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
Jul 18 00:51:37 omv-rockpro64 plasma_waitforname[97885]: org.kde.knotifications: WaitForName: Service was not registered within timeout
Jul 18 00:51:37 omv-rockpro64 systemd[84533]: dbus-:1.2-org.kde.KSplash@2.service: Main process exited, code=exited, status=1/FAILURE
Jul 18 00:51:37 omv-rockpro64 systemd[84533]: dbus-:1.2-org.kde.KSplash@2.service: Failed with result 'exit-code'.
Comment 41 miku84 2021-08-02 17:32:38 UTC
Hi All,

I am having this issue since a while which forced me:
-do not forget to turn on monitor before computer
-disable monitor autosuspend, even do not turn it off
otherwise plasma wayland gives only black screen back :(

A single listening to music needs monitor turned on, pls. fix it ASAP.
thanks
Comment 42 Mircea Kitsune 2021-08-02 18:06:37 UTC
(In reply to miku84 from comment #41)
> Hi All,
> 
> I am having this issue since a while which forced me:
> -do not forget to turn on monitor before computer
> -disable monitor autosuspend, even do not turn it off
> otherwise plasma wayland gives only black screen back :(
> 
> A single listening to music needs monitor turned on, pls. fix it ASAP.
> thanks

This is the one reason why I'm having to stick to X11 right now: Everything else works almost perfectly on Wayland except for the monitor! I have one screen which I don't need to unplug at runtime... however I want it to go into standby after 5 minutes of inactivity, to reduce wear and most importantly my electricity consumption. If I were to use Wayland I'd have to keep my monitor on all the time, for a computer I leave powered on overnight: I can't throw money away on pointless electricity usage.

So I second: PLEASE fix this in the next Plasma release! Plasma Wayland has been around for years, yet in such a long time something as basic as monitor standby couldn't be safely implemented? Part of the fix in the display stack was done in 5.22, the crash was reduced but is still there and the monitor still wakes up right after going to sleep. Test via DisplayPort cable if possible, the issue may still be related this connection more.
Comment 43 Zamundaaa 2021-08-07 15:24:26 UTC
Git commit 1041ef8275f4f07c6189205cb34043d0b6155710 by Xaver Hugl.
Committed on 07/08/2021 at 15:18.
Pushed by zamundaaa into branch 'master'.

platforms/drm: introduce virtual outputs

When the last output gets disconnected, create a virtual output as a
placeholder until we have access to a physical output again. While
this placecholder never gets rendered to, with virtual outputs in
general that is possible (with gbm and qpainter atm) and can be done
for future use cases like wireless displays.
Related: bug 438839

M  +10   -0    src/abstract_wayland_output.cpp
M  +4    -0    src/abstract_wayland_output.h
M  +3    -1    src/plugins/platforms/drm/CMakeLists.txt
M  +8    -7    src/plugins/platforms/drm/abstract_egl_drm_backend.h
A  +59   -0    src/plugins/platforms/drm/drm_abstract_output.cpp     [License: GPL(v2.0+)]
A  +55   -0    src/plugins/platforms/drm/drm_abstract_output.h     [License: GPL(v2.0+)]
M  +49   -23   src/plugins/platforms/drm/drm_backend.cpp
M  +12   -10   src/plugins/platforms/drm/drm_backend.h
M  +35   -11   src/plugins/platforms/drm/drm_gpu.cpp
M  +13   -6    src/plugins/platforms/drm/drm_gpu.h
M  +21   -22   src/plugins/platforms/drm/drm_output.cpp
M  +13   -29   src/plugins/platforms/drm/drm_output.h
M  +1    -1    src/plugins/platforms/drm/drm_pipeline.cpp
A  +108  -0    src/plugins/platforms/drm/drm_virtual_output.cpp     [License: GPL(v2.0+)]
A  +60   -0    src/plugins/platforms/drm/drm_virtual_output.h     [License: GPL(v2.0+)]
M  +14   -16   src/plugins/platforms/drm/egl_gbm_backend.cpp
M  +10   -10   src/plugins/platforms/drm/egl_gbm_backend.h
M  +34   -29   src/plugins/platforms/drm/egl_stream_backend.cpp
M  +4    -4    src/plugins/platforms/drm/egl_stream_backend.h
M  +3    -3    src/plugins/platforms/drm/scene_qpainter_drm_backend.cpp
M  +3    -3    src/plugins/platforms/drm/scene_qpainter_drm_backend.h
M  +1    -1    src/plugins/platforms/drm/shadowbuffer.cpp
M  +2    -2    src/plugins/platforms/drm/shadowbuffer.h
M  +14   -4    src/wayland_server.cpp

https://invent.kde.org/plasma/kwin/commit/1041ef8275f4f07c6189205cb34043d0b6155710
Comment 44 Seqularise 2021-08-07 15:39:37 UTC
Just tested it win kwin from master, this patch does not fix this
Comment 45 Nate Graham 2021-08-07 19:30:18 UTC
Raising to VHI due to severity of the issue (full session crashes are no bueno and can cause data loss).
Comment 46 Mircea Kitsune 2021-08-08 20:10:20 UTC
(In reply to Zamundaaa from comment #43)

A virtual fallback output sounds like a promising start: From what I understood so far these crashes occur because Wayland doesn't know how to handle being left without any display device. At this point I can agree even with a way to trick the pipeline into not freaking out in that scenario, even if it's not ideal long term from a programming standpoint.

Unfortunately, as comment 44 describes above, even this doesn't resolve our issue just yet. Thank you Seqularise for testing so rapidly to confirm this. Is it known what else is happening to still cause those crashes?
Comment 47 Xu Zhao 2021-08-29 00:37:37 UTC
Just wondering is there any update to this issue, given its VHI level?
Comment 48 Seqularise 2021-09-01 18:23:53 UTC
https://pastebin.com/E4fzxj1U plasmashell
https://pastebin.com/4bDUWmSX kwin
Dont know if these useful but i just got these backtraces from recent master
Comment 49 Zamundaaa 2021-09-04 19:12:14 UTC
There have been a few related changes in KWin, and while plasmashell still crashes, neither turning off the output nor having Screen Energy Savings kills the session for me with git master. Can you check again?
Comment 50 darkbasic 2021-09-04 19:24:46 UTC
I don't know if it's related or a completely different bug, but if I attach an external monitor and set it as my sole output (thus my laptop's screen goes black) then as soon as I close the laptop lid it crashes.
My workaround is to attach the external monitor at boot and close the laptop's lid in SDDM, before logging into Plasma. I'm using Arch Linux packages.
Comment 51 Tony 2021-09-12 04:36:36 UTC
(In reply to Zamundaaa from comment #49)
> There have been a few related changes in KWin, and while plasmashell still
> crashes, neither turning off the output nor having Screen Energy Savings
> kills the session for me with git master. Can you check again?

Can confirm turning the monitor off and on does not crash the session on master, it does F up plasmashell badly.
Comment 52 Xu Zhao 2021-09-12 05:11:20 UTC
(In reply to Tony from comment #51)
> (In reply to Zamundaaa from comment #49)
> > There have been a few related changes in KWin, and while plasmashell still
> > crashes, neither turning off the output nor having Screen Energy Savings
> > kills the session for me with git master. Can you check again?
> 
> Can confirm turning the monitor off and on does not crash the session on
> master, it does F up plasmashell badly.

Can I have the backtrace of plasmashell?
Comment 53 Tony 2021-09-13 03:03:10 UTC
Created attachment 141502 [details]
valgrind log

Drkonqui is not triggering and i am not getting dumps shown in coredumpctl, so i tried with vlagrind.
I killed the plasmashell process and run it with valngrind.

valgrind --log-file=crashlog --track-origins=yes --leak-check=full plasmashell.

Doing this triggered drkonqui, so this log may not be useful, then i turned off and on the monitor.
Doing this kills the valgrind process and i get this on the konsole :

xdg_surface@51: error -1: invalid window geometry size (0x0)
The Wayland connection experienced a fatal error: Protocol error
Comment 54 Tony 2021-09-13 03:08:15 UTC
Created attachment 141503 [details]
Plasma after turning off and on the monitor

The desktop icons, pinned launchers and systray entries are gone.
Comment 55 Tony 2021-09-13 03:20:22 UTC
Runninf the plasmashell process with gdb and turning off and on the monitor has a similar result as with valgrind. 

Not stack is generated, the plasmashell process dies and this get printed in
gdb :

xdg_surface@51: error -1: invalid window geometry size (0x0)
The Wayland connection experienced a fatal error: Protocol error
Comment 56 Leyenda 2021-09-21 17:22:37 UTC
Tested again on kde neon with plasma 5.21 beta:

only running one app: firefox faltpak version (xwayland)

turned off screen
turned on screen

firefox still runs
only wallpaper and desktop icons on place

Ctrl+esc to check if plasmashell is running, is not running

after a minute the desktop goes to black, wallpaper and icons disappear

alt+f2 
execute plasmashell

all plasma elements come back
firefox still running as usual
Comment 57 Leyenda 2021-09-21 17:26:32 UTC
*plasma 5.23 beta(In reply to Leyenda from comment #56)
> Tested again on kde neon with plasma 5.21 beta:
> 
> only running one app: firefox faltpak version (xwayland)
> 
> turned off screen
> turned on screen
> 
> firefox still runs
> only wallpaper and desktop icons on place
> 
> Ctrl+esc to check if plasmashell is running, is not running
> 
> after a minute the desktop goes to black, wallpaper and icons disappear
> 
> alt+f2 
> execute plasmashell
> 
> all plasma elements come back
> firefox still running as usual

plasma 5.23 beta, sorry
Comment 58 Elias 2021-09-22 15:15:12 UTC
(In reply to Leyenda from comment #57)

> > turned off screen
> > turned on screen
> > 
> > firefox still runs
> > only wallpaper and desktop icons on place

I can confirm that bahaviour on Fedora 34 with Plasma 2.22.90. My monitor is a Dell UltraSharp U3417W.
Comment 59 Tomasz Paweł Gajc 2021-09-24 17:23:29 UTC
I see now that plasmashell process just does clean exit when screen goes off.

[root@omv-rockpro64 .config]# rpm -qf $(command -v plasmashell)
plasma-workspace-5.22.90-1.aarch64

Anything related to this issue in my journal log:

Sep 24 19:13:08 omv-rockpro64 kded5[283183]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Sep 24 19:13:08 omv-rockpro64 org_kde_powerdevil[283198]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Sep 24 19:13:08 omv-rockpro64 kded5[283183]: kscreen.kded: Config does not have at least one screen enabled, WILL NOT save this config, this is not what user wants.


coredumpctl is clean
Comment 60 Yosuke Matsumura 2021-09-28 19:31:49 UTC
*** Bug 443027 has been marked as a duplicate of this bug. ***
Comment 61 Nate Graham 2021-10-04 14:25:51 UTC

*** This bug has been marked as a duplicate of bug 438839 ***