https://bugs.kde.org/show_bug.cgi?id=528667
Bug ID: 528667
Summary: ScreenCast dialog leaks eventfds on every open/cancel;
screen sharing hangs at 1024 open handles
Classification: Plasma
Product: xdg-desktop-portal-kde
Version First unspecified
Reported In:
Platform: openSUSE
OS: Other
Status: REPORTED
Severity: normal
Priority: NOR
Component: general
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Target Milestone: ---
Title: ScreenCast dialog leaks eventfds on every open/cancel; screen sharing
hangs at 1024 open handles
this is probably a duplicate looking at Bug 497424 but im not sure
Versions
- openSUSE Tumbleweed, kernel 7.3.0-1-default, Wayland session
- xdg-desktop-portal-kde6 6.8.1, Plasma/KWin 6.8.1
- Qt 6.12.0, KDE Frameworks 6.31.0
- xdg-desktop-portal 1.22.1, PipeWire 1.6.10, WirePlumber 0.5.18
- GPUs: AMD Radeon RX 6900 XT (Navi 21) and Radeon 610M (Raphael iGPU)
- Client: OBS Studio 32.2.2 (Flatpak), but any ScreenCast discord included does
it
Summary
Every time the ScreenCast selection dialog opens, whether the user picks a
source or cancels, xdg-desktop-portal-kde leaks eventfd file descriptors and
never frees them. The process has a default soft limit of 1024 open files
(RLIMIT_NOFILE). Once it reaches that limit, choosing a screen does nothing:
the dialog sits there and the client gets no stream and no error.
Steps to reproduce
1. Restart the portal: systemctl --user restart plasma-xdg-desktop-portal-kde
2. Watch its fd count: watch -n1 'ls /proc/$(pidof
/usr/libexec/xdg-desktop-portal-kde)/fd | wc -l'
3. From a ScreenCast client (for example, OBS → add Screen Capture (PipeWire)),
open the selection dialog and cancel it. Repeat several times.
Expected: the fd count goes back to its baseline after each dialog closes.
Actual: the count goes up with every dialog and never comes back down. just
from opening and cancelling the dialog. Almost all the leaked fds are eventfds:
$ ls -l /proc/<pid>/fd | awk '{print $NF}' | sort | uniq -c | sort -rn | head
-3
646 anon_inode:[eventfd]
9 socket:[N]
5 anon_inode:[eventpoll]
(Snapshot taken at 682 fds.)
When the count reaches about 1024, screen sharing breaks completely until the
portal restarts.
Relevant log output (journalctl --user -u plasma-xdg-desktop-portal-kde), shown
repeatedly while the dialog is open:
qrc:/qt/qml/org/kde/xdgdesktopportal/PipeWireDelegate.qml:305: TypeError:
Cannot read property 'itemName' of null
text: KI18n.i18nc("@title %1 refers to a screen name", "Share “%1”",
root.itemName)
and afterwards:
PipeWire remote error: -2 no global 339
PipeWire remote error: -116 no global 535 any more
The leak looks connected to the PipeWire preview thumbnails in the dialog
(PipeWireDelegate). Their streams or PipeWire contexts may not be destroyed
when the dialog closes, which would leave each preview's eventfds behind.
Related: in the same session, the PipeWire daemon also hit its 1024 limit
(mod.protocol-native: connection …: can't DUP fd:857 Too many open files), and
KWin then logged PipeWire remote error: can't create node: Too many open files.
The cause may be the same: preview streams that are never closed keep holding
buffers on the PipeWire side.
Workaround: restart plasma-xdg-desktop-portal-kde, or raise its limit with a
systemd drop-in (LimitNOFILE=524288).
--
You are receiving this mail because:
You are watching all bug changes.