Bug 438839

Summary: Wayland - turning monitor off and back on causes plasmashell to make invalid xdgshell request and crash
Product: [Plasma] plasmashell Reporter: neto0110 <sekritmail9>
Component: generic-crashAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: crash CC: aalsing, aisidun, alex765, alexey.min, amessina, antonio.chirizzi, asturm, auxsvr, baito30, bitlord0xff, bugs.kde.org, chris-hartmann, david001, dev+kde, forusim, francoisprunier, greg.martyn, imaginator, inglessi, josealvarado1337, katyaberezyaka, kde, kde, kde, kdebugs, ln, ltstarwarskid, markus, matt.fagnani, miku84, nate, neopytek, odachnam, oxalicc, philipp.reichmuth, poperigby, postix, ppp5, robinhuang123, saiarcot895, seqularise, sirenji404, smit17xp, sonichedgehog_hyperblast00, svckd, vikts, yosukematsumura, zvova7890
Priority: NOR Keywords: wayland
Version: 5.22.1   
Target Milestone: 1.0   
Platform: Arch Linux   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=420160
https://bugs.kde.org/show_bug.cgi?id=439096
https://bugs.kde.org/show_bug.cgi?id=444801
Latest Commit: Version Fixed In: 5.24
Sentry Crash Report:
Attachments: kstart5 plasmashell log
plasmashell crash log on 5.23.1 with patch 1125 applied
output from journalctl 5.23.2
Screen crash logs from 5.23.3
Plasmashell crash log 5.23.3
plasmashell crash backtrace after Qt patch
plasmashell-20211210-140231-w-qtwayland-46ed85a8-w-debug-symbols.kcrash

Description neto0110 2021-06-18 04:22:08 UTC
Created attachment 139463 [details]
kstart5 plasmashell log

SUMMARY
Turning primary monitor off and on causes plasmashell to crash, opened windows seemingly unaffected, requires a manual start of plasmashell to get it back.

MONITOR CONFIGURATION
primary monitor HP-24f on HDMI-A-1

STEPS TO REPRODUCE
1. Turn monitor off
2. Turn monitor on

OBSERVED RESULT
plasmashell disappears and has to be started manually

EXPECTED RESULT
plasmashell continues to function normally

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.22.1
KDE Frameworks Version: 5.83.0
Qt Version: 5.15.2
Comment 1 David Redondo 2021-06-18 08:19:14 UTC
xdg_surface@51: error -1: invalid window geometry size (0x0)
Comment 2 Christian Hartmann 2021-06-19 10:24:25 UTC
Same with opensuse tumbleweed
Comment 3 David Edmundson 2021-06-19 11:39:38 UTC
>xdg_surface@51: error -1: invalid window geometry size (0x0)

Potentially 2555663c9f59b93f5fcc5d3ead233bee280e36f8 in QtWayland (Qt6) fixes this.

It's not in Qt 5.15.2 it is in our KDE backports.

