#1101799 xdg-desktop-portal: ends up in endless loop

Package:
xdg-desktop-portal
Source:
xdg-desktop-portal
Description:
desktop integration portal for Flatpak and Snap
Submitter:
Matthias Urlichs
Date:
2025-04-08 11:03:04 UTC
Severity:
normal
#1101799#5
Date:
2025-04-01 06:06:11 UTC
From:
To:
On my desktop x-d-p ends up busy-looping and replying too slowly or
(eventually) not at all after a day or two.

A restart (kill -9) fixes the problem (temporarily).

strace did not yield anything useful.

I'll try to get a core dump and/or attach gdb the next time this happens.

#1101799#10
Date:
2025-04-01 11:56:09 UTC
From:
To:
Please include what exact desktop environment you are using. What
xdg-desktop-portal-* packages do you have installed?
(xdg-desktop-portal-gtk, xdg-desktop-portal-lxde, etc.)

Thank you,
Jeremy Bícha

#1101799#15
Date:
2025-04-08 10:22:48 UTC
From:
To:
I'm using the sway window manager, portals for -wlr and -gtk are
installed and running.

Possibly of note is that my neovim session is set to auto-darkmode
itself, thus it calls

dbus-send --session --print-reply=literal --reply-timeout=1000
--dest=org.freedesktop.portal.Desktop /org/freedesktop/portal/desktop 
org.freedesktop.portal.Settings.Read string:'org.freedesktop.appearance'
string:'color-scheme'

a couple of times per second (notionally every three seconds, but I have
too many editor windows open).

Watching the process after restarting it, with ps, shows a slow increase
in memory use and CPU time (started off at 9%, now at 13% after half an
hour or so). So my current suspicion is that there's some request queue
in there that doesn't get cleaned up properly, and as soon as that queue
is long enough for CPU to reach 100% all hell breaks loose.

To verify that I started to hammer it with those dbus requests, which
made the process's CPU load creep up much faster (about 1% per minute).
The point is that after stopping these dbus-send loops the CPU time of
"xdg-desktop-portal" does *not* go back down, instead it continues its
slow creep towards 100%.