Bug 493142

Summary: Visiting certain websites in Firefox causes kwin_wayland to freezes and consume 100% cpu
Product: [Plasma] kwin Reporter: martin-kokos
Component: coreAssignee: KWin default assignee <kwin-bugs-null>
Status: REOPENED ---    
Severity: normal CC: john.kizer, kde, kdedev, nate, postix
Priority: NOR    
Version First Reported In: 6.1.4   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=440386
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Backtraces of thread from gdb
Thread backtraces with qt6 and kwin debug symbols

Description martin-kokos 2024-09-15 09:09:37 UTC
SUMMARY
Browsing sites with a map with Firefox (wayland mode) causes kwin_wayland to freezes and consume 100% cpu.
I've encountered it with:
https://dopravniinfo.cz/
https://www.openstreetmap.org/edit (account required)

STEPS TO REPRODUCE
1. Open Firefox in wayland mode (MOZ_ENABLE_WAYLAND=1), use a clean profile to make sure there are no modifications to default rendering options
2.  Go to https://dopravniinfo.cz/ (A national traffic information map) (dismiss the tutorial modal by clicking outside of it or press the button labeled "Preskocit")
3. Zoom around - have the SVG map render elements


OBSERVED RESULT
Kwin freezes immediately or pretty quickly 10-30s
kwin_wayland process is using 100% cpu

EXPECTED RESULT
Doesn't freeze

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Gentoo
KDE Plasma Version: 6.1.4
KDE Frameworks Version: 6.5.0
Qt Version: 6.7.2

ADDITIONAL INFORMATION
Also happens on the OSM web editor https://www.openstreetmap.org/edit
I've had something similar happen with Plasma 5, but the freeze recovered after 30-60 seconds. But not this time.

Might be related to https://bugs.kde.org/show_bug.cgi?id=492506
Comment 1 martin-kokos 2024-09-17 15:26:58 UTC
I'd like to add that its very hard to recover from this state, as its not possible to switch to a different tty and kill the process or restart display manager service. It's only possible to recover by ssh-ing into the machine and kill the kwin_wayland process from there.
Comment 2 TraceyC 2024-10-07 21:57:26 UTC
I'm not able to reproduce this on 6.1.5 or git-master
I started Firefox using a profile with no addons or modifications and verified wayland was listed in about:support - Window Protocol
I loaded https://www.openstreetmap.org/edit and zoomed in and out multiple times.

https://dopravniinfo.cz/ doesn't load at all in the browser, the site times out

I'll leave this open so that someone more knowledgeable about what the cause might be can add a comment
Comment 3 postix 2024-10-17 12:17:12 UTC
Can _not_ reproduce it as well on Fedora 40 with Plasma 6.2.0 and FF 131 on Wayland.
Comment 4 David Edmundson 2024-10-17 12:19:27 UTC
Nor can I.
Comment 5 martin-kokos 2024-10-20 16:25:05 UTC
Created attachment 175059 [details]
Backtraces of thread from gdb

I was avoiding openstreetmap.org/edit but to test its still an issue I went to the editor and got a crash again. I've pulled a backtrace and a core dump, however core is 2.8GB so not attachable to the bug report.
Comment 6 TraceyC 2024-10-21 16:19:22 UTC
Thanks for attaching the backtrace. Unfortunately the backtrace is incomplete and missing debug symbols for the following lines that we need to figure out exactly what's going wrong:

#2  0x00007fa17626899f in ??? () at /usr/lib64/libkwin.so.6
#7  0x00007fa172ae3863 in ??? () at /usr/lib64/libQt6Core.so.6

Could you please install debug symbols and attach a new symbolicated backtrace generated by using `coredumpctl gdb` in a terminal window? If necessary, see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports#Retrieving_a_backtrace_using_coredumpctl for details about how to do this. Thanks again!
Comment 7 TraceyC 2024-10-21 16:19:36 UTC
.
Comment 8 martin-kokos 2024-10-21 19:21:58 UTC
Created attachment 175092 [details]
Thread backtraces with qt6 and kwin debug symbols

