Created attachment 115043 [details] bzipped2 stderr.log While reviewing an issue reported by the dbus coverity scan it looks to be a reference counting issue in test-relay. The test application test-relay opens private connections to a local server and closes/unref them at the end of the test. Running the test with DBUS_VERBOSE=1 DBUS_CONNECTION_TRACE=1 test-relay 2> stderr.log ; grep trace_ref stderr.log shows at the end connection reference counts of 3 for all 4 present connections. 3132: [dbus/dbus-internals.c(511):_dbus_trace_ref] DBusConnection 0x143e680 4 -> 3 refs (unref) 3132: [dbus/dbus-internals.c(511):_dbus_trace_ref] DBusConnection 0x143fba0 4 -> 3 refs (unref) 3132: [dbus/dbus-internals.c(511):_dbus_trace_ref] DBusConnection 0x143ef60 4 -> 3 refs (unref) 3132: [dbus/dbus-internals.c(511):_dbus_trace_ref] DBusConnection 0x14404d0 4 -> 3 refs (unref) The documentation of dbus_connection_open_private mentiones to call dbus_connection_close() and dbus_connection_unref() to free the connection, which is done in the test-relay.
I wonder whether this would go away if we did dbus_connection_close (conn); while (Disconnected message not seen for conn) iterate main context; dbus_connection_unref (conn); ?
Created attachment 115057 [details] [review] Fix 'dbus connection referencing issue in test-relay'.
(In reply to Simon McVittie from comment #1) > I wonder whether this would go away if we did > > dbus_connection_close (conn); > > while (Disconnected message not seen for conn) > iterate main context; > > dbus_connection_unref (conn); > > ? The bug turned out to be an obviously shutdown problem.
Comment on attachment 115057 [details] [review] Fix 'dbus connection referencing issue in test-relay'. Review of attachment 115057 [details] [review]: ----------------------------------------------------------------- Makes sense, ++
Comment on attachment 115057 [details] [review] Fix 'dbus connection referencing issue in test-relay'. committed to dbus-1.8
(In reply to Ralf Habacker from comment #5) > committed to dbus-1.8 I wouldn't normally commit test fixes like this to dbus-1.8 unless they were blocking its releases (e.g. a test failing or not compiling at all), because it cannot affect library-user code - the goal with stable branches is to make the minimum changes necessary to go from "real-world use is broken" to "real-world use works as expected". But this change is small enough that I'm not going to revert it either.
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.