Bug 1696961 - Plasmashell eats up open file descriptors on X server until maximum reached
Summary: Plasmashell eats up open file descriptors on X server until maximum reached
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: plasma-workspace
Version: 29
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: KDE SIG
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-04-06 16:37 UTC by Juha Nikkanen
Modified: 2019-06-01 08:25 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-06-01 08:25:41 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
dmesg-5.0.5-200.fc29.x86_64 (91.49 KB, text/plain)
2019-04-06 16:37 UTC, Juha Nikkanen
no flags Details
lspci-v (19.55 KB, text/plain)
2019-04-06 16:38 UTC, Juha Nikkanen
no flags Details

Description Juha Nikkanen 2019-04-06 16:37:32 UTC
Created attachment 1552941 [details]
dmesg-5.0.5-200.fc29.x86_64

Description of problem:
After longish use of KDE Plasma session, Xorg server runs out of an anonymous file handles (a count of 1024 by default). I.e. /proc/`pidof Xorg`/fd fills up entries like:
...
lrwx------. 1 root root 64 Apr  6 10:55 95 -> '/memfd:xshmfence (deleted)'
lrwx------. 1 root root 64 Apr  6 13:18 96 -> '/memfd:xshmfence (deleted)'
lrwx------. 1 root root 64 Apr  6 10:55 97 -> '/memfd:xshmfence (deleted)'
lrwx------. 1 root root 64 Apr  6 10:55 98 -> '/memfd:xshmfence (deleted)'
lrwx------. 1 root root 64 Apr  6 10:55 99 -> '/memfd:xshmfence (deleted)'
...
And when Xorg has run out of system file limit, random problems start to appear:
- key bindings may lost and/or have no desired effect
- mouse clicks / drags have no effect
- $HOME/.cache corrupts somehow

Version-Release number of selected component(s):
kernel-5.0.5-200.fc29.x86_64
xorg-x11-drv-amdgpu 19.0.0
plasma-workspace 5.14.5
mesa 18.3.5

How reproducible:
always

Steps to Reproduce:
1. login to Plasma session
2. open dozens of appications so that Task Manager starts grouping task instances
3. observe content of /proc/`pidof Xorg`/fd by commands ls and wc
4. induce creation of memfd:xshmfence fds by hovering on panel (Task Manager), over group of open tasks so that Task Manager shows thumbnails of windows of open applications. This step will increase fds by number of window thumbnails of hovered group
5. repeat from 3. until system file limit is hit

Actual results:
see above

Expected results:
plasmashell shall release rendering related memory stuff right after use

Additional info:
Hovering on Pager or on System Tray in a such way that popup window appears does not consume an anonymous file handles on X server permanently. Only via Task Manager does.

Comment 1 Juha Nikkanen 2019-04-06 16:38:48 UTC
Created attachment 1552942 [details]
lspci-v

Comment 2 Rex Dieter 2019-04-06 21:40:28 UTC
I encourage you to report this upstream at bugs.kde.org, particularly if you have an easy way to reproduce it.

Comment 3 Juha Nikkanen 2019-04-07 15:43:29 UTC
Rex,

thanks for the suggestion. I reported and slightly edited to add clarifications here and there:
https://bugs.kde.org/show_bug.cgi?id=406303

Comment 4 Juha Nikkanen 2019-06-01 08:25:41 UTC
Plasma update 5.57.0-2.fc29 fixed this issue, it contains patch:
https://phabricator.kde.org/D20805


Note You need to log in before you can comment on or make changes to this bug.