I've recompiled qt6 core and kwin in order to produce debug symbols. I've also tried to do the same for mesa however the build is failing - I will pursue if it ends up being necessary as well.
I've also noticed I have -O3 enabled, I can try disabling that seems relevant.
Comment 9 TraceyC 2024-10-21 22:06:19 UTC
Thanks for the updated backtrace.
Comment 10 martin-kokos 2024-12-23 11:45:36 UTC
This is still an issues as of:
KDE Plasma Version: 6.2.4
KDE Frameworks Version: 6.7.0
Qt Version: 6.7.3

Firefox 134.0b10 (64-bit)

I wish I knew how to get at further info to track this down.
Comment 11 martin-kokos 2025-04-02 18:24:48 UTC
I don't believe 440386 is related, because symptom of this bug is also high memory usage.
Comment 12 martin-kokos 2025-05-28 10:23:38 UTC
Still issue as of:
KDE Plasma Version: 6.3.5
KDE Frameworks Version: 6.13.0
Qt Version: 6.8.3
Kernel Version: 6.12.28 (64-bit)
Graphics Platform: Wayland
Processors: 8 × 11th Gen Intel® Core™ i7-1165G7 @ 2.80GHz
Memory: 15.4 GiB of RAM
Graphics Processor: Intel® Iris® Xe Graphics
Comment 13 John Kizer 2025-05-29 18:34:42 UTC
Just noting another configuration, I can't reproduce with Plasma built from git master on Fedora KDE 42, with an NVIDIA graphics card.
Comment 14 martin-kokos 2025-05-29 20:20:10 UTC
Just had another one zooming in on mapy.com . Kwin process on 100% and memory usage rising.
Comment 15 John Kizer 2025-06-12 05:58:47 UTC
Just on the chance that it changes something - do the following steps within Firefox change anything about the issue on your device?

* Go to about:config
* Set widget.wayland.vsync.enabled to false
* Restart Firefox
Comment 16 Bug Janitor Service 2025-06-27 03:47:58 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 17 martin-kokos 2025-07-07 08:14:27 UTC
Setting widget.wayland.vsync.enabled to false doesn't prevent this situation from happening.
Might as well confirm versions:

Firefox: 141.0b6 (64-bit)
Operating System: Gentoo Linux 2.17
KDE Plasma Version: 6.3.5
KDE Frameworks Version: 6.13.0
Qt Version: 6.9.1
Kernel Version: 6.12.34 (64-bit)
Graphics Platform: Wayland
Comment 18 TraceyC 2025-07-07 16:02:13 UTC
There have been some improvements that might help. Can you update to Plasma 6.4.2 and see if the problem still happens?
Comment 19 postix 2025-07-08 10:12:06 UTC
Unless it's now fixed in 6.4.2 for your, I believe it would make sense to get some profiling with https://github.com/KDAB/hotspot?tab=readme-ov-file#using

You would record the kwin_wayland process with perf, while it's consuming 100% cpu and study afterwards the flamegraph in hotspot, to see, where it consumes most cycles. Hopefully, this would give a good clue.
Comment 20 Bug Janitor Service 2025-07-23 03:46:53 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 21 Bug Janitor Service 2025-08-07 03:46:46 UTC
🐛🧹 This bug has been in NEEDSINFO status with no change for at least 30 days. Closing as RESOLVED WORKSFORME.
Comment 22 martin-kokos 2025-11-09 09:42:11 UTC
Waited for distro to bump versions.
This is still an issue as of:

Firefox 145.0b9 (64-bit)

Operating System: Gentoo Linux 2.18
KDE Plasma Version: 6.4.5
KDE Frameworks Version: 6.18.0
Qt Version: 6.9.3
Kernel Version: 6.12.54 (64-bit)
Graphics Platform: Wayland
Processors: 8 × 11th Gen Intel® Core™ i7-1165G7 @ 2.80GHz
Memory: 16 GiB of RAM (15.4 GiB usable)
Graphics Processor: Intel® Iris® Xe Graphics
Manufacturer: Dell Inc.
Product Name: XPS 13 9305