Bug 494451 - Desktop session freezes for several minutes after unlocking if notifications are received while the desktop session was locked
Summary: Desktop session freezes for several minutes after unlocking if notifications ...
Status: REPORTED
Alias: None
Product: kwin
Classification: Plasma
Component: performance (other bugs)
Version First Reported In: 6.2.3
Platform: Arch Linux Linux
: NOR major
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-10 14:04 UTC by Mark Deneen
Modified: 2024-11-21 14:53 UTC (History)
2 users (show)

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


Attachments
syscall trace of kwin_wayland while the desktop was frozen. (2.74 MB, text/x-log)
2024-10-10 14:04 UTC, Mark Deneen
Details
syscall trace of kwin_wayland while the desktop was frozen (Plasma 6.2.3) (2.63 MB, text/x-log)
2024-11-18 14:24 UTC, Mark Deneen
Details
syscall trace of kwin_wayland before unlocking until the desktop was usable (password removed) (226.40 KB, application/gzip)
2024-11-21 14:53 UTC, Mark Deneen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Deneen 2024-10-10 14:04:19 UTC
Created attachment 174630 [details]
syscall trace of kwin_wayland while the desktop was frozen.

SUMMARY

STEPS TO REPRODUCE
1.  Lock desktop
2.  Receive notifications in Google Chrome (I don't know if this is a requirement, perhaps any desktop notification will do)
3.  Unlock desktop

OBSERVED RESULT

Desktop freezes for several minutes after unlocking, followed by many crash handler dialog boxes which contain no useful information.  The freeze is observed only if notifications are received while the desktop is locked.

EXPECTED RESULT

After unlocking, the desktop session should be usable immediately.

SOFTWARE/OS VERSIONS

Operating System: Arch Linux 
KDE Plasma Version: 6.1.5
KDE Frameworks Version: 6.6.0
Qt Version: 6.7.3
Kernel Version: 6.11.2-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 12 ร— AMD Ryzen 5 4600H with Radeon Graphics
Memory: 30.8 GiB of RAM
Graphics Processor: AMD Radeon Graphics

ADDITIONAL INFORMATION

I ran strace on the kwin_wayland process and it had some interesting busy loop behavior where getpid() was called repeatedly.  I've attached the trace to this bug report.

Perhaps this is important?  https://sourceware.org/glibc/wiki/Release/2.25#pid_cache_removal
Comment 1 Mark Deneen 2024-10-11 19:20:44 UTC
I also wanted to mention that this typically happens after the screen has been locked for the night.  One or two notifications may not be enough to trigger the behavior.
Comment 2 Mark Deneen 2024-10-14 15:39:12 UTC
The length of time the session remains locked seems to impact how long the desktop remains frozen when it is unlocked.  Leaving it locked over night or for the weekend is pretty bad.
Comment 3 Nate Graham 2024-10-16 18:27:11 UTC
So it's related to length of time locked, or number of notifications received?

I.e. if it's locked for a long time with no notifications received, does the bug happen? What about if you get a huge number of notifications while locked for a short period?
Comment 4 Mark Deneen 2024-10-16 18:32:40 UTC
I will do a test this weekend, and close all programs except for the core of Plasma (no browsers open, etc) and see what happens when I unlock the session on Monday.

My gut feeling is that it has to do with the number of notifications, though, so if it unlocks cleanly on Monday I will do an additional test where I generate a few hundred notifications while it is locked.
Comment 5 Mark Deneen 2024-10-22 13:42:52 UTC
We may be able to close this.  The problem seems to have vanished after I removed some .desktop files from ~/Desktop.
Comment 6 Bug Janitor Service 2024-11-06 03:46:40 UTC
๐Ÿ›๐Ÿงน โš ๏ธ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!
Comment 7 Mark Deneen 2024-11-18 14:23:57 UTC
I thought that this was resolved, but it happened again this morning.  I'll attach another strace log, but it looks fairly identical.  It's worth noting that I updated Plasma and Qt:

Operating System: Arch Linux 
KDE Plasma Version: 6.2.3
KDE Frameworks Version: 6.8.0
Qt Version: 6.8.0
Kernel Version: 6.11.6-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 12 ร— AMD Ryzen 5 4600H with Radeon Graphics
Memory: 30.8 GiB of RAM
Graphics Processor: AMD Radeon Graphics

I also have one more theory that I'd like to test out.  I have a multi-monitor setup (laptop + external monitor over HDMI) , and I'm wondering if it has anything to do with _which_ monitor I unlock things from.
Comment 8 Mark Deneen 2024-11-18 14:24:54 UTC
Created attachment 175916 [details]
syscall trace of kwin_wayland while the desktop was frozen (Plasma 6.2.3)
Comment 9 Mark Deneen 2024-11-21 14:51:29 UTC
I tried unlocking from the other screen but the behavior was the same.  I will attach another trace to this bug report.  This trace shows the syscalls of kwin_wayland from the time I unlock until the time the desktop is functional.  I've removed a number of lines from the trace as they contained my password, but those lines should not be important to understanding what is going on.
Comment 10 Mark Deneen 2024-11-21 14:53:12 UTC
Created attachment 176007 [details]
syscall trace of kwin_wayland before unlocking until the desktop was usable (password removed)

I had to gzip the file as it exceeded the file size limit.