Bug 464258 - plasmashell crashed with the error The Wayland connection experienced a fatal error: Bad file descriptor
Summary: plasmashell crashed with the error The Wayland connection experienced a fatal...
Status: REPORTED
Alias: None
Product: plasmashell
Classification: Plasma
Component: generic-crash (show other bugs)
Version: 5.26.5
Platform: Fedora RPMs Linux
: NOR crash
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: wayland
Depends on:
Blocks:
 
Reported: 2023-01-13 23:41 UTC by Matt Fagnani
Modified: 2024-03-10 19:21 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Journal showing plasmashell crashes with The Wayland connection experienced a fatal error: Bad file descriptor (357.77 KB, text/plain)
2023-01-13 23:57 UTC, Matt Fagnani
Details
Journal for plasmashell 5.26.90 crash (233.99 KB, text/plain)
2023-01-29 03:14 UTC, Matt Fagnani
Details
Journal for the plasmashell crash with the Bad file descriptor error in Plasma 5.27.0 (1.89 MB, text/plain)
2023-02-17 21:07 UTC, Matt Fagnani
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Fagnani 2023-01-13 23:41:15 UTC
SUMMARY

I was using Plasma 5.26.5 on Wayland with a Fedora Rawhide KDE Plasma live image Fedora-KDE-Live-x86_64-Rawhide-20230111.n.0.iso in a QEMU/KVM VM in GNOME Boxes in a Fedora 37 KDE Plasma installation. I started Konsole from the menu. I ran sudo dnf upgrade in Konsole. I hovered the cursor over the icons in the task manager. plasmashell crashed when hovering over task manager icons  plasmashell might've crashed when the Konsole popup was shown. The task manager disappeared and then reappeared automatically several seconds later. The journal at the time of the crash showed plasmashell crashed with the error The Wayland connection experienced a fatal error: Bad file descriptor and lines like plasmashell[1531]: kpipewire_logging: Failed to query DMA-BUF formats.

Jan 13 17:50:14 plasmashell[1531]: trying to show an empty dialog
Jan 13 17:50:16 plasmashell[1531]: kpipewire_logging: Failed to query DMA-BUF formats.
Jan 13 17:50:17 plasmashell[1531]: kpipewire_logging: Failed to query DMA-BUF formats.
Jan 13 17:50:25 plasmashell[1531]: kpipewire_logging: Failed to query DMA-BUF formats.
Jan 13 17:50:26 plasmashell[1531]: kpipewire_logging: Failed to query DMA-BUF formats.
Jan 13 17:50:27 plasmashell[1531]: KCrash: Application 'plasmashell' crashing...
Jan 13 17:50:27 plasmashell[1531]: The Wayland connection experienced a fatal error: Bad file descriptor
Jan 13 17:50:28 systemd[1344]: plasma-plasmashell.service: Main process exited, code=exited, status=1/FAILURE
Jan 13 17:50:28 systemd[1344]: plasma-plasmashell.service: Failed with result 'exit-code'.
Jan 13 17:50:28 systemd[1344]: plasma-plasmashell.service: Consumed 43.195s CPU time.
Jan 13 17:50:28 systemd[1344]: plasma-plasmashell.service: Scheduled restart job, restart counter is at 1.
Jan 13 17:50:28 systemd[1344]: Stopped plasma-plasmashell.service - KDE Plasma Workspace.
Jan 13 17:50:28 systemd[1344]: plasma-plasmashell.service: Consumed 43.195s CPU time.
Jan 13 17:50:28 systemd[1344]: Starting plasma-plasmashell.service - KDE Plasma Workspace...
Jan 13 17:50:29 plasmashell[2722]: libEGL warning: egl: failed to create dri2 screen
Jan 13 17:50:29 systemd[1344]: Started plasma-plasmashell.service - KDE Plasma Workspace.

drkonqi didn't appear. I'll try to reproduce the problem to get a trace with gdb or valgrind.

