Bug 479492 - On Wayland, plasmashell exits with large(ish) number of windows
Summary: On Wayland, plasmashell exits with large(ish) number of windows
Status: CLOSED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: general (show other bugs)
Version: 5.27.9
Platform: Fedora RPMs Linux
: HI crash
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: wayland-only
: 486966 487289 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-01-07 02:11 UTC by Don Estabrook
Modified: 2025-01-15 19:45 UTC (History)
6 users (show)

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


Attachments
Output from strace plasmashell, exiting immediately after startup. (40.31 KB, application/gzip)
2024-01-07 02:11 UTC, Don Estabrook
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Don Estabrook 2024-01-07 02:11:53 UTC
Created attachment 164725 [details]
Output from strace plasmashell, exiting immediately after startup.

SUMMARY
If I open "too many" windows, plasmashell exits with the message
> The Wayland connection broke. Did the Wayland compositor die?
resulting in the panels and root window background disappearing, etc.
plasmashell does not appear to crash - there is no indication of a coredump - it simple exits with status 1.

I'm not sure how many windows are "too many".  I was roughly guessing about 100.  xwininfo currently says the root window has 165 children, if that helps - but I see what appear to be a lot of duplicates in its list.
When I discovered what was happening, I started running plasmashell from an xterm so that (a) I could continue working, and (b) so that I could see its output.  Sometimes there are additional error messages before the one shown above, but that is the only one that's consistent.
It seems that when I'm near the limit, plasmashell becomes increasing unstable as more windows are opened.  Beyond a certain point, it exits immediately after it starts.  If I then close some windows, I can restart plasmashell and it will run again until I open more windows.

I'm attaching output from plasmashell running under strace.  In its current state, it exits immediately after starting it, with no other message than the one shown above.

STEPS TO REPRODUCE
1. Start session, open applications (web browser, numerous xterms, gitk, Ardour, okular, ...).
2. Continue opening windows, keeping an eye on the panel containing task manager (for me this is at the bottom of the screen)...
3. 

OBSERVED RESULT
With somewhere between 50 and 150 open windows, an additional window seems to cause plasmashell to exit with zero or more error messages, always ending in the on cited above.

EXPECTED RESULT
Session continues to operate normally; panels and their apps continue to function, and I'm blissfully unaware of plasmashell. :-)

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Fedora 38
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Hardware: System76 Gazelle (gaze17); Intel i7-12700H; 64 GiB RAM
I have not installed proprietary nVidia drivers, and it appears I'm running nouveau - I see it in lsmod's output.  (I've previously played around with switching between Intel and nVidia GPUs and didn't remember how I left it.)
Comment 1 Don Estabrook 2024-01-07 02:59:46 UTC
I forgot to mention that the windows I have open are spread across 5 desktops.  It appears that the issue is related to the total number of windows on all desktops, not the number on a single desktop.  (Near "the limit", I can open or close a couple windows on any desktop and cause plasmashell to exit or not.  Windows closed don't have to be the same ones that were opened past the limit.)
Comment 2 Nate Graham 2024-02-15 22:54:31 UTC
Can confirm. All window titles are sent as a string to something, and the Wayland wire protocol has a character limit that we can exceed here.
Comment 3 Bug Janitor Service 2024-02-16 10:56:40 UTC
A possibly relevant merge request was started @ https://invent.kde.org/libraries/plasma-wayland-protocols/-/merge_requests/71
Comment 4 Bug Janitor Service 2024-02-16 10:57:06 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/5223
Comment 5 Bug Janitor Service 2024-02-16 10:57:45 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/3910
Comment 6 Nate Graham 2024-05-14 21:37:41 UTC
*** Bug 486966 has been marked as a duplicate of this bug. ***
Comment 7 Bug Janitor Service 2024-05-21 12:02:55 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwayland/-/merge_requests/113
Comment 8 Bug Janitor Service 2024-05-21 12:57:22 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwayland-integration/-/merge_requests/65
Comment 9 Zamundaaa 2024-05-21 16:48:49 UTC
Git commit a77b52206eab268ce778c981175dac689505a5b0 by Xaver Hugl.
Committed on 21/05/2024 at 15:38.
Pushed by zamundaaa into branch 'master'.

plasma-window-management: add a stacking order object

Instead of sending the stacking order as a single string, which can cause the
client to crash, send it as a series of events with a done at the end

M  +36   -4    src/protocols/plasma-window-management.xml

https://invent.kde.org/libraries/plasma-wayland-protocols/-/commit/a77b52206eab268ce778c981175dac689505a5b0
Comment 10 Zamundaaa 2024-05-21 16:49:17 UTC
Git commit c4015a2085149ae58ca9f269641f28d175e6497e by Xaver Hugl.
Committed on 21/05/2024 at 15:43.
Pushed by zamundaaa into branch 'master'.

update to plasma window management v17

M  +1    -1    src/windowsystem/windowsystem.cpp

https://invent.kde.org/plasma/kwayland-integration/-/commit/c4015a2085149ae58ca9f269641f28d175e6497e
Comment 11 Zamundaaa 2024-05-21 16:50:17 UTC
Git commit b2bf7be7a7a23960da08cccabaf90749484a9f19 by Xaver Hugl.
Committed on 21/05/2024 at 15:49.
Pushed by zamundaaa into branch 'master'.

client: update plasma-window-management to v17

M  +57   -2    src/client/plasmawindowmanagement.cpp
M  +1    -1    src/client/registry.cpp

https://invent.kde.org/plasma/kwayland/-/commit/b2bf7be7a7a23960da08cccabaf90749484a9f19
Comment 12 Zamundaaa 2024-05-21 18:56:27 UTC
Git commit 3465ecac1685256b0862d5c4478756d2b5ca1c4f by Xaver Hugl.
Committed on 21/05/2024 at 15:48.
Pushed by zamundaaa into branch 'master'.

wayland: implement plasma window management v17

This fixes plasmashell crashing because of the stacking order string exceeding
the size of a Wayland message

M  +35   -3    src/wayland/plasmawindowmanagement.cpp

https://invent.kde.org/plasma/kwin/-/commit/3465ecac1685256b0862d5c4478756d2b5ca1c4f
Comment 13 Fushan Wen 2024-05-21 19:53:32 UTC
Git commit e65a6c29138751cdeb7298b9cd4f0520769e3712 by Fushan Wen, on behalf of Xaver Hugl.
Committed on 21/05/2024 at 19:34.
Pushed by fusionfuture into branch 'master'.

libtaskmanager: update org_kde_plasma_window_management to version 17

M  +46   -6    libtaskmanager/waylandtasksmodel.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/e65a6c29138751cdeb7298b9cd4f0520769e3712
Comment 14 Nate Graham 2024-05-24 00:42:36 UTC
*** Bug 487289 has been marked as a duplicate of this bug. ***
Comment 15 Askar Safin 2025-01-15 19:13:32 UTC
Was the fix ported to KDE 5? This is important for me, because I use Debian Stable (Bookworm), which uses KDE 5.

If not, please, port the fix to KDE 5.

The bug is reproducible on my system (I use kwin 5.27.5).

If you want, I can do more experiments, for example, I can install latest KDE 5 version and try there. But I have free time until (approx.) Jan 22, so if you want me to do experiments, please, tell me so until Jan 22
Comment 16 Nate Graham 2025-01-15 19:45:05 UTC
No, it's Plasma 6 only. It couldn't be backported easily due to complexity., If Debian folks want to take s tab at it, they should feel welcome to, though.

Please don't re-open bug reports marked as fixed to ask a question.