Bug 499015 - On X11 plasmashell loses desktops and panels (black screen) when power-cycling a monitor (30% chance)
Summary: On X11 plasmashell loses desktops and panels (black screen) when power-cyclin...
Status: REPORTED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Containment (show other bugs)
Version: 6.2.5
Platform: Neon Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: X11-only
Depends on:
Blocks:
 
Reported: 2025-01-22 16:11 UTC by Mattes D
Modified: 2025-03-20 01:25 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mattes D 2025-01-22 16:11:12 UTC
SUMMARY
The plasmashell process hangs when power-cycling a screen. There is no error reported, no popup, just the taskbar disappears and the desktop turns black. Other apps' widndows still keep the space for the taskbar unoccupied, although they are "maximized".
In order to bring the desktop back to life, I execute `killall plasmashell` (which succeeds without any output; other apps' windows readjust to fit the whole screen) and then `plasmashell & disown`, which restarts the plasmashell, the taskbar and desktop re-appear and seem to work normally, as well as other apps' windows readjusting to fit the taskbar again.

STEPS TO REPRODUCE
1. Run a desktop with plasmashell with several other apps open, maximized.
2. Power-cycle the monitor
3. When the monitor shows the desktop again, there's about a 30 % chance that plasmashell hangs, as described in the Summary.

SOFTWARE/OS VERSIONS
Operating System: KDE neon 6.2
KDE Plasma Version: 6.2.5
KDE Frameworks Version: 6.10.0
Qt Version: 6.8.1
Kernel Version: 6.8.0-51-generic (64-bit)
Graphics Platform: X11
Processors: 16 × AMD Ryzen 7 5700X 8-Core Processor
Memory: 62.7 GiB of RAM
Graphics Processor: AMD Radeon RX 6600

ADDITIONAL INFORMATION
Possibly related to another moitor-power-cycling bug, https://bugs.kde.org/show_bug.cgi?id=494616 , but this time I only have one monitor attached to the computer.

Since there is no crash report, I tried at least running `plasmashell` with stderr redirected to a file, here's the end of the file:

file:///usr/share/plasma/plasmoids/org.kde.plasma.devicenotifier/contents/ui/DeviceItem.qml:129: TypeError: Cannot read property 'defaultActionText' of undefined
qt.qpa.clipboard: QXcbClipboard::setMimeData: Cannot set X11 selection owner
qt.qpa.clipboard: QXcbClipboard::setMimeData: Cannot set X11 selection owner
qt.qpa.clipboard: QXcbClipboard::setMimeData: Cannot set X11 selection owner
qt.qpa.clipboard: QXcbClipboard::setMimeData: Cannot set X11 selection owner
QFont::setPointSizeF: Point size <= 0 (0.000000), must be greater than 0
QFont::setPointSizeF: Point size <= 0 (0.000000), must be greater than 0
QFont::setPointSizeF: Point size <= 0 (0.000000), must be greater than 0
QFont::setPointSizeF: Point size <= 0 (0.000000), must be greater than 0
QFont::setPointSizeF: Point size <= 0 (0.000000), must be greater than 0
QFont::setPointSizeF: Point size <= 0 (0.000000), must be greater than 0
qt.qpa.clipboard: QXcbClipboard::setMimeData: Cannot set X11 selection owner
QFont::setPointSizeF: Point size <= 0 (0.000000), must be greater than 0
QFont::setPointSizeF: Point size <= 0 (0.000000), must be greater than 0
QFont::setPointSizeF: Point size <= 0 (0.000000), must be greater than 0
QFont::setPointSizeF: Point size <= 0 (0.000000), must be greater than 0
QFont::setPointSizeF: Point size <= 0 (0.000000), must be greater than 0
file:///usr/share/plasma/plasmoids/org.kde.plasma.devicenotifier/contents/ui/DeviceItem.qml:128: TypeError: Cannot read property 'defaultActionIcon' of undefined
file:///usr/share/plasma/plasmoids/org.kde.plasma.devicenotifier/contents/ui/DeviceItem.qml:129: TypeError: Cannot read property 'defaultActionText' of undefined
org.kde.pulseaudio: No object for name "alsa_output.pci-0000_0d_00.4.analog-stereo.monitor"
org.kde.pulseaudio: No object for name "alsa_output.pci-0000_0d_00.4.analog-stereo.monitor"
qt.qpa.clipboard: QXcbClipboard::setMimeData: Cannot set X11 selection owner
kf.kunitconversion: currency conversion table data obtained via network
file:///usr/share/plasma/plasmoids/org.kde.plasma.devicenotifier/contents/ui/DeviceItem.qml:128: TypeError: Cannot read property 'defaultActionIcon' of undefined
file:///usr/share/plasma/plasmoids/org.kde.plasma.devicenotifier/contents/ui/DeviceItem.qml:129: TypeError: Cannot read property 'defaultActionText' of undefined
kf.solid.backends.udisks2: Error getting props: "org.freedesktop.DBus.Error.UnknownMethod" "Object does not exist at path “/org/freedesktop/UDisks2/drives/WDC_WD10JMVW_11AJGS3_WD_WXF1A952SD65”" for "/org/freedesktop/UDisks2/drives/WDC_WD10JMVW_11AJGS3_WD_WXF1A952SD65"
kf.solid.backends.udisks2: Error getting props: "org.freedesktop.DBus.Error.UnknownMethod" "Object does not exist at path “/org/freedesktop/UDisks2/drives/WDC_WD10JMVW_11AJGS3_WD_WXF1A952SD65”" for "/org/freedesktop/UDisks2/drives/WDC_WD10JMVW_11AJGS3_WD_WXF1A952SD65"
kf.solid.backends.udisks2: Error getting props: "org.freedesktop.DBus.Error.UnknownMethod" "Object does not exist at path “/org/freedesktop/UDisks2/drives/WDC_WD10JMVW_11AJGS3_WD_WXF1A952SD65”" for "/org/freedesktop/UDisks2/drives/WDC_WD10JMVW_11AJGS3_WD_WXF1A952SD65"
org.kde.pulseaudio: No object for name "alsa_output.pci-0000_0d_00.4.analog-stereo.monitor"
org.kde.pulseaudio: No object for name "alsa_output.pci-0000_0d_00.4.analog-stereo.monitor"
qt.qpa.clipboard: QXcbClipboard::setMimeData: Cannot set X11 selection owner
kde.plasmashell: requesting unexisting screen available rect -1
kde.plasmashell: requesting unexisting screen available rect -1
kde.plasmashell: requesting unexisting screen available rect -1
kde.plasmashell: requesting unexisting screen available rect -1
Comment 1 Mattes D 2025-01-22 16:13:18 UTC
Possibly relevant:
My keyboard and mouse are connected through the monitor, so they disconnect and reconnect at the same time as the monitor is being power-cycled.

I'm running a `barrier` server on the machine, controlling other two computers through that.
Comment 2 Nate Graham 2025-01-22 22:02:10 UTC
This only happens on X11, right? Can you confirm that by trying to reproduce it in a Wayland session?
Comment 3 Mattes D 2025-01-24 10:34:34 UTC
As requested, I attempted the same on a Wayland session, I haven't encountered the problem there. So this bug is X11-specific.

Unfortunately I'm stuck with X11, since the mentioned `barrier` KVM doesn't work with Wayland yet.

Some more details I've observed and may come in handy:
When I lock the screen before power-cycling the monitor, even the lock screen "hangs", there's just a black screen with a mouse cursor; funnily enough, the mouse cursor changes from an arrow to an I-beam when I move it to where the password edit box is supposed to be. Entering a password shows no reaction, though. I found that switching to another text-based tty (Alt+Ctrl+F5) and back refreshes the lock screen and it starts working again.

I can do basic troubleshooting, such as attaching gdb to the process and inspecting stuff, if it helps. I don't think I could compile from source and replace the currently installed stuff, though. Hope this can be at least some help.
Comment 4 TraceyC 2025-02-24 17:58:31 UTC
Adding the x11-only keyword
Comment 5 Mathias 2025-03-14 13:24:13 UTC
I can confirm this on two separate Desktop PCs with external Monitors connected via HDMI to Intel GPUs: 
1. Start Plasma session, open programs/windows
2. Switch Monitor off and on again
3. Panel and Background are gone, but  windows of open programs are present, mouse and keyboard are functional
4. to restore panel and background: open console in same VT, issue 'plasma-shell --replace'
5. when starting over from 2 again, the plasmashell running in the console gives the same message as OP: 
kde.plasmashell: requesting unexisting screen available rect -1

Reproducible always.
At least also Plasma 6.2.4 was affected by this.
There are no error messages in the logs, and the plasmashell process is not crashing, it remains running.

Possibly relevant: In one of the setups, the monitor is not connected directly but via a KVM switch. In this case, powercycling the monitor shows no problem, but powercycling the KVM switch. While mouse and keyboard come back without a problem, the monitor stays completely blank. Because of this, I can also not restart the plasmashell. I can switch to a text-only virtual terminal but the graphical virtual terminal (vt 7) remains without signal. I can only bring it back by restarting X from the text terminal.

SOFTWARE/OS/HARDWARE:
Gentoo Linux
Kernel 6.12.16
Plasma 6.2.5-r1
KDE Framework: 6.10.0
Graphics: X11
CPU: Intel Core i5 and i7
GPU: Intel onboard UHD Graphics (driver: i915), connection: HDMI

Please let me know if I can test anything else to identify the cause.
Comment 6 Lenzoid 2025-03-20 01:25:57 UTC
Thank you so much for bringing up this bug. I have seen this bug on my main system yesterday, and since it was a pretty severe crash of the entire X session, it prompted me to make an account here. I tried to reproduce the bug again and... there seems to be quite a lot of complexity to everything concerning screens and gpus; appreciating this I try to boil it down as best as possible. This is probably becoming way too verbose, but bear with me.

Since Wayland isn't affected, I focused on testing with Plasma X11. 

Updating the system seems to have fixed it. My arch system was like a week old. Tested on a system with Nvidia and another with amdgpu: It does not crash, just on one screen it takes a long time (~60 sec) for the Desktop to load anything again, until then it's just black screen with a mouse cursor and the screen arrangement is accepted. On amd system it loads instantly. So for me, the total crash is not reproducible anymore, thankfully.

There are other problems with the System Settings > Display Configuration dialogue that need addressing and I will mention them, but they are minor in comparison and will be discussed in another ticket.

If maybe someone can try and reproduce it like this, I would be interested in hearing the results.

Steps:

- Log in to Plasma X11
- Go to Settings > Display Configuration. Arrange your screens in an extended layout (not cloned).
- Under Device, Select external screen, untick "Enabled". 
- [Some people might ask themselves, why disable one screen? Well, sometimes I want one screen especially when at night and I want to dial down the lights or generally when playing a game]
- Log off from X11, or even restart machine and log back in.
- Bring back Display Configuration, Under Device, Select external screen, tick "Enabled".
- What comes next is weird, the previous screen arrangement is not saved from previously and a cloning layout is created. (I have confirmed this on both machines and I will address this in another ticket). 
- Weird: The cloning layout on this machine takes a long while to load properly and things aren'ct clickable until you move some windows. 
- For sake of reproduction (when it crashed I did this), apply the cloned layout.
- Because Cloning is not what I want I drag the screens to an extended layout manually. This is when the one screen turns black for a minute then the desktop comes back.
- One screen is 1080p and the other is 1440p. Sometimes I get the impression that bugs can occur due to the different resolutions.

System Information (slow loading back)

Operating System: Arch Linux 
KDE Plasma Version: 6.3.3
KDE Frameworks Version: 6.12.0
Qt Version: 6.8.2
Kernel Version: 6.13.7-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5700X3D 8-Core Processor
Memory: 31.3 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 2070 SUPER
Manufacturer: Micro-Star International Co., Ltd.
Product Name: MS-7B85
System Version: 1.0

System Information (tested Plasma 6.3.2 and 6.3.3, on both it works flawlessly)

Operating System: Arch Linux 
KDE Plasma Version: 6.3.3
KDE Frameworks Version: 6.12.0
Qt Version: 6.8.2
Kernel Version: 6.13.7-arch1-1 (64-bit)
Graphics Platform: X11
Processors: 8 × AMD Ryzen 5 3550H with Radeon Vega Mobile Gfx
Memory: 13.6 GiB of RAM
Graphics Processor 1: AMD Radeon Vega 8 Graphics
Graphics Processor 2: AMD Radeon RX 5500M
Manufacturer: Micro-Star International Co., Ltd.
Product Name: Alpha 15 A3DD
System Version: REV:1.0