Can you get an exact version of QtWayland (or at least specific enough that we can ask OpenSuse people what patches that contains)
Comment 4 Christian Hartmann 2021-06-19 16:13:52 UTC
It's libqt5-qtwayland-5.15.2-4.2 (https://build.opensuse.org/package/show/openSUSE%3AFactory/libqt5-qtwayland)
Comment 5 neto0110 2021-06-20 21:51:11 UTC
I have the qt5-wayland 5.15.2+kde+r28-1 package on Arch
Comment 6 neto0110 2021-06-27 03:05:54 UTC
(In reply to David Edmundson from comment #3)
> >xdg_surface@51: error -1: invalid window geometry size (0x0)
> 
> Potentially 2555663c9f59b93f5fcc5d3ead233bee280e36f8 in QtWayland (Qt6)
> fixes this.
> 
> It's not in Qt 5.15.2 it is in our KDE backports.
> 
> Can you get an exact version of QtWayland (or at least specific enough that
> we can ask OpenSuse people what patches that contains)

I looked up and that commit should be in the Arch package since apparently they are using commit a6476d1a1c78eb7f17408241b268404e27b3e161 in the https://invent.kde.org/qt/qt/qt5-wayland repository for that package
Comment 7 David Edmundson 2021-07-09 07:58:50 UTC
I have a theory on this:
 - some suspends cause screen removals
 - Qt inserts a QPlatformPlaceholderScreen
 - this has a size of 0
 - Creating a window with a size of 0 is illegal (and pointless)

Not sure whether we should guard this in the client or in QtWaylandClient. Probably both
Comment 8 Zamundaaa 2021-08-07 15:24:34 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 420160

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 9 zvova7890 2021-08-18 01:52:46 UTC
I have build 1041ef8275f4f07c6189205cb34043d0b6155710 on my arch system. After monitor reattached plasma still crash

...
xdg_surface@52: error -1: invalid window geometry size (0x0)
The Wayland connection experienced a fatal error: Ошибка протокола
[vova7890@asus-pc ~]$ echo $?
1
[vova7890@asus-pc ~]$ kwin_wayland -v
kwin 5.22.80
[vova7890@asus-pc ~]$

Interest moment, plasma return exit code 1 but not restarted automatically
Comment 10 David Edmundson 2021-10-03 20:09:11 UTC
*** Bug 439321 has been marked as a duplicate of this bug. ***
Comment 11 Nate Graham 2021-10-04 14:23:59 UTC
*** Bug 443174 has been marked as a duplicate of this bug. ***
Comment 12 Nate Graham 2021-10-04 14:24:07 UTC
*** Bug 438517 has been marked as a duplicate of this bug. ***
Comment 13 Nate Graham 2021-10-04 14:24:16 UTC
*** Bug 438373 has been marked as a duplicate of this bug. ***
Comment 14 Nate Graham 2021-10-04 14:24:23 UTC
*** Bug 433767 has been marked as a duplicate of this bug. ***
Comment 15 Nate Graham 2021-10-04 14:24:31 UTC
*** Bug 424879 has been marked as a duplicate of this bug. ***
Comment 16 Nate Graham 2021-10-04 14:24:40 UTC
*** Bug 413480 has been marked as a duplicate of this bug. ***
Comment 17 Nate Graham 2021-10-04 14:25:00 UTC
*** Bug 415394 has been marked as a duplicate of this bug. ***
Comment 18 Nate Graham 2021-10-04 14:25:04 UTC
*** Bug 417341 has been marked as a duplicate of this bug. ***
Comment 19 Nate Graham 2021-10-04 14:25:51 UTC
*** Bug 420160 has been marked as a duplicate of this bug. ***
Comment 20 Nate Graham 2021-10-04 14:25:54 UTC
*** Bug 443027 has been marked as a duplicate of this bug. ***
Comment 21 Nate Graham 2021-10-04 14:25:57 UTC
*** Bug 433342 has been marked as a duplicate of this bug. ***
Comment 22 Nate Graham 2021-10-17 23:27:41 UTC
*** Bug 443884 has been marked as a duplicate of this bug. ***
Comment 23 David Edmundson 2021-10-19 22:13:50 UTC
This is hopefully fixed in 5.23.2

https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1125

Please create a new bug report with new logs if we have issues after that.
Comment 24 zvova7890 2021-10-20 22:08:01 UTC
I'm apply patch for 5.23.1 plasma-workspace and... bug is still here :(
Comment 25 Nate Graham 2021-10-21 15:02:06 UTC
*** Bug 444161 has been marked as a duplicate of this bug. ***
Comment 26 Oxalica 2021-10-23 11:02:15 UTC
Created attachment 142787 [details]
plasmashell crash log on 5.23.1 with patch 1125 applied

I tried 5.23.1 with the patch mentioned applied

<https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1125>

But I still get the same crash when re-plug the monitor, and log is also almost exactly the same. I don't think this bug is fixed. It should be reopened.

See attachment for the log.
Comment 27 sattaxt 2021-10-26 20:19:44 UTC
Crashes with the same error for me in 5.23.2
Comment 28 sattaxt 2021-10-26 20:24:20 UTC
Created attachment 142923 [details]
output from journalctl 5.23.2
Comment 29 zvova7890 2021-10-26 21:34:44 UTC
5.23.2

qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
trying to show an empty dialog
file:///usr/share/plasma/shells/org.kde.plasma.desktop/contents/views/Desktop.qml:134:19: QML Loader: Binding loop detected for property "height"
file:///usr/share/plasma/shells/org.kde.plasma.desktop/contents/views/Desktop.qml:134:19: QML Loader: Binding loop detected for property "height"
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
trying to show an empty dialog
Old primary output: QScreen(0x55ce67ea4cf0, name="DP-1") New primary output: QScreen(0x55ce69d7d100, name="")
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
trying to show an empty dialog
file:///usr/share/plasma/shells/org.kde.plasma.desktop/contents/views/Desktop.qml:134:19: QML Loader: Binding loop detected for property "height"
file:///usr/share/plasma/shells/org.kde.plasma.desktop/contents/views/Desktop.qml:134:19: QML Loader: Binding loop detected for property "height"
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
trying to show an empty dialog
xdg_surface@52: error -1: invalid window geometry size (0x0)
The Wayland connection experienced a fatal error: Ошибка протокола
Comment 30 Francois Prunier 2021-10-26 22:03:02 UTC
I think I can reproduce this bug (or a very similar one) any time by:
- starting a session on my laptop with an external display
- suspending the laptop
- waking it up not connected to the external display

-> I then get a black screen with only the pointer moving, all apps seem to be running still but I can't see them (I can see them with a `ps` command on a vt)
Comment 31 ltstarwarskid 2021-10-27 14:51:27 UTC
Requesting this be re-opened, I'm still getting the issue on 5.23.2

10/27/21 7:40 AM	org.freedesktop.impl.portal.desktop.kde	xdp-kde-background: GetAppState called: no parameters
10/27/21 7:41 AM	kactivitymanagerd	qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
10/27/21 7:41 AM	org.freedesktop.impl.portal.desktop.kde	xdp-kde-wayland-integration: Removing output:
10/27/21 7:41 AM	org.freedesktop.impl.portal.desktop.kde	xdp-kde-wayland-integration:     manufacturer:  "LG Electronics"
10/27/21 7:41 AM	org.freedesktop.impl.portal.desktop.kde	xdp-kde-wayland-integration:     model:  "27GN950/007NTEP02148"
10/27/21 7:41 AM	org.freedesktop.impl.portal.desktop.kde	qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
10/27/21 7:41 AM	baloorunner	qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
10/27/21 7:41 AM	kernel	usb 7-1.4: USB disconnect, device number 4
10/27/21 7:41 AM	kernel	Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
10/27/21 7:41 AM	kernel	Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
10/27/21 7:41 AM	kernel	Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
10/27/21 7:41 AM	org.freedesktop.impl.portal.desktop.kde	xdp-kde-wayland-integration: Adding output:
10/27/21 7:41 AM	org.freedesktop.impl.portal.desktop.kde	xdp-kde-wayland-integration:     manufacturer:  "LG Electronics"
10/27/21 7:41 AM	org.freedesktop.impl.portal.desktop.kde	xdp-kde-wayland-integration:     model:  "27GN950/007NTEP02148"
10/27/21 7:41 AM	org.freedesktop.impl.portal.desktop.kde	xdp-kde-wayland-integration:     resolution:  QSize(3840, 2160)
10/27/21 7:41 AM	org.freedesktop.impl.portal.desktop.kde	xdp-kde-wayland-integration: Adding output:
10/27/21 7:41 AM	org.freedesktop.impl.portal.desktop.kde	xdp-kde-wayland-integration:     manufacturer:  "LG Electronics"
10/27/21 7:41 AM	org.freedesktop.impl.portal.desktop.kde	xdp-kde-wayland-integration:     model:  "27GN950/007NTEP02148"
10/27/21 7:41 AM	org.freedesktop.impl.portal.desktop.kde	xdp-kde-wayland-integration:     resolution:  QSize(3840, 2160)

It then repeats the attempt to add my monitor about 20 more times. In addition, drkonqi crashes if I click on the report bug button after this. It didn't do that before. If I can get a backtrace without drkonqi crashing, I'll attach the crash file for the new version.
Comment 32 Leyenda 2021-11-01 11:19:43 UTC
I can confirm Plasma 5.23.2 sadly still having the same issue
Comment 33 Alex 2021-11-02 00:11:29 UTC
Per David's request, here is a new bug to track this: https://bugs.kde.org/show_bug.cgi?id=444801

If you still encounter this issue, please post logs there.
Comment 34 Nate Graham 2021-11-03 16:45:29 UTC
Git commit d39592c3c84a899e52b7f42419ca679b07d78f61 by Nate Graham, on behalf of Oxalica F.
Committed on 03/11/2021 at 16:43.
Pushed by ngraham into branch 'master'.

wayland: don't create DesktopView for placeholder screen

This fix crash when turn off and on the only primary display.
Related: bug 444801

M  +6    -1    shell/shellcorona.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/d39592c3c84a899e52b7f42419ca679b07d78f61
Comment 35 Nate Graham 2021-11-03 16:45:48 UTC
Git commit 7dd3aa10d0e62ff76ed965f0069b9035bf7565b3 by Nate Graham, on behalf of Oxalica F.
Committed on 03/11/2021 at 16:45.
Pushed by ngraham into branch 'Plasma/5.23'.

wayland: don't create DesktopView for placeholder screen

This fix crash when turn off and on the only primary display.
Related: bug 444801


(cherry picked from commit d39592c3c84a899e52b7f42419ca679b07d78f61)

M  +6    -1    shell/shellcorona.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/7dd3aa10d0e62ff76ed965f0069b9035bf7565b3
Comment 36 Nate Graham 2021-11-03 16:46:10 UTC
*** Bug 444801 has been marked as a duplicate of this bug. ***
Comment 37 zvova7890 2021-11-04 13:47:18 UTC
I have check Nate's patch - now it finally fixed! Thanks!
Comment 38 Nate Graham 2021-11-04 14:10:20 UTC
Not my patch, it was made by Oxalica F.! I just merged it for him. :)
Comment 39 zvova7890 2021-11-04 14:19:43 UTC
Any way, thanks to all :)
Comment 40 phrxmd 2021-11-10 11:30:10 UTC
I'm seeing crashes in Akonadi whenever I switch off my external screen or unplug the dock it's attached to (bug 445249). Could this be related?
Comment 41 Nate Graham 2021-11-10 14:26:58 UTC
Extremely unlikely.
Comment 42 Victoria 2021-11-10 16:48:53 UTC
Created attachment 143415 [details]
Screen crash logs from 5.23.3

