Connection dropped with extended ascii strings

Havoc Pennington hp at pobox.com
Thu Dec 11 06:03:54 PST 2008


Hi,

On Thu, Dec 11, 2008 at 5:34 AM, Per Inge Mathisen
<per.inge.mathisen at sonowand.com> wrote:
> On Wed, 2008-12-10 at 12:10 -0500, Havoc Pennington wrote:
>> See also https://bugs.freedesktop.org/show_bug.cgi?id=16338
>
> The idea of a library calling _exit() on behalf of an application just
> like that is really, really horrible. But that does not seem to be the
> case any more, though? At least that does not seem to happen here.
> However, I have noticed a similar effect when running dbus_shutdown(),
> although I fail to see why from the code itself. In what other places in
> the dbus code can this happen?

Comment #1 https://bugs.freedesktop.org/show_bug.cgi?id=16338#c1
explains in some detail.

As does http://lists.freedesktop.org/archives/dbus/2007-November/008975.html
on the fix.

dbus_shutdown discussed in comment #1 here:
https://bugs.freedesktop.org/show_bug.cgi?id=16924#c1

The docs explain exactly when it calls exit (on disconnect) and how to
turn it off; if you didn't read those docs, then you would not have
read the docs explaining that you *must* exit on disconnect in the
normal case, which just proves that we have the right *default* to
exit on disconnect - unless the app installs an alternative disconnect
handler. The way we have it, the right thing for the 99% case is done
by default, and you have the ability to disable it if you read the
docs.

Disconnecting on not-well-formed data (such as bad UTF-8) should not
be a surprise - http servers and imap servers and the like would
typically do something similar. A daemon is not going to let you stay
connected if you start sending suspicious-looking garbage that might
crash somebody. (Which invalid utf8 is.)

Havoc


More information about the dbus mailing list