Disconnected on every attempt to reply

P. Durante shackan at gmail.com
Tue Aug 9 00:24:44 EST 2005


Hi,
I'm having a hard time trying to figure out why I get disconnected
from the bus everytime I try to reply to a message, I'm using some
pure C++ bindings I wrote myself, and in order to investigate this
issue, I put together a small program which does nothing more than
sending back every message received, unchanged, here's the debug
output (I hope it's readable)

$ ./echo
dbus|registering interface org.emptyspace.echo
dbus|:1.13: adding filter
dbus|registering stubs for connection 0x8065ae8
dbus|adding watch 0x80657a8
dbus|adding watch 0x80657d0
dbus|adding timeout 0x8065fa8 with interval 25000
dbus|removing timeout 0x8065fa8
dbus|:1.13: added match rule destination=':1.13'
dbus|registering local object /org/emptyspace/echo
dbus|adding timeout 0x8065d90 with interval 25000
dbus|removing timeout 0x8065d90
dbus|:1.13: added match rule type='method_call',interface='org.emptyspace.echo'
dbus|:1.13: registering bus name org.emptyspace
dbus|adding timeout 0x8065d90 with interval 25000
dbus|removing timeout 0x8065d90
dbus|adding timeout 0x8065d90 with interval 25000
dbus|removing timeout 0x8065d90
dbus|:1.13: added match rule destination='org.emptyspace'
    |entering loop
    |1 descriptor ready
dbus|watch 0x80657d0 ready (R___)
dbus|dispatching on 0x8065ae8   <-- connection dispatch
dbus|got message from org.emptyspace for object /org/emptyspace/echo
<-- message filtered and sent to my C++ object
dbus|all dispatching done on 0x8065ae8 <-- dispatch status changed
<-- dbus_connection_send()
    |2 descriptors ready <-- from main loop
dbus|removing watch 0x80657d0
dbus|removing watch 0x80657a8 <-- removes both? WHY!?
dbus|some dispatching to do on 0x8065ae8 <-- dispatch status changed
dbus|watch 0x80657d0 ready (R_H_) <-- means POLLIN || POLLHUP
dbus|dispatching on 0x8065ae8 <-- dbus_connection_dispatch
dbus|0x8065ae8 disconnected by local bus
dbus|all dispatching done on 0x8065ae8

here you see, I get the message, craft a reply ( using nothing more
than dbus_message_new_return_message(original_message); ) and send it
back over the same connection I read it from, and after
dbus_connection_send, BANG! I'm out..
I can't recompile dbus with more verbosity since, if I do, neither
HAL, nor the dbus-utils won't work anymore (don't know why, seems the
ubuntu version was built with some arcane settings I can't figure
out), so my question is, what are the possible reasons for getting
disconnected ?

the source code is here
http://svn.berlios.de/viewcvs/bluetool/trunk/cbus/echo/
and the bindings are in the parent dir (the code is very unclean, sorry)

while for sending messages I just do
$ dbus-send --system --type=method_call --print-reply
--dest=org.emptyspace /org/emptyspace/echo org.emptyspace.echo.echo

and this is the configuration file
<policy context="default">
        <allow own="org.emptyspace"/>
        <allow send_destination="org.emptyspace.echo"/>
        <allow send_interface="org.emptyspace.echo"/>
        <allow receive_interface="org.emptyspace.echo"/>
        <allow receive_sender="org.emptyspace.echo"/>
        <allow send_path="/org/emptyspace/echo"/>
</policy>

(I allowed everything I could allow..)

thanks in advance,
Paul


More information about the dbus mailing list