Bug 505536 - Switching activities too quickly crashes kwin
Summary: Switching activities too quickly crashes kwin
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: activities (other bugs)
Version First Reported In: 6.3.91
Platform: Kubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-06-12 17:01 UTC by Alex Lowe
Modified: 2025-09-16 14:04 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report: https://crash-reports.kde.org/organizations/kde/issues/206664/events/6a7246a345964e53b499ee8ae3b2eff1/


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Lowe 2025-06-12 17:01:40 UTC
SUMMARY
When there are many windows visible on the screen (maybe it's to do with the number of windows or the time it takes to render the new activity?), switching activities too quickly can cause kwin to crash. This is most observable when using activity-aware firefox, as this crash crashes all of the Firefox instances as well. Another side-effect is that all windows are placed on the default activity after the crash


STEPS TO REPRODUCE
1. Set up a desktop with two activities
2. On one, open many windows with at least one non-KDE app (e.g. Signal Desktop or Firefox)
3. On another, open many windows with at least one non-KDE app (e.g. LibreOffice)
    NOTE: Whether the same app has windows on both activities does not appear to be relevant, but it's much harder to reproduce with only KDE apps open.
4. Spam Meta+A to quickly swap between activities

OBSERVED RESULT
After several switches back and forth, kwin crashes and restarts.

EXPECTED RESULT
kwin does not crash

SOFTWARE/OS VERSIONS
Operating System: Kubuntu 25.10
KDE Plasma Version: 6.3.91
KDE Frameworks Version: 6.14.0
Qt Version: 6.8.3
Kernel Version: 6.14.0-15-generic (64-bit)
Graphics Platform: Wayland
Processors: 16 ร— AMD Ryzen 7 7840U w/ Radeon  780M Graphics
Memory: 64 GiB of RAM (60.6 GiB usable)
Graphics Processor: AMD Radeon 780M

ADDITIONAL INFORMATION
This seems to have been introduced between 6.3.5 and 6.3.90, but it still occurs on 6.3.91. I will try to get a backtrace this weekend.
Comment 1 Nate Graham 2025-06-12 17:33:19 UTC
If something crashed, we need a backtrace of it so we can figure out what's going on. Can you please attach a backtrace of the crash using the `coredumpctl` command-line program, as detailed in https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports#Retrieving_a_backtrace_using_coredumpctl?

Thanks!
Comment 2 James J. Ramsey 2025-06-22 23:13:49 UTC
How long do you have to spam Meta+A before you see a crash? I tried spamming it for about 30 seconds and didn't see anything happen.
Comment 3 Alex Lowe 2025-06-27 02:13:09 UTC
(In reply to James J. Ramsey from comment #2)
> How long do you have to spam Meta+A before you see a crash? I tried spamming
> it for about 30 seconds and didn't see anything happen.

With 6.4.0 it seems to be less frequent and I can only reliably reproduce with 3 monitors attached. It also seems to occur more reliably if I change display layouts a few more times.
Comment 4 Bug Janitor Service 2025-07-12 03:47:33 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 5 Bug Janitor Service 2025-07-27 03:46:31 UTC
๐Ÿ›๐Ÿงน This bug has been in NEEDSINFO status with no change for at least 30 days. Closing as RESOLVED WORKSFORME.
Comment 6 Alex Lowe 2025-08-20 16:24:04 UTC
I've sent in several crash reports, including one just this morning.

Using activity-aware Firefox and having multiple Firefox windows open on each activity does appear to make the crashes more reliable.
Comment 7 Alex Lowe 2025-08-27 22:54:07 UTC
Ok, the latest from kwin-wayland 6.4.4 is that I can only reproduce this:

- On my laptop that has an AMD GPU
- After adding or removing displays

Laptops with Intel and NVIDIA graphics haven't been able to reproduce it, so it could be a bug in the AMD driver. However, whatever it is, only kwin-wayland and Firefox are affected, and I think that Firefox is crashing because it can't handle the compositor going down for a few seconds.
Comment 8 Alex Lowe 2025-09-16 14:04:37 UTC
Marking this as resolved in 6.4.5 as I have been unable to reproduce it there.

I can still cause a crash by switching out .so files that widgets use, but that's a separate issue. (I guess the question there would be what the correct behaviour is? Restart just that widget? Does it need its own process? etc.)