Bug 489677 - KWin freeze seemingly randomly when Xwayland windows are opened or many windows are opened
Summary: KWin freeze seemingly randomly when Xwayland windows are opened or many windo...
Status: REPORTED
Alias: None
Product: kwin
Classification: Plasma
Component: input (show other bugs)
Version: git-stable-Plasma/6.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-03 13:56 UTC by Geoffrey
Modified: 2025-01-08 13:58 UTC (History)
2 users (show)

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


Attachments
attachment-437112-0.html (1.20 KB, text/html)
2024-07-03 22:43 UTC, Geoffrey
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Geoffrey 2024-07-03 13:56:45 UTC
SUMMARY
Screen output buffer freezes for many seconds (30+), sometimes, even a few minutes (max ~3), but all processes remain running in the background (Ex. I still heard the video I'm watch in my headphones). Libinput still accepts input events, but KWin fails to process them in a timely manor (over 40ms according to libinput logs).

I'm assuming this is related to many Xwayland Chromium windows opened, but this is just a hunch.

I have noticed something interesting with this. The longer I have the KWin process running, the less I see these freezes.

However, on average, I get this behavior multiple times per day.

STEPS TO REPRODUCE
1. Run a Nvidia RTX 2000, 3000, or 4000 series gpu using the Nouveau driver
2. Open many Chromium windows (maybe ~5) and tabs (maybe ~10) with youtube.com in them
3. Kill KWin, letting all the Chromium windows crash
4. Open Chromium again and "restore" the previous browser session
5. Screen freeze usually happens within ~30 minutes of use

OBSERVED RESULT
Random screen freezes described in summary

EXPECTED RESULT
No screen freezes

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.1.0
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.1
Kernel Version: 6.9.6-zen1-1-zen (64-bit)
Graphics Platform: Wayland
Processors: 12 × 12th Gen Intel® Core™ i5-12400
Memory: 62.5 GiB of RAM
Graphics Processor: NV176 [AKA RTX 3060 12G running Nouveau driver]

ADDITIONAL INFORMATION
I am upgrading to Plasma Version 6.1.1. I will close this issue if I no long see this issue in the next few weeks.

Updated Version Info:
Operating System: Arch Linux 
KDE Plasma Version: 6.1.1
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.2
Kernel Version: 6.9.6-zen1-1-zen (64-bit)
Graphics Platform: Wayland
Processors: 12 × 12th Gen Intel® Core™ i5-12400
Memory: 62.5 GiB of RAM
Graphics Processor: NV176 [AKA RTX 3060 12G running Nouveau driver]
Comment 1 Geoffrey 2024-07-03 13:59:15 UTC
I forgot to mention switching to another TTY (with ctrl+alt+f5) seems to make the freeze last for a shorter amount of time, but that could just be a coincidence.
Comment 2 fanzhuyifan 2024-07-03 17:03:14 UTC
When the freeze happens, does kwin use 100% of CPU? If so, it would be very helpful if you could go to a virtual TTY, attach a gdb instance to kwin, and print a backtrace showing where kwin is stuck at.
Comment 3 Geoffrey 2024-07-03 22:43:57 UTC
Created attachment 171347 [details]
attachment-437112-0.html

Not possible, unfortunately. The freeze makes switching to TTY impossible until freeze is over. Switching to TTY just tends to make freeze last less time seemingly. 

Since updated to 6.1.1 today, I haven't noticed the issue. Maybe, I need start and stop KWin a few times to activate this behavior?

On July 3, 2024 1:03:14 PM EDT, bugzilla_noreply@kde.org wrote:
>https://bugs.kde.org/show_bug.cgi?id=489677
>
>fanzhuyifan@gmail.com changed:
>
>           What    |Removed                     |Added
>----------------------------------------------------------------------------
>                 CC|                            |fanzhuyifan@gmail.com
>
>--- Comment #2 from fanzhuyifan@gmail.com ---
>When the freeze happens, does kwin use 100% of CPU? If so, it would be very
>helpful if you could go to a virtual TTY, attach a gdb instance to kwin, and
>print a backtrace showing where kwin is stuck at.
>
>-- 
>You are receiving this mail because:
>You reported the bug.
Comment 4 Geoffrey 2024-07-19 20:53:43 UTC
Issue is still happening on 6.1.1
Comment 5 fabrice salvaire 2025-01-08 13:58:37 UTC
I also encounter every day Kwin freeze since one month on Fedora 40 and now 41.  Hardware is an Intel GPU laptop.