STEPS TO REPRODUCE
1. Boot a Fedora 37 KDE Plasma installation 
2. Log in to Plasma on Wayland
3. Download Fedora Rawhide KDE Plasma live image Fedora-KDE-Live-x86_64-Rawhide-20230111.n.0.iso https://koji.fedoraproject.org/koji/buildinfo?buildID=2109618
4. Install GNOME Boxes if it isn't already with sudo dnf install gnome-boxes
5. Start GNOME Boxes
6. Boot the Fedora Rawhide KDE Plasma live image Fedora-KDE-Live-x86_64-Rawhide-20230111.n.0.iso in a QEMU/KVM VM in GNOME Boxes 
7. start Konsole from the Application launcher menu. 
8. hover the cursor back and forth over the icons including Konsole in the task manager until the crash happens

OBSERVED RESULT
plasmashell crashed when hovering over task manager icons with the error The Wayland connection experienced a fatal error: Bad file descriptor

EXPECTED RESULT
plasmashell wouldn't crash

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora Rawhide/38
(available in About System)
KDE Plasma Version: 5.26.5
KDE Frameworks Version: 5.101.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION
The way in which the crash happened was similar those crashes reported at https://bugs.kde.org/show_bug.cgi?id=447717
However, the errors in the journal were different.
Comment 1 Matt Fagnani 2023-01-13 23:57:08 UTC
Created attachment 155267 [details]
Journal showing plasmashell crashes with The Wayland connection experienced a fatal error: Bad file descriptor

