How are stopped apps handled

Simon McVittie simon.mcvittie at collabora.co.uk
Thu Feb 5 09:06:03 PST 2015


On 05/02/15 16:14, Alberto Mardegan wrote:
> Hi all!
>    Just a quick question: if a D-Bus client gets SIGSTOPed, and another
> client keeps sending messages to it over the session bus, what would happen?

I think it's exactly the same as if the client stopped reading from its 
socket from any other reason: the in-kernel buffer fills up, then the 
messages start accumulating in the dbus-daemon (because it gets EAGAIN 
on writes / does not get POLLOUT on poll()).

If the dbus-daemon's outgoing queue limit is finite, eventually it will 
fill up, in which case unicast messages to the stopped client get an 
error reply from the dbus-daemon, and broadcasts that should go to the 
stopped client are silently dropped on the floor (but a copy of the same 
broadcast is still delivered to any other client interested in it). 
However, by default the session bus is not treated as any sort of 
security boundary, so it has an arbitrarily large outgoing queue limit 
(~ 1 gigabyte).

https://bugs.freedesktop.org/show_bug.cgi?id=33606 has more on this 
general topic.

If you think this behaviour is unacceptable, properly-researched 
solutions are welcome. For Linux, the long-term solution is probably kdbus.

     S

-- 
Simon McVittie
Collabora Ltd. <http://www.collabora.com/>



More information about the dbus mailing list