Compatibility between D-Bus and kdbus

Simon McVittie simon.mcvittie at collabora.co.uk
Thu Oct 23 08:31:02 PDT 2014


On 22/10/14 22:59, Philip Van Hoof wrote:
> Some explanation here: 
> https://git.gnome.org/browse/tracker/tree/src/tracker-store/tracker-resources.vala#n27

I
> 
think the issue you saw here is because the D-Bus Specification says
messages may not exceed 128 MiB (including headers), so DBusConnection
considers larger messages to be malformed at the protocol level,
whatever dbus-daemon might say at the application level. The
ridiculously large limit in session.conf really means "no limit from
configuration" (but it is finite, and < 1 GiB, so that it is far from
overflowing a signed int); MIN(configured limit,protocol limit) is
what actually applies.

It's a bug that libdbus allowed you to keep appending to the message
beyond this size: it should have reported an error before giving you
the chance to send the complete message. (Unfortunately, the
message-building API is such that the only error that it can report
here is "out of memory", which is not, strictly speaking, true.)

The fact that the sender of a malformed message is unceremoniously
disconnected without any opportunity to report a detailed error is a
long-standing design flaw. It's difficult to fix because boring
implementation details.

The fact that exit-on-disconnect is on by default, so "unceremoniously
disconnected" is equivalent to _exit(), is a design decision that I've
never been happy about either, and which exacerbates the previous one.
It was made long before I got involved, is part of the API whether I
like it or not, and I do understand the reasoning for it.

    S


More information about the dbus mailing list