D-Bus session bus is strangely closing my connection

Kristoffer Lundén kristoffer.lunden at gmail.com
Sat Mar 17 21:49:45 PDT 2007


Hello list,

I have a weird weird problem that I don't understand, and maybe just
maybe someone here can shed some light. :)

I've mentioned earlier that I'm writing a Ruby implementation of
D-Bus, that I call R-Bus. It's shaping up nicely and I've been writing
small example applications to exercise the library and shake out bugs.
Here's the thing: I have programs that can talk to HAL, Rhythmbox, and
NetworkManager, and they all work. But then I've tried to convert a
Python program that displays a Notification bubble, and here's the odd
trouble...

Both programs make this exact call in Python/Ruby:

  notifications.Notify('HelloWorld',0,'','Summary','Body',[],{},-1)

The Python program works, while mine just hangs. After I couldn't find
anything else wrong, I used strace to monitor both programs, and also
the session bus while it received the calls. The calls are identical,
byte for byte, with the small difference that the Python program uses
writev and Ruby uses write. In the strace for the session bus, they
look exactly the same when received, but while it forwards the Python
request, it simply closes my connection...?

Strace logs at end of message.

Since other programs work, and for that matter AUTH, Hello() and
Introspect() with notifications, I'm utterly stumped as to what could
be the matter. It's 100% reproducible.

Now, I know that this is probably just too much black magic to have
any chance of anyone knowing what's going on, but I wanted to ask
anyways. :)

Any clues at all? I'm not that good at low-level socket stuff, so I
could use just about any pointer. :)

Thanks.

-- Kristoffer


# Python program straced:
writev(3, [{"l\1\0\1D\0\0\0\3\0\0\0\233\0\0\0\1\1o\0\36\0\0\0/org/freedesktop/Notifications\0\0\2\1s\0\35\0\0\0org.freedesktop.Notifications\0\0\0\3\1s\0\6\0\0\0Notify\0\0\6\1s\0\35\0\0\0org.freedesktop.Notifications\0\0\0\10\1g\0\rsusssasa{sv}i\0\0\0\0\0\0",
176}, {"\n\0\0\0HelloWorld\0\0\0\0\0\0\0\0\0\0\0\0\0\0\7\0\0\0Summary\0\4\0\0\0Body\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377",
68}], 2) = 244

# Ruby program straced:
write(3, "l\1\0\1D\0\0\0\6\0\0\0\233\0\0\0\1\1o\0\36\0\0\0/org/freedesktop/Notifications\0\0\2\1s\0\35\0\0\0org.freedesktop.Notifications\0\0\0\3\1s\0\6\0\0\0Notify\0\0\6\1s\0\35\0\0\0org.freedesktop.Notifications\0\0\0\10\1g\0\rsusssasa{sv}i\0\0\0\0\0\0\n\0\0\0HelloWorld\0\0\0\0\0\0\0\0\0\0\0\0\0\0\7\0\0\0Summary\0\4\0\0\0Body\0\0\0\0\0\0\0\0\4\0\0\0\0\0\0\0\377\377\377\377",
244) = 244

# Session bus straced with Python:
read(25, "l\1\0\1D\0\0\0\3\0\0\0\233\0\0\0\1\1o\0\36\0\0\0/org/freedesktop/Notifications\0\0\2\1s\0\35\0\0\0org.freedesktop.Notifications\0\0\0\3\1s\0\6\0\0\0Notify\0\0\6\1s\0\35\0\0\0org.freedesktop.Notifications\0\0\0\10\1g\0\rsusssasa{sv}i\0\0\0\0\0\0\n\0\0\0HelloWorld\0\0\0\0\0\0\0\0\0\0\0\0\0\0\7\0\0\0Summary\0\4\0\0\0Body\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377",
2048) = 244
read(25, 0x80bf358, 2048)               = -1 EAGAIN (Resource
temporarily unavailable)
gettimeofday({1174191869, 112151}, NULL) = 0
writev(19, [{"l\1\0\1D\0\0\0\3\0\0\0\257\0\0\0\1\1o\0\36\0\0\0/org/freedesktop/Notifications\0\0\2\1s\0\35\0\0\0org.freedesktop.Notifications\0\0\0\3\1s\0\6\0\0\0Notify\0\0\6\1s\0\35\0\0\0org.freedesktop.Notifications\0\0\0\10\1g\0\rsusssasa{sv}i\0\0\0\0\0\0\7\1s\0\6\0\0\0:1.127\0\0",
192}, {"\n\0\0\0HelloWorld\0\0\0\0\0\0\0\0\0\0\0\0\0\0\7\0\0\0Summary\0\4\0\0\0Body\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377",
68}], 2) = 260

# Session bus straced with Ruby:
read(25, "l\1\0\1D\0\0\0\6\0\0\0\233\0\0\0\1\1o\0\36\0\0\0/org/freedesktop/Notifications\0\0\2\1s\0\35\0\0\0org.freedesktop.Notifications\0\0\0\3\1s\0\6\0\0\0Notify\0\0\6\1s\0\35\0\0\0org.freedesktop.Notifications\0\0\0\10\1g\0\rsusssasa{sv}i\0\0\0\0\0\0\n\0\0\0HelloWorld\0\0\0\0\0\0\0\0\0\0\0\0\0\0\7\0\0\0Summary\0\4\0\0\0Body\0\0\0\0\0\0\0\0\4\0\0\0\0\0\0\0\377\377\377\377",
2048) = 244
close(25)


-- 
Kristoffer Lundén
✉ kristoffer.lunden at gmail.comkristoffer.lunden at gamemaker.nu
http://www.gamemaker.nu/
☎ 0704 48 98 77


More information about the dbus mailing list