This bug still occurs for me on Plasma 5.23.3. Logs attached.

Operating System: Arch Linux
KDE Plasma Version: 5.23.3
KDE Frameworks Version: 5.87.0
Qt Version: 5.15.2
Kernel Version: 5.14.16-zen1-1-zen (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 2600X Six-Core Processor
Memory: 15.6 GiB of RAM
Graphics Processor: AMD Radeon RX 580 Series
Comment 43 Victoria 2021-11-10 16:54:15 UTC
Created attachment 143416 [details]
Plasmashell crash log 5.23.3
Comment 44 Victoria 2021-11-10 16:56:55 UTC
I'm sorry for comment spam, but it might be relevant.

It happens when I turn on my secondary monitor.
Comment 45 Leyenda 2021-11-11 14:09:18 UTC
Kde neon testing edition
frameworks 5.88
kde plasma 5.23.3
qt 5.15.3

With Plasma 5.23.3, when I turn off and on my screen, now desktop survives, al panel stay in place and working (they were gone before), although kde or qt apps opened (I'm not sure, apps like dolphin or system settings) remain open but they become non-responsive and grey and need to be closed.

But its a step forward.
Comment 46 miku84 2021-11-11 19:58:35 UTC
(In reply to Leyenda from comment #45)
> Kde neon testing edition
> frameworks 5.88
> kde plasma 5.23.3
> qt 5.15.3
> 
> With Plasma 5.23.3, when I turn off and on my screen, now desktop survives,
> al panel stay in place and working (they were gone before), although kde or
> qt apps opened (I'm not sure, apps like dolphin or system settings) remain
> open but they become non-responsive and grey and need to be closed.
> 
> But its a step forward.

Yes, for example clementine playpack freezes after screen comes back. It feels to me like the panel is not the old one, but it is a new one created when there is no panel (see the panel drawing animation, it starts the animation later, the screen is the first).
Comment 47 Mircea Kitsune 2021-11-19 18:19:09 UTC
Got on Plasma 5.23.3 in Manjaro. Even in this release the issue hasn't been fully addressed: Tested Wayland session again on my mother's computer, it uses a common HDMI connection for the monitor. Once the monitor shut itself off, it came right back up as usual... this time however I only saw the desktop wallpaper and none of the keys worked, it's like the entire system froze as not even Alt + Shift + F# to change runlevel worked any more, though I could still move the mouse pointer around which was peculiar.
Comment 48 robinhuang123 2021-12-04 03:30:26 UTC
I'm observing the same bug on Plasma 5.23.3 (on NixOS 21.11). After turning off and on my monitor connected via HDMI,

* The desktop environment doesn't respond to key presses and mouse clicks
* If this is done on the lock screen, the lock screen also does not respond
* The cursor still moves around
* Pressing Ctrl-Alt-F3 to switch to ttys does nothing (while ssh-ing into the machine still works)

Maybe we should reopen this ticket?
Comment 49 Dima 2021-12-04 08:02:40 UTC
Same thing as above happens to me with 5.23.3 on SUSE Tumbleweed in Wayland, while Xorg works fine.
The cursor changes when hovering over e.g. resizable widgets but I can't interact with anything.
Can't switch TTYs with the keyboard even after doing Alt+Sysrq+R (though the rest of the REISUB sequence works).
Comment 50 Mircea Kitsune 2021-12-04 10:33:49 UTC
Is it okay to reopen this please? Clearly the core issue hasn't been resolved, at best it might have been moved elsewhere. Seems this option is provided below the comment box, figured I'd ask first before messing with the bug status if it will let me as a non-reporting user.
Comment 51 phrxmd 2021-12-04 14:29:19 UTC
I'm in favour of reopening, I don't think this has been fixed.
I am still observing this in Plasma 5.23.4. I power down my external HDMI monitor, Plasmashell goes down, taking all applications with it. In addition (probably as a consequence of Plasmashell going down) Akonadi segfaults.

This is on OpenSUSE TW, Plasma 5.34.4, Frameworks 5.88, Qt 5.15.2, libqt5-qtwayland 5.15.2+kde34-1.2.
Comment 52 Mircea Kitsune 2021-12-04 14:37:27 UTC
Done, hopefully this works. This issue has been around for so long and is literally the one reason why some of us can't use Wayland and need to stick to X11, hope this offers more hope in solving the issue soon.
Comment 53 David Edmundson 2021-12-05 07:05:06 UTC
>https://codereview.qt-project.org/c/qt/qtwayland/+/381271

Please only reopen if you run with this patch above.
Comment 54 Saikrishna 2021-12-07 16:58:39 UTC
Created attachment 144311 [details]
plasmashell crash backtrace after Qt patch

I'm still seeing this crash even after applying the Qt patch and doing a local build with that patch. The backtrace for each crash appears to be roughly in the same area (+/- a few lines). This crash is actually in QML/QtQuick code, and I know that it doesn't happen on X11.

I've attached the backtrace as well as a bit of debugging I did. It's been a while since I did any programming with Qt, but I'd guess that this object is getting destroyed (or was destroyed) and this function got called in the middle of that cleanup.

$ apt-cache policy plasma-workspace libqt5waylandclient5
plasma-workspace:
  Installed: 4:5.23.4-0ubuntu1~ubuntu21.10~ppa1
  Candidate: 4:5.23.4-0ubuntu1~ubuntu21.10~ppa1
  Version table:
 *** 4:5.23.4-0ubuntu1~ubuntu21.10~ppa1 500
        500 http://ppa.launchpad.net/kubuntu-ppa/backports/ubuntu impish/main amd64 Packages
        100 /var/lib/dpkg/status
     4:5.22.5-0ubuntu1 500
        500 http://mirror.pnl.gov/ubuntu/ impish/universe amd64 Packages
        500 http://mirrors.vcea.wsu.edu/ubuntu impish/universe amd64 Packages
libqt5waylandclient5:
  Installed: 5.15.2-4ubuntu1~ppa1
  Candidate: 5.15.2-4ubuntu1~ppa1
  Version table:
 *** 5.15.2-4ubuntu1~ppa1 100
        100 /var/lib/dpkg/status
     5.15.2-4 500
        500 http://mirror.pnl.gov/ubuntu/ impish/universe amd64 Packages
        500 http://mirrors.vcea.wsu.edu/ubuntu impish/universe amd64 Packages
Comment 55 Saikrishna 2021-12-07 17:01:55 UTC
Reopening as I'm still seeing this crash as described in comment 54.
Comment 56 Andreas Sturmlechner 2021-12-10 13:14:06 UTC
Created attachment 144430 [details]
plasmashell-20211210-140231-w-qtwayland-46ed85a8-w-debug-symbols.kcrash

Same here when turning off my DP screen in Plasma Wayland session.

Operating System: Gentoo 2.8
KDE Plasma Version: 5.23.4
KDE Frameworks Version: 5.88.0
Qt Version: 5.15.2
Kernel Version: 5.15.6-gentoo (64-bit)
Graphics Platform: Wayland
Processors: 24 × AMD Ryzen 9 3900X 12-Core Processor
Memory: 62,7 GiB of RAM
Graphics Processor: AMD Radeon RX 5700
Comment 57 Francois Prunier 2021-12-10 13:36:17 UTC
I still have the same problem with a patched Qt on Kubuntu 21.10 with backports enabled:

Operating System: Kubuntu 21.10
KDE Plasma Version: 5.23.4
KDE Frameworks Version: 5.88.0
Qt Version: 5.15.2
Kernel Version: 5.13.0-22-generic (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i7-4800MQ CPU @ 2.70GHz
Memory: 15,3 GiB of RAM
Graphics Processor: Mesa DRI Intel® HD Graphics 4600

Something I noticed: it seems slightly better because a few times I've been able to access krunner and restart plasmashell, but most of the time all I get is a black screen with only the cursor moving and I'm stuck with that.
Comment 58 Antonio Chirizzi 2021-12-30 16:26:17 UTC
I can confirm this problem is still alive on Fedora 35 (KDE spin):

Operating System: Fedora 35 (KDE spin)
KDE Plasma Version: 5.23.4
KDE Frameworks Version: 5.89.0
Qt Version: 5.15.2
Kernel Version: 5.15.11-200.fc35.x86_64
Graphics Platform: Wayland
Processors: AMD Ryzen 7 5700G with Radeon Graphics (family: 0x19, model: 0x50, stepping: 0x0), microcode: 0xa50000c
Memory: 32 GB of RAM

I have 2 monitor attached: one through a DisplayPort and one through HDMI. The HDMI is turned off and is disabled through the display settings. So if I turn off and then on the monitor on the DisplayPort port I get the plasmashell crash.

This is the log from "journalctl -f":

Dec 30 14:35:41 ryzen5700g akonadi_followupreminder_agent[5459]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Dec 30 14:35:41 ryzen5700g akonadi_archivemail_agent[5456]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Dec 30 14:35:41 ryzen5700g plasmashell[52678]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Dec 30 14:35:41 ryzen5700g akonadi_sendlater_agent[5469]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Dec 30 14:35:41 ryzen5700g konsole[18188]: qt.qpa.wayland: Creating a fake screen in order for Qt not to crash
Dec 30 14:35:41 ryzen5700g plasmashell[52678]: requesting unexisting screen -1
Dec 30 14:35:41 ryzen5700g plasmashell[52678]: requesting unexisting screen -1
Dec 30 14:35:41 ryzen5700g plasmashell[52678]: requesting unexisting screen -1
Dec 30 14:35:41 ryzen5700g plasmashell[52678]: requesting unexisting screen -1
Dec 30 14:35:41 ryzen5700g plasmashell[52678]: qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
...
Dec 30 14:35:41 ryzen5700g plasmashell[52678]: KCrash: Application 'plasmashell' crashing...
Dec 30 14:35:41 ryzen5700g plasmashell[52678]: KCrash: Attempting to start /usr/libexec/drkonqi
Dec 30 14:35:41 ryzen5700g plasmashell[52678]: Unable to start Dr. Konqi
Dec 30 14:35:41 ryzen5700g systemd[4908]: plasma-ksystemstats.service: Consumed 7.397s CPU time.
Dec 30 14:35:41 ryzen5700g systemd[4908]: plasma-plasmashell.service: Main process exited, code=exited, status=255/EXCEPTION
Dec 30 14:35:41 ryzen5700g plasmashell[52956]: 2021-12-30 14:35:41,597 [1180911]   WARN - pl.local.NativeFileWatcherImpl - Watcher terminated with exit code 143
Dec 30 14:35:42 ryzen5700g systemd[4908]: plasma-plasmashell.service: Failed with result 'exit-code'.
Dec 30 14:35:42 ryzen5700g systemd[4908]: plasma-plasmashell.service: Consumed 3min 1.004s CPU time.
Dec 30 14:35:42 ryzen5700g systemd[4908]: plasma-plasmashell.service: Scheduled restart job, restart counter is at 4.
Comment 59 amm 2021-12-31 00:23:52 UTC
Same behavior as above, nothing really new. Just wanted to mention that to be able to use Wayland without plasma crashing, I just disabled display switching off in settings for energy savings.

Operating System: Manjaro Linux
KDE Plasma Version: 5.23.4
KDE Frameworks Version: 5.88.0
Qt Version: 5.15.2
Kernel Version: 5.15.7-1-MANJARO (64-bit)
Graphics Platform: Wayland
Processors: 24 × AMD Ryzen 9 3900X 12-Core Processor
Memory: 62.8 GiB of RAM
Graphics Processor: AMD Radeon RX 5600 XT
Comment 60 David Edmundson 2022-01-12 15:20:55 UTC
We believe this will be resolved by: https://invent.kde.org/qt/qt/qtwayland/-/merge_requests/27

Please reopen if this an issue afterwards.
Comment 61 Francois Prunier 2022-01-12 15:29:31 UTC
@David Isn't it the same patch as https://bugs.kde.org/show_bug.cgi?id=438839#c53, but on the 5.15.2 branch instead of master ?

A few people, including myself, have tested this patch and still get the crash, so I think we should re-open this.
Comment 62 David Edmundson 2022-01-12 15:32:13 UTC
With master? Or stable branches. There were other p-w commits relating to the placeholder screen.
Comment 63 David Edmundson 2022-01-12 16:04:51 UTC
If you are on stable I can find them out. There were two relevant.
Comment 64 Francois Prunier 2022-01-12 16:37:05 UTC
I'm on Kubuntu 31.10 with backports enabled. 

I only built Qt 5.15.2 with the patch, at the time the backports had:
KDE Plasma Version: 5.23.4
KDE Frameworks Version: 5.88.0
Comment 65 Francois Prunier 2022-01-12 16:38:34 UTC
I'm currently running:

Operating System: Kubuntu 21.10
KDE Plasma Version: 5.23.5
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.2
Kernel Version: 5.13.0-25-generic (64-bit)
Graphics Platform: Wayland
Comment 66 Andreas Sturmlechner 2022-01-20 16:33:15 UTC
The situation seems to have improved considerably indeed. plasmashell is no longer crashing, falkon, dolphin and kmail survive multiple screen off/on switching, however konversation does crash regularly when doing that. But that is likely a different bug then.

Operating System: Gentoo 2.8
KDE Plasma Version: 5.23.90
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.2 (latest Qt5PatchCollection snapshots)
Qt Wayland @4644d51f which is the latest commit at the time of posting)
Kernel Version: 5.15.13-gentoo (64-bit)
Graphics Platform: Wayland
Processors: 24 × AMD Ryzen 9 3900X 12-Core Processor
Memory: 62,7 GiB of RAM
Graphics Processor: AMD Radeon RX 5700
Comment 67 Nate Graham 2022-01-20 16:38:58 UTC
Awesome, let's call it fixed.
Comment 68 phrxmd 2022-02-09 22:47:38 UTC
It's not fixed. I'm on 5.24.0, when I switch off my external monitor I get a crash and lose all my open applications.
Comment 69 Nate Graham 2022-02-10 17:25:38 UTC
Plasmashell can't take out your apps when it crashes, only KWin can do that. This bug is about a Plasmashell crash, not a KWin crash, so your issue is about something else. Can you open a new bug report for it? Thanks!
Comment 70 phrxmd 2022-02-10 17:50:55 UTC
(In reply to Nate Graham from comment #69)
> Plasmashell can't take out your apps when it crashes, only KWin can do that.
> This bug is about a Plasmashell crash, not a KWin crash, so your issue is
> about something else. Can you open a new bug report for it? Thanks!

Thank you. Reported as bug 449957.