Bug 507934

Summary: With Qt 6.10 and NVIDIA explicit sync disabled, plasmashell dies with a Wayland protocol error: "xdg_surface#353: error 3: attached a buffer before configure event"
Product: [Plasma] plasmashell Reporter: Aidan Harris <me>
Component: generalAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: major CC: dave, kde, kdedev, nate, nicolas.fella, vlad.zahorodnii, xaver.hugl, yfwong.ricky
Priority: NOR Keywords: wayland-only
Version First Reported In: 6.4.80   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: env WAYLAND_DEBUG=1 plasmashell --replace 2>&1 | lz4c -c0 - plasma-shell.log.lz4
output from: env WAYLAND_DEBUG=1 plasmashell --replace 2>&1 | lz4c -c0 - plasma-shell.log.lz4
gdb attach
gdb break on _exit()

Description Aidan Harris 2025-08-06 11:04:36 UTC
Created attachment 183825 [details]
env WAYLAND_DEBUG=1 plasmashell --replace 2>&1 | lz4c -c0 - plasma-shell.log.lz4

Operating System: Gentoo 2.17
KDE Plasma Version: 6.4.80
KDE Frameworks Version: 6.18.0
Qt Version: 6.10.0
Kernel Version: 6.16.0-rc7-1-cachyos-rc-lto (64-bit)
Graphics Platform: Wayland
Processors: 32 × AMD Ryzen 9 5950X 16-Core Processor
Memory: 64 GiB of RAM (62.7 GiB usable)
Graphics Processor: AMD Radeon RX 9070 XT
Manufacturer: ASUS

I am running development versions of KDE and Qt and getting sporadic crashes from plasma shell after some time. I'm not sure if this is a KWin issue or a Plasma issue or something else but I'm reporting this anyway in case someone can look into it. Attached are lz4 compressed logs with the output of:

env WAYLAND_DEBUG=1 plasmashell --replace 2>&1 | lz4c -c0 - plasma-shell.log.lz4
Comment 1 TraceyC 2025-08-06 17:59:28 UTC
Thanks for the bug report, and the plasmashell logs.

As the message at the top of the summary says, if something crashed, we need a backtrace of it so we can figure out what's going on. Can you please attach a backtrace of the crash using the coredumpctl command-line program, as detailed in https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports#Retrieving_a_backtrace_using_coredumpctl ?

Thanks.
Comment 2 Nicolas Fella 2025-08-06 18:31:55 UTC
A backtrace isn't going to help you diagnose a protocol error.

The issue is related to Qt 6.10
Comment 3 Aidan Harris 2025-08-06 18:44:37 UTC
(In reply to TraceyC from comment #1)
> Thanks for the bug report, and the plasmashell logs.
> 
> As the message at the top of the summary says, if something crashed, we need
> a backtrace of it so we can figure out what's going on. Can you please
> attach a backtrace of the crash using the coredumpctl command-line program,
> as detailed in
> https://community.kde.org/Guidelines_and_HOWTOs/Debugging/
> How_to_create_useful_crash_reports#Retrieving_a_backtrace_using_coredumpctl ?
> 
> Thanks.

I don't have a backtrace because I had coredumps disabled. If it happens again I'll attach it though. For some reason the KDE Crash tool doesn't trigger for Plasma Shell. I'm not sure why (probably an issue on my end somewhere. I do have KCrash installed)
Comment 4 Ricky Wong 2025-10-29 00:13:53 UTC
Created attachment 186273 [details]
output from: env WAYLAND_DEBUG=1 plasmashell --replace 2>&1 | lz4c -c0 - plasma-shell.log.lz4

I'm also getting the same issue. My plasmashell log is attached. It doesn't seem easy to reproduce. Sometimes I can go hours before it reoccurring again. The easiest way for me to reproduce so far is by switching between activities or interacting with the task manager panel (either via clicking on the application launcher widget on the panel, clicking on the system tray widget or interacting with the icon-only task manager).

Details about my system:
Operating System: Arch Linux 
KDE Plasma Version: 6.5.0
KDE Frameworks Version: 6.19.0
Qt Version: 6.10.0
Kernel Version: 6.12.55-1-lts (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5700X 8-Core Processor
Memory: 64 GiB of RAM (62.7 GiB usable)
Graphics Processor: NVIDIA GeForce RTX 4070
Comment 5 Ricky Wong 2025-10-29 00:19:45 UTC
Created attachment 186274 [details]
gdb attach

To add to my previous comment, attached is a gdb log from attaching to the plasmashell process. But there really isn't anything in there. When the "xdg_surface#353: error 3: attached a buffer before configure event" happens, the plasmashell simply dies with no exception or anything, and therefore there is no ability to see the backtrace.

I'm not sure where to go from here but I'm happy to get some pointers to further help investigate this issue.
Comment 6 Ricky Wong 2025-10-30 02:36:11 UTC
Created attachment 186314 [details]
gdb break on _exit()

Attached is a gdb log from breaking on _exit().

I think I could reproduce it pretty easily now. The trick is to press and hold the shortcuts configured for switching activities. Doing so switches the activities pretty quickly and at some point (typically not more than 10 seconds in my experience from the onset of holding the shortcut keys for switching activities), it will cause plasmashell to die with an exit code of -1.

Operating System: Arch Linux 
KDE Plasma Version: 6.5.1
KDE Frameworks Version: 6.19.0
Qt Version: 6.10.0
Kernel Version: 6.12.56-1-lts (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5700X 8-Core Processor
Memory: 64 GiB of RAM (62.7 GiB usable)
Graphics Processor: NVIDIA GeForce RTX 4070
Comment 7 Nate Graham 2025-10-30 16:25:35 UTC
Weirdly, I can't reproduce the issue by doing that.
Comment 8 Ricky Wong 2025-10-31 11:10:26 UTC
(In reply to Nate Graham from comment #7)
> Weirdly, I can't reproduce the issue by doing that.

Thanks for looking into this, Nate!

It bears mentioning that, all this while, I had explicit sync disabled with __NV_DISABLE_EXPLICIT_SYNC=1 to work around a separate fd leak bug in the nvidia driver: https://forums.developer.nvidia.com/t/fd-leak-with-explicit-sync-and-kde-plasma/317293/26

With explicit sync enabled, I couldn't reproduce the issue as well.
Comment 9 Aidan Harris 2025-10-31 19:34:13 UTC
On my side I'm using AMD hardware. I haven't seen these crashes in a while now though so maybe something changed in Mesa. I don't know.
Comment 10 Zamundaaa 2025-10-31 20:42:07 UTC
Using NVidia without explicit sync is not a supported configuration, and completely expected to cause bad problems.