Bug 485845 - kwin hangs and glitches when using desktop portal
Summary: kwin hangs and glitches when using desktop portal
Status: RESOLVED UPSTREAM
Alias: None
Product: xdg-desktop-portal-kde
Classification: Plasma
Component: general (show other bugs)
Version: 6.0.4
Platform: Fedora RPMs Linux
: NOR major
Target Milestone: ---
Assignee: Plasma Bugs List
URL: https://gitlab.freedesktop.org/drm/am...
Keywords:
: 486177 499631 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-04-20 09:35 UTC by edinbruh
Modified: 2025-02-08 08:33 UTC (History)
5 users (show)

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


Attachments
log from journalctl, some repeated messages are omitted (17.07 KB, text/x-log)
2024-04-20 09:35 UTC, edinbruh
Details
this is what the glitched desktop looks like (324.46 KB, image/jpeg)
2024-04-20 09:37 UTC, edinbruh
Details
xdg-desktop-portal stack trace (33.33 KB, text/plain)
2024-04-22 08:28 UTC, edinbruh
Details
plasmashell stack trace (86.81 KB, text/plain)
2024-04-22 08:32 UTC, edinbruh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description edinbruh 2024-04-20 09:35:38 UTC
Created attachment 168712 [details]
log from journalctl, some repeated messages are omitted

SUMMARY

When opening a file from telegram-desktop from flatpak, the desktop portal should open a prompt asking which application to open it with. Instead, the entire desktop freezes, the gpu usage ramps up, and the screen gets filled with graphic artifacts. I was not able to replicate this on other applications but I doubt that telegram has the power to cause this behaviour.
I'm not sure if this is the desktop portal's or kwin's fault.

STEPS TO REPRODUCE
1. Send a file with telegram
2. Click "open with"
3. The desktop is frozen and in a few seconds it will start glitching

OBSERVED RESULT
The desktop is frozen and filled with artifacts

EXPECTED RESULT
I get a desktop portal prompt

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora 39
(available in About System)
KDE Plasma Version: 6.0.4 (from copr)
KDE Frameworks Version: 6.1.0
Qt Version: 6.6.2

ADDITIONAL INFORMATION
I installed plasma 6 from this copr: https://copr.fedorainfracloud.org/coprs/solopasha/kde6/ if this is not reproducible I will post there.

Sometimes I'm able to switch to a tty, if I do, I'm able to run glmark2_drm so I doubt it's the gpu that's broken. If I do a soft-reboot with systemd, the system recovers. I don't know how to properly restart just the desktop on wayland, but I would try that. If I just kill plasmadesktop and kwin_wayland and let them get restarted on their own it doesn't recover properly.
With nvtop on tty I can see the gpu usage is at 100%, on one occasion it also filled the vram, but the entire system started misbehaving (couldn't connect with ssh, the prompt on the tty froze).

I found some seemingly related logs on journalctl, they are attached.
This is what I found, but if needed I will provide more info.
Comment 1 edinbruh 2024-04-20 09:37:33 UTC
Created attachment 168713 [details]
this is what the glitched desktop looks like

I attached an image of the glitches
Comment 2 edinbruh 2024-04-21 15:52:57 UTC
I stumbled on another way to produce the error on a different application: https://flathub.org/apps/one.ablaze.floorp it's a firefox fork

Steps:
1. Install Floorp from flathub
2. Visit https://www.speedtest.net/ and start a speed test
3. The browser will ask permission to access location, allow it
4. The desktop portal should ask permission to provide location, but it will hand and glitch

Once again, it is related to the desktop portal.
I tried to rescue the system by performing a graphic reset (`sudo cat /sys/kernel/debug/dri/1/amdgpu_gpu_recover`) and a soft reboot.
Surprisingly, after that everything started working, even the portal, until the next real reboot.
I couldn't manage to make it happen again, now despite resetting and rebooting, the portal keeps hanging when prompting.
Comment 3 edinbruh 2024-04-22 08:28:32 UTC
Created attachment 168785 [details]
xdg-desktop-portal stack trace

I forgot to attach the stack trace
Comment 4 edinbruh 2024-04-22 08:32:53 UTC
Created attachment 168787 [details]
plasmashell stack trace

and the plasmashell trace.
Comment 5 edinbruh 2024-04-25 10:57:24 UTC
I don't think it's the desktop portal's fault, i think it's either a larger kde issue or an issue in the amd drivers. I have reported it on gitliab as well, with more logs: https://gitlab.freedesktop.org/drm/amd/-/issues/3342
Comment 6 edinbruh 2024-04-25 13:23:23 UTC
I have tested on a live usb with fedora 39 (so before kde 6) and I can't reproduce the issue
Comment 7 Nate Graham 2024-04-25 14:40:31 UTC
Cool, thanks!
Comment 8 edinbruh 2024-04-25 17:36:26 UTC
Wait, you have resolved it already? what was the problem?
Comment 9 Akseli Lahtinen 2024-06-10 13:28:52 UTC
*** Bug 486177 has been marked as a duplicate of this bug. ***
Comment 10 edinbruh 2024-06-10 13:47:05 UTC
Update: this has since been moved from the triaging amd/drm repo to the mesa/mesa repo and is thought to be a radeonsi bug. Here's the new issue https://gitlab.freedesktop.org/mesa/mesa/-/issues/11173
Comment 11 TraceyC 2025-02-07 17:46:02 UTC
*** Bug 499631 has been marked as a duplicate of this bug. ***
Comment 12 Filip 2025-02-08 08:33:54 UTC
*** Bug 499665 has been marked as a duplicate of this bug. ***