I'm attaching the journal which shows three plasmashell crashes with The Wayland connection experienced a fatal error: Bad file descriptor in the same Plasma 5.26.5 on Wayland session in a Fedora Rawhide QEMU/KVM VM in GNOME Boxes with 3 GB RAM using the llvmpipe mesa driver and virtio_gpu kernel driver. The first plasmashell crash was the one I described. The second plasmashell crash happened when I clicked on the Notifications applet button in the system tray at the bottom right of the screen. The third plasmashell crash happened when I was using Firefox. The bottom panel disappeared and reappeared automatically each time.
Comment 2 Nate Graham 2023-01-17 19:40:32 UTC
Can you get a backtrace of the crash so we can be sure it's not Bug 447717?
Comment 3 Matt Fagnani 2023-01-18 19:25:48 UTC
(In reply to Nate Graham from comment #2)
> Can you get a backtrace of the crash so we can be sure it's not Bug 447717?

I tried to get a trace for quite a while with gdb and valgrind, but no core dumps were created with them or were shown according to coredumpctl and the journal. drkonqi never appeared after these crashes which I saw 4 times in total. I think because of the way the Wayland connection had a fatal error, kwin_wayland just restarted plasmashell without creating a core dump as in Bug 447717. I suspect that the problem was different as the errors in the journal were different. There were the kpipewire errors which also weren't shown in Bug 447717. I suspect that the bad file descriptor might involve kpipewire. I saw some other more infrequent kpipewire errors. I tried using WAYLAND_DEBUG=1 plasmashell --replace many times, but the errors of the type in Bug 447717 happened instead of these ones. If you have ideas of how to generate a trace with such crashes, please let me know. Thanks.
Comment 4 Nate Graham 2023-01-23 17:00:53 UTC
Hmm, but kwin_wayland didn't crash?
Comment 5 Matt Fagnani 2023-01-24 08:22:05 UTC
(In reply to Nate Graham from comment #4)
> Hmm, but kwin_wayland didn't crash?

kwin_wayland didn't crash. plasmashell crashed due to the Bad file descriptor fatal error which broke the Wayland connection, and kwin_wayland restarted plasmashell without a core dump being created. Since the crash happened once when I was using Firefox, the problem wasn't specific to hovering over the task manager icons.
Comment 6 Matt Fagnani 2023-01-29 03:14:51 UTC
Created attachment 155750 [details]
Journal for plasmashell 5.26.90 crash

I saw another plasmashell crash with the Bad file descriptor error with Plasma 5.26.90 when I opened the Application launcher menu right after Plasma started then clicked on Konsole in the Favorites menu. The screen went black. plasmashell was restarted by systemd. drkonqi didn't appear and no core dumps were shown with coredumpctl or in the journal. I was running the Fedora Rawhide live image Fedora-KDE-Live-x86_64-Rawhide-20230128.n.0.iso from https://koji.fedoraproject.org/koji/buildinfo?buildID=2142696 in a GNOME Boxes QEMU/KVM VM with 3 GB RAM and 3D acceleration disabled and EFI enabled using the llvmpipe mesa driver and virtio_gpu kernel driver. I noticed the following error which I hadn't seen before the previous such crashes plasmashell[1558]: QObject::connect(AbstractSystemPoller, KIdleTime): invalid nullptr parameter. I'm attaching the journal.

Jan 28 21:47:13 plasmashell[1558]: qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
Jan 28 21:47:13 plasmashell[1558]: trying to show an empty dialog
Jan 28 21:47:13 plasmashell[1558]: trying to show an empty dialog
Jan 28 21:47:13 plasmashell[1558]: file:///usr/lib64/qt5/qml/org/kde/plasma/extras/PlaceholderMessage.qml:238:5: QML Heading: Binding loop detected for property "verticalAlignment"
Jan 28 21:47:13 plasmashell[1558]: kf.idletime: Could not find any system poller plugin
Jan 28 21:47:13 plasmashell[1558]: QObject::connect(AbstractSystemPoller, KIdleTime): invalid nullptr parameter
Jan 28 21:47:13 plasmashell[1558]: QObject::connect(AbstractSystemPoller, KIdleTime): invalid nullptr parameter
Jan 28 21:47:13 plasmashell[1558]: file:///usr/lib64/qt5/qml/org/kde/plasma/extras/PlaceholderMessage.qml:238:5: QML Heading: Binding loop detected for property "verticalAlignment"
Jan 28 21:47:13 plasmashell[1558]: file:///usr/lib64/qt5/qml/org/kde/plasma/extras/PlaceholderMessage.qml:238:5: QML Heading: Binding loop detected for property "verticalAlignment"
Jan 28 21:47:17 kernel: hrtimer: interrupt took 35172383 ns
Jan 28 21:47:18 plasmashell[1558]: KCrash: Application 'plasmashell' crashing...
Jan 28 21:47:18 plasmashell[1558]: The Wayland connection experienced a fatal error: Bad file descriptor
Jan 28 21:47:18 systemd[1371]: plasma-plasmashell.service: Main process exited, code=exited, status=1/FAILURE
Jan 28 21:47:18 systemd[1371]: plasma-plasmashell.service: Failed with result 'exit-code'.
Jan 28 21:47:18 systemd[1371]: plasma-plasmashell.service: Consumed 16.344s CPU time.
Jan 28 21:47:18 systemd[1371]: plasma-plasmashell.service: Scheduled restart job, restart counter is at 1.
Jan 28 21:47:18 systemd[1371]: Stopped plasma-plasmashell.service - KDE Plasma Workspace.
Jan 28 21:47:18 systemd[1371]: plasma-plasmashell.service: Consumed 16.344s CPU time.
Jan 28 21:47:18 systemd[1371]: Starting plasma-plasmashell.service - KDE Plasma Workspace...
Jan 28 21:47:19 plasmashell[2450]: libEGL warning: egl: failed to create dri2 screen
Jan 28 21:47:19 systemd[1371]: Started plasma-plasmashell.service - KDE Plasma Workspace.
Comment 7 Matt Fagnani 2023-02-17 21:07:52 UTC
Created attachment 156391 [details]
Journal for the plasmashell crash with the Bad file descriptor error in Plasma 5.27.0

I saw another plasmashell crash with the Bad file descriptor error with Plasma 5.27.0 on Wayland when I opened the Application launcher menu then clicked on Konsole in the Favorites menu. plasmashell was restarted by systemd. drkonqi didn't appear and no core dumps were shown with coredumpctl or in the journal. This problem didn't usually happen when doing that. A race condition might be involved. I was running the Fedora 38 live image Fedora-KDE-Live-x86_64-38-20230217.n.0.iso https://koji.fedoraproject.org/koji/buildinfo?buildID=2153770 in a GNOME Boxes QEMU/KVM VM with 3 GB RAM and 3D acceleration disabled and EFI enabled using the llvmpipe mesa driver and virtio_gpu kernel driver. I noticed the following error which I hadn't seen before the previous such crashes QSocketNotifier: Invalid socket 6 and type 'Read', disabling... I don't know if that Invalid socket 6 might be related to the bad file descriptor.

Feb 17 15:49:14 plasmashell[13280]: KCrash: Application 'plasmashell' crashing...
Feb 17 15:49:14 plasmashell[13280]: The Wayland connection experienced a fatal error: Bad file descriptor
Feb 17 15:49:14 plasmashell[13280]: QSocketNotifier: Invalid socket 6 and type 'Read', disabling...
Feb 17 15:49:14 akonadiserver[13835]: org.kde.pim.akonadiserver: Subscriber Akonadi::Server::NotificationSubscriber(0x7fbbc80deb10) identified as "AgentBaseChangeRecorder - 94187273566320"
Feb 17 15:49:14 akonadiserver[13835]: org.kde.pim.akonadiserver: Subscriber Akonadi::Server::NotificationSubscriber(0x7fbbc8162130) identified as "UnifiedMailboxChangeRecorder - 140731228421936"
Feb 17 15:49:14 systemd[3146]: plasma-plasmashell.service: Main process exited, code=exited, status=1/FAILURE
Feb 17 15:49:14 systemd[3146]: plasma-plasmashell.service: Failed with result 'exit-code'.
Feb 17 15:49:14 systemd[3146]: plasma-plasmashell.service: Consumed 10.524s CPU time.
Feb 17 15:49:14 akonadiserver[13835]: org.kde.pim.akonadiserver: Subscriber "" disconnected
Feb 17 15:49:14 akonadiserver[13835]: org.kde.pim.akonadiserver: New notification connection (registered as Akonadi::Server::NotificationSubscriber(0x7fbbc816c030) )
Feb 17 15:49:14 akonadiserver[13835]: org.kde.pim.akonadiserver: New notification connection (registered as Akonadi::Server::NotificationSubscriber(0x7fbbc816c030) )
Feb 17 15:49:14 systemd[3146]: plasma-plasmashell.service: Scheduled restart job, restart counter is at 1.
Feb 17 15:49:14 systemd[3146]: Stopped plasma-plasmashell.service - KDE Plasma Workspace.
Comment 8 Nate Graham 2023-02-21 17:25:47 UTC
Hmm, this might be the latest manifestation of Bug 447717.
Comment 9 John Kizer 2023-04-12 15:45:50 UTC
Hi - just wanted to share in case it's helpful, I saw this message as well, but mine is on Kubuntu 22.10 with the Backports PPA enabled, so I'm on Plasma 5.27.4. Here's everything around that time from the logs:

4/12/23 11:37 AM	plasmashell	file:///usr/lib/x86_64-linux-gnu/qt5/qml/org/kde/plasma/core/private/DefaultToolTip.qml:69:13: QML Label: Binding loop detected for property "verticalAlignment"
4/12/23 11:37 AM	plasmashell	KCrash: crashing... crashRecursionCounter = 2
4/12/23 11:37 AM	plasmashell	KCrash: Application Name = plasmashell path = /usr/bin pid = 1429
4/12/23 11:37 AM	plasmashell	KCrash: Arguments: /usr/bin/plasmashell --no-respawn
4/12/23 11:37 AM	plasmashell	The Wayland connection experienced a fatal error: Bad file descriptor
4/12/23 11:37 AM	systemd	plasma-ksystemstats.service: Consumed 1.965s CPU time.
4/12/23 11:37 AM	systemd	plasma-plasmashell.service: Main process exited, code=exited, status=1/FAILURE
4/12/23 11:37 AM	systemd	plasma-plasmashell.service: Failed with result 'exit-code'.
4/12/23 11:37 AM	systemd	plasma-plasmashell.service: Consumed 25.755s CPU time.
4/12/23 11:37 AM	systemd	plasma-plasmashell.service: Scheduled restart job, restart counter is at 1.
4/12/23 11:37 AM	systemd	Stopped KDE Plasma Workspace.
4/12/23 11:37 AM	systemd	plasma-plasmashell.service: Consumed 25.755s CPU time.
4/12/23 11:37 AM	systemd	Starting KDE Plasma Workspace...

And my system info:
Operating System: Kubuntu 22.10
KDE Plasma Version: 5.27.4
KDE Frameworks Version: 5.104.0
Qt Version: 5.15.6
Kernel Version: 5.19.0-38-generic (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 5600H with Radeon Graphics
Memory: 15.0 GiB of RAM
Graphics Processor: RENOIR
Manufacturer: HP
Product Name: HP Pavilion Gaming Laptop 15-ec2xxx

Hope that is helpful somehow!
Comment 10 cacho96 2023-04-26 21:15:42 UTC
I see similar problem in Fedora 38 installed from scratch:

[24408.431884] plasmashell[15915]: The Wayland connection experienced a fatal error: Bad file descriptor
[24408.472046] systemd[1068]: plasma-plasmashell.service: Main process exited, code=exited, status=1/FAILURE
[24408.472221] systemd[1068]: plasma-plasmashell.service: Failed with result 'exit-code'.
[24409.417436] plasmashell[43463]: qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
[24409.420275] plasmashell[43463]: qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
[24409.712477] plasmashell[43463]: qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
[24409.712645] plasmashell[43463]: qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
[24409.712760] plasmashell[43463]: qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
[24409.860095] plasmashell[43463]: Trying to use rootObject before initialization is completed, whilst using setInitializationDelayed. Forcing completion
[24409.997285] plasmashell[43463]: qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
[24410.223437] plasmashell[43463]: Cyclic dependency detected between "file:///usr/share/plasma/plasmoids/org.kde.plasma.notifications/contents/ui/global/Globals.qml" and "file:///usr/share/plasma/plasmoids/org.kde.plasma.notifications/contents/ui/ThumbnailStrip.qml"
[24410.227251] plasmashell[43463]: Cyclic dependency detected between "file:///usr/share/plasma/plasmoids/org.kde.plasma.notifications/contents/ui/global/Globals.qml" and "file:///usr/share/plasma/plasmoids/org.kde.plasma.notifications/contents/ui/NotificationHeader.qml"
[24410.497779] plasmashell[43463]: QFont::setPointSizeF: Point size <= 0 (0.000000), must be greater than 0
[24410.529348] plasmashell[43463]: qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
[24410.539157] plasmashell[43463]: QFont::setPointSizeF: Point size <= 0 (0.000000), must be greater than 0
[24410.680847] plasmashell[43463]: org.kde.plasma.pulseaudio: No object for name "alsa_output.pci-0000_01_00.1.hdmi-stereo-extra1.monitor"
Comment 11 Matt Fagnani 2023-11-01 07:47:02 UTC
This type of plasmashell crash happened the two last times I've used Plasma in a VM in the same sort of way. The last time was with Plasma 5.27.9 on Wayland in a Fedora Rawhide/40 KDE Plasma live image Fedora-KDE-Live-x86_64-Rawhide-20231031.n.0.iso in a QEMU/KVM VM in GNOME Boxes in a Fedora 39 KDE Plasma installation. I started Konsole from the menu. I hovered the cursor over the Konsole and Firefox icons in the task manager. plasmashell crashed when hovering over Firefox task manager icons  The task manager disappeared and then reappeared automatically a few seconds later. The journal at the time of the crash showed plasmashell crashed with the error The Wayland connection experienced a fatal error: Bad file descriptor and lines like plasmashell[]: kpipewire_logging: Failed to query DMA-BUF formats. A race condition might be involved in which a file descriptor from kpipewire of the window preview was sometimes freed then used.