Endianness issues with systemd <-> dbus communication

Fridrich Strba fridrich.strba at suse.com
Wed Mar 12 04:55:30 PDT 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10/03/14 21:06, Lennart Poettering wrote:
> No. And I figure that you have to figure it out, as nobody else has
> a s390x around... Sorry...

The problem seems to start with the exit of the systemd-logind out
from the systemd-logind.service. The NameAcquired is answered with
NameOwnerChanged ... at least on x86_64. On s390x this fails and then
the dbus-daemon will always ask with signal NameAcquired on every
access to the system bus.

Something leads there systemd-login to exit with EIO.

The working hypothesis we have (and might be complete crack smoking) is:

Systemd connects to dbus-daemon. The first message it sends is Hello,
with a cookie of 1.

dbus-daemon will assign a unique name, like "1.0" to the connection.
It sends back a METHOD_RETURN message indicating success (cookie 1),
followed by a NameAcquired signal (cookie 2).

Next, systemd will try to grab its bus name by calling RequestName
with a name of "org.freedesktop.systemd1". This message will use a
cookie of 2.

Then, in sd_bus_call, we block a moment waiting for data to arrive.
When the next message hits our queue, it will be the NameAcquired
signal with a cookie of 2. Note, this matches the cookie we were
looking for, hence we execute this:

if (incoming->reply_cookie == cookie) {
        /* Found a match! */

        memmove(bus->rqueue + i, bus->rqueue + i + 1,
           sizeof(sd_bus_message*) * (bus->rqueue_size - i - 1));
        bus->rqueue_size--;

        if (incoming->header->type == SD_BUS_MESSAGE_METHOD_RETURN) {

                if (reply)
                        *reply = incoming;
                else
                        sd_bus_message_unref(incoming);

                return 1;
        } else if (incoming->header->type == SD_BUS_MESSAGE_METHOD_ERROR)
                r = sd_bus_error_copy(error, &incoming->error);
        else
                r = -EIO;
...
}

Not sure whether this analysis is correct one. If it were, this would
be more of a timing then endian issue. But why this happens only on s390x?

The major difference between x86_64 and s390x seems to be the start
order. On x86_64 the systemd-logind is installed and started before
dbus while on s390x the systemd-logind is started after dbus.

Any hints what could one try to check?

Fridrich


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEUEARECAAYFAlMgSzIACgkQu9a1imXPdA9BZwCfWO3UBgvbGjxZT9CG5SZzB84s
HdgAl2jKoipuvRBGghLVGbd7OXL1RcM=
=/is+
-----END PGP SIGNATURE-----


More information about the dbus mailing list