I send ping: $ dbus-send --dest=org.gnome.Nautilus /org/gnome/Nautilus org.freedesktop.DBus.Peer.Ping Consequently dbus-monitor exited: $ dbus-monitor ... method call time=1434089074.492372 sender=:1.1 -> destination=org.gnome.Nautilus serial=7 path=/org/gnome/Nautilus; interface=org.freedesktop.Application; member=Open array [ string "file:///" ] array [ ] signal time=1434089074.523564 sender=(null sender) -> destination=(null destination) serial=0 path=/org/freedesktop/DBus/Local; interface=org.freedesktop.DBus.Local; member=Disconnected Because dbus-daemon close it: $ DBUS_VERBOSE=1 dbus-daemon --session ... Connection :1.0 (uid=1000 pid=14507 comm="dbus-monitor ") became a monitor. Activating service name='org.gnome.Nautilus' Monitoring connection :1.0 (uid=1000 pid=14507 comm="dbus-monitor ") is not allowed to send messages; closing it. Please fix the monitor to not do that. (message type="method_return" interface="(unset)" member="(unset)" error name="(unset)" destination=":1.1") Monitoring connection :1.0 closed. But I suppose it shouldn't be closed...
This seems very likely to be a regression in 1.9.x. dbus-monitor should turn off the part of libdbus that "helpfully" handles Peer messages automatically.
Calling dbus_connection_set_route_peer_messages (conn, TRUE) in dbus-monitor is probably enough. That stops it from trying to reply to any Peer message that has a destination; and dbus-daemon should never send us a Peer message not fitting that description.
Created attachment 116916 [details] [review] dbus-monitor: disable automatic handling of o.fd.Peer messages A normal DBusConnection will automatically reply to o.fd.Peer messages such as Ping. We don't want this: if we are using traditional eavesdropping with an older dbus-daemon, we'll confuse everyone else by replying to messages that weren't intended for us. If we are using the new Monitoring interface (since 1.9.12), the same still applies, but in addition, the dbus-daemon will disconnect us for not being a well-behaved monitor.
Created attachment 116917 [details] [review] Add test-case to confirm that dbus_connection_set_route_peer_messages() is enough
Comment on attachment 116916 [details] [review] dbus-monitor: disable automatic handling of o.fd.Peer messages Review of attachment 116916 [details] [review]: ----------------------------------------------------------------- ++
Comment on attachment 116917 [details] [review] Add test-case to confirm that dbus_connection_set_route_peer_messages() is enough Review of attachment 116917 [details] [review]: ----------------------------------------------------------------- ++, although the commit summary is a bit opaque if you haven’t read the bug.
(In reply to Philip Withnall from comment #6) > ++, although the commit summary is a bit opaque if you haven’t read the bug. Re-worded it and pushed. Fixed in git for 1.9.18 and 1.8.20.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.