ignoring a process' last words: SIGPIPE ...

Havoc Pennington hp at pobox.com
Thu Mar 27 07:01:20 PDT 2008


Hi,

It's a known thing, see also https://bugs.freedesktop.org/show_bug.cgi?id=896

What I said there was:

     I'm not sure honestly how to fix this one. You have to fully dispatch the
messages from a connection before you let that connection be shut down.

     We could try just popping each message off the connection and
dispatching it
at the top of bus_connection_disconnected(). Seems like it could create some
pretty scary reentrancy issues though.

     It'd be good to have test suite coverage for "connection
disconnecting while all
its messages have not been dispatched"


A workaround if dbus-send is calling a method would be to block for
the method reply before exiting.

I don't think just ignoring EPIPE would fix, since the bug is broader
than that; it happens if the connection is lost for any reason before
all messages are read from it.

There is a related bug that we fail to know the credentials of the
connection if it's already closed, so can't correctly process the
messages even if the daemon were changed to dispatch them.

Anyway, I think the daemon requires some hacking to basically keep
credentials and remaining incoming messages around even though the
connection is closed. I don't know if this will be easy or involve
some challenges. I would start by adding a case to the daemon test
suite (which is mostly stuffed in bus/dispatch.c) illustrating the
problem.

Havoc


More information about the dbus mailing list