https://bugs.kde.org/show_bug.cgi?id=522645
Bug ID: 522645
Summary: xdg-desktop-portal-kde deadlocks after a RemoteDesktop
client exits without Session.Close; all subsequent
CreateSession requests time out
Classification: Plasma
Product: xdg-desktop-portal-kde
Version First 6.6.5
Reported In:
Platform: Gentoo Packages
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: general
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Target Milestone: ---
Created attachment 194024
--> https://bugs.kde.org/attachment.cgi?id=194024&action=edit
gdb -p $(pgrep -f xdg-desktop-portal-kde) -batch -ex "thread apply all bt"
SUMMARY
After a RemoteDesktop+ScreenCast portal session ends by the client process
exiting (its D-Bus connection drops) without an explicit
org.freedesktop.portal.Session.Close call, xdg-desktop-portal-kde becomes
permanently unresponsive: every subsequent CreateSession request (from any
application) returns the Request object path but never emits the Response
signal. Only restarting the portal daemons (or rebooting) recovers it.
STEPS TO REPRODUCE
1. Create a combined RemoteDesktop session via the portal:
RemoteDesktop.CreateSession -> RemoteDesktop.SelectDevices (persist_mode=2)
-> ScreenCast.SelectSources on the same session ->
Clipboard.RequestClipboard
-> RemoteDesktop.Start (with a valid restore_token, so no dialog is shown).
2. Use the session normally (PipeWire screencast stream + ConnectToEIS input).
3. Terminate the client process without calling Session.Close (plain exit;
the session should be cleaned up when the D-Bus connection closes).
4. Start the same (or any other) portal client and call
RemoteDesktop.CreateSession or ScreenCast.CreateSession again.
OBSERVED RESULT
The CreateSession method call itself succeeds (returns the request handle),
but the Response signal on the Request object never arrives; clients time
out. Calling the backend directly also hangs forever, e.g.:
gdbus call --session --dest org.freedesktop.impl.portal.desktop.kde \
--object-path /org/freedesktop/portal/desktop \
--method org.freedesktop.impl.portal.ScreenCast.CreateSession \
/org/freedesktop/impl/portal/request/probe \
/org/freedesktop/impl/portal/session/probe "app.probe" "{}"
never returns (the same for org.freedesktop.impl.portal.RemoteDesktop).
org.freedesktop.DBus.Peer.Ping on the backend still responds, and the
xdg-desktop-portal frontend keeps answering property reads, so both
processes are alive - the backend just never processes new sessions.
The deadlock persists until xdg-desktop-portal-kde and xdg-desktop-portal
are restarted (or the machine is rebooted).
EXPECTED RESULT
When the requesting client disappears from the bus, the portal should tear
the session down and stay functional; the next CreateSession should work.
(Adding an explicit Session.Close before exiting in our application avoids
the problem, which confirms the unclean-disconnect teardown path is what
wedges the backend.)
ADDITIONAL INFORMATION
- The first session after the portal starts always works (permissions are
restored from a restore_token with no dialog); only the unclean end of
that session triggers the deadlock, 100% reproducible.
- The session used devices=KEYBOARD|POINTER, one MONITOR source, clipboard
integration enabled, an active EIS connection (libei) and an active
PipeWire stream at the time the client exited.
SOFTWARE/OS VERSIONS
Linux: Gentoo Linux (kernel: 7.1.2-gentoo-r1-x86_64)
KDE Plasma Version: 6.6.5 (kwin_wayland, Wayland session)
xdg-desktop-portal: 1.20.4
PipeWire: 1.6.4
Packages:
kde-frameworks/kwindowsystem-6.25.0
kde-plasma/kwin-x11-6.6.5
kde-plasma/kwin-6.6.5-r1
kde-plasma/plasma-workspace-wallpapers-6.6.5
kde-plasma/plasma-workspace-6.6.5-r1
kde-plasma/xdg-desktop-portal-kde-6.6.5-r1
sys-apps/xdg-desktop-portal-gtk-1.15.3
sys-apps/xdg-desktop-portal-1.20.4-r1
--
You are receiving this mail because:
You are watching all bug changes.