Bug 85108

Summary: dbus-daemon: syslog when we disconnect a peer
Product: dbus Reporter: Simon McVittie <smcv>
Component: coreAssignee: Simon McVittie <smcv>
Status: RESOLVED MOVED QA Contact: D-Bus Maintainers <dbus>
Severity: enhancement    
Priority: medium Keywords: patch
Version: git master   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Bug Depends on: 83625    
Bug Blocks:    
Attachments: DBusError: factor out _dbus_set_error_va
DBusTransport: record abnormal disconnections
DBusTransport, DBusConnection: make the disconnection error available
dbus-daemon: log abnormal disconnections
Add a test-case for dbus-daemon kicking the sender of a corrupt message
tests: link shared test executables explicitly to our libdbus-1.la
Add public API by which a service can tell why it got disconnected
Distinguish between local and remote disconnection

Description Simon McVittie 2014-10-16 19:32:01 UTC
Kicking a peer off the dbus-daemon ought to be an unusual circumstance, so we should probably log it.

The patches I'm about to attach will require the one from Bug #83625.
Comment 1 Simon McVittie 2014-10-16 19:32:22 UTC
Created attachment 107949 [details] [review]
DBusError: factor out _dbus_set_error_va
Comment 2 Simon McVittie 2014-10-16 19:32:38 UTC
Created attachment 107950 [details] [review]
DBusTransport: record abnormal disconnections

Normal disconnection is DBUS_ERROR_DISCONNECTED.
Comment 3 Simon McVittie 2014-10-16 19:32:50 UTC
Created attachment 107951 [details] [review]
DBusTransport, DBusConnection: make the disconnection  error available
Comment 4 Simon McVittie 2014-10-16 19:33:01 UTC
Created attachment 107952 [details] [review]
dbus-daemon: log abnormal disconnections
Comment 5 Simon McVittie 2014-10-16 19:33:30 UTC
Created attachment 107953 [details] [review]
Add a test-case for dbus-daemon kicking the sender of a  corrupt message

---

It isn't asserted, but this does print to stderr.
Comment 6 Simon McVittie 2014-10-16 19:34:21 UTC
Created attachment 107955 [details] [review]
tests: link shared test executables explicitly to our  libdbus-1.la

Otherwise they'll be linked to the system libdbus-1.so (via dbus-glib),
and that might be older than ours and contain less ABI.

---

Not really part of this bug, but working on this bug exposed this.

Alternatively, we could merge Bug #83115.
Comment 7 Simon McVittie 2014-10-16 19:35:45 UTC
Created attachment 107956 [details] [review]
Add public API by which a service can tell why it got  disconnected

This is not necessarily very informative because we don't communicate
error details across the stream before disconnecting the peer, so
one peer will have error details and the other will have
DBUS_ERROR_DISCONNECTED... but it's better than nothing!

---

This is mainly for peer-to-peer situations, because in the normal star topology, we assume that dbus-daemon will be Correctâ„¢ at all times. It might be useful to make it more visible if a recipient of Unix fds exceeds its fd limit, can't receive them, and responds by closing the connection, though.
Comment 8 Simon McVittie 2014-10-16 19:36:07 UTC
Created attachment 107957 [details]
Distinguish between local and remote disconnection

---

I'm in two minds about this one. Consider it optional.
Comment 9 GitLab Migration User 2018-10-12 21:21:43 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/dbus/dbus/issues/116.

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.