Created attachment 178224 [details] plasmashell freezes and eventually crashes SUMMARY When I run any game in gamescope it will make plasmashell freeze, stop loading thumbnails and eventually crash/restart. After a restart it's still freezing and keep doing that until I close gamescope. STEPS TO REPRODUCE 1. Run any game through gamescope 2. Try to interact with plasmashell OBSERVED RESULT Freezing, crashing, missing thumbnails SOFTWARE/OS VERSIONS Operating System: Arch Linux KDE Plasma Version: 6.3.0 KDE Frameworks Version: 6.10.0 Qt Version: 6.8.2 Kernel Version: 6.13.2-2-cachyos (64-bit) Graphics Platform: Wayland Processors: 16 × AMD Ryzen 7 9800X3D 8-Core Processor Memory: 62.5 ГиБ of RAM Graphics Processor: AMD Radeon RX 6700 XT Manufacturer: ASUS ADDITIONAL INFORMATION This is a regression in 6.3.0. There was no such issue on 6.2.5
For this to be actionable we need a backtrace of plasmashell when frozen. See https://community.kde.org/Plasma/Debugging
Created attachment 178299 [details] plasmashell journalctl log Here's plasmashell log
Created attachment 178300 [details] plasmashell backtrace Here's plasmashell backtrace. Although I don't think it would be much uselful.
Created attachment 178301 [details] 2 windows in task manager created by gamescope I've noticed that gamescopes creates 2 windows now on Plasma 6.3.0 : game's window and dummy window
Created attachment 178315 [details] when mangohud overlay is shown plasmashell hangs I'm experiencing the same issue, it seems to get somehow triggered by MangoApp (MangoHud) while it's running inside gamescope. Like shown in the video attachment, when i hide the overlay after a bunch of seconds plasmashell recovers and it behaves normally again. I've tried using both mangohud-git from the aur and an older version mangohud-0.7.2-2, but this didn't fix the issue. SOFTWARE/OS VERSIONS Operating System: Arch Linux KDE Plasma Version: 6.3.0 KDE Frameworks Version: 6.10.0 Qt Version: 6.8.2 Kernel Version: 6.13.2-1-cachyos (64-bit) Graphics Platform: Wayland Processors: 16 × AMD Ryzen 7 7700X 8-Core Processor Memory: 30.5 GiB of RAM Graphics Processor 1: AMD Radeon RX 7900 XTX
Can confirm that without magoapp gamescope works just fine and plasmashell doesn't freeze/crash.
That's not a backtrace, sorry. See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports#Retrieving_a_backtrace_using_coredumpctl
Created attachment 178600 [details] result of gdb of plasmashell Unfortunately, no matter how I try it doesn't produce backtrace: neither if I attach to a process nor if I start a new process with gdb. I think this is because plasmashell doesn't really crash but freezeing so hard it eventually gets killed from Wayland events buffer overflow. What I can do is to provide instructions to reliably reproduce this issue: you have to run a Windows game using gamescope with mangoapp and Proton. For example use this command: `WINEPREFIX=$PWD PROTONPATH=GE-Proton gamescope -f --mangoapp -- umu-run game.exe` After launching the game if you alt-tab and try to interact with panels plasmashell at first will react fine, but over the time it will become slower and slower and eventually become completely unresponsive and killed(?) afterwards.
> I think this is because plasmashell doesn't really crash but freezeing so hard it eventually gets > killed from Wayland events buffer overflow. That's possible, yeah.
Is this new in Plasma 6.3?
This looks bad: > фев 13 19:19:21 oleg-pc plasmashell[1745]: The Wayland connection experienced a fatal error: Слишком много открытых файлов The error message translates to "too many open files" I see a few more instances of that error as well: > фев 13 19:34:37 oleg-pc plasmashell[10328]: error marshalling arguments for get_icon: dup failed: Слишком много открытых файлов > фев 13 19:34:37 oleg-pc plasmashell[10328]: Error marshalling request: Слишком много открытых файлов Moving to KWin, but I'm not sure what could be done about this.
(In reply to Nate Graham from comment #10) > Is this new in Plasma 6.3? Yes, this is new in Plasma 6.3, there was no such issue on Plasma 6.2
I've got some new findings, hoping it helps to pinpoint the cause. Basically plasmashell hanging/crashing on gamescope with mangoapp seems to be directly tied to the framerate the game is running at, the higher the framerate the faster plasmashell experiencies slowdowns/crashes. On my specific system i've found that: if the game is running below around 120 FPS i don't experience apparent slowdowns when the FPS are between 125 and 170 i increasingly experience slowdowns when running above 180 FPS plasmashell eventually crashes/gets killed. To summarize: FPS <= 120 (No apparent slowdowns) 125 =< FPS <= 170 (I increasingly experience slowdowns) FPS >= 180 (Plasmashell eventually crashes/gets killed) Can you confirm that's also the case for you?
Well yes, I can confirm that with 60 fps lock plasmashell doesn't freeze/crash no matter how long I play but if I turn frame limiter to 300 plasmashell will freeze from the start.
Also, creating window rule for "gamescope" window to hide it from task manager also fixes the issue with plasmashell freezing. I don't know why plasmashell showing second window for Proton games running through gamescope. Maybe it's actually plasmashell bug and not Kwin?
(In reply to Oleg from comment #15) > Also, creating window rule for "gamescope" window to hide it from task > manager also fixes the issue with plasmashell freezing. Yes, i can confirm that
I suspect that this is triggered by the new xdg icon support, but I'm not sure. Please provide the output of running gamescope and plasmashell both with WAYLAND_DEBUG=1. You don't need to keep it running until the latter crashes, I suspect there will be something relevant rather quickly.
Created attachment 178691 [details] Compressed wayland debug log Here's log with WAYLAND_DEBUG=1. It's quite large, so I had to compress it.
Thanks. In that log, gamescope does > [ 478951.190] {Default Queue} -> xdg_toplevel_icon_manager_v1#13.create_icon(new id xdg_toplevel_icon_v1#163) > [ 478951.213] {Default Queue} -> wl_shm#7.create_pool(new id wl_shm_pool#167, fd 105, 4096) > [ 478951.216] {Default Queue} -> wl_shm_pool#167.create_buffer(new id wl_buffer#169, 0, 32, 32, 128, 0) > [ 478951.217] {Default Queue} -> xdg_toplevel_icon_v1#163.add_buffer(wl_buffer#169, 1) > [ 478951.219] {Default Queue} -> xdg_toplevel_icon_manager_v1#13.set_icon(xdg_toplevel#118, xdg_toplevel_icon_v1#163) pretty often, but by far not often enough for plasmashell to use enough fds to cause issues. I guess that when you see the crash, plasmashell happens to be a lot slower than usual, while gamescope changes its icon more often than usual. I used a small test program that sets the icon 100x a second to try to reproduce it, and after quite a while it did happen. Notable there is that plasmashell 1. slowed down a *lot* while running the test program. Opening kickoff took like 10-20 seconds 2. had like 600 open fds sometimes before going back down 3. has a soft fd limit of 1024 4. it felt like the crash was triggered by me switching window focus, but I'm not sure As the simplest workaround for this, plasmashell could raise its file descriptor limit. A nicer fix could be to only allow one pending get_icon request per window, which would also at least reduce the chance for apps to slow it down with excessive icon changes. It would also be good to report this to gamescope as well, I doubt that the icon is actually changing that often. Even with this bug fixed, it'll cause unnecessary CPU usage in gamescope, kwin_wayland and plasmashell.
I've filed an issue on gamescope's repo: https://github.com/ValveSoftware/gamescope/issues/1753
If I am not mistaken, this is a similar issue to one that occured on X11: https://bugs.kde.org/show_bug.cgi?id=487390
This issue was fixed on a gamescope side. Should we consider relevant plasmashell issue fixed as well or there will be some fixes to it to prevent similar issues in the future?
Sounds like the downstream fix was enough!