dbus_connection_open not returning shared connections if the address does not include "guid"
Submitted by missa
Assigned to D-Bus Maintainers
Created attachment 121657 dbus-test.c
It seems dbus_connection_open() is not returning shared connections. It is not clear if there is some miss configuration or some bug.
The issue can be seen easily. Every call to dbus_connection_open() returns a different pointer and refcount of 2 (1 for application and 1 for libdbus).
After some time the system is crashing because the connections are maxed out. There are dbus_connection_unref() calls but this doesn't free the shared connections and since we are getting a new connection every time, it is easy to max them out. We checked the resources usage and the number of FDs, sockets and memory increase with every call.
After some investigation, dbus_bus_get() seems to always return the same pointer with refcount incremented as expected. FDs, sockets, memory seem not impacted.
Attached is a simple program tested on x86 ubuntu that shows this behavior.
Attachment 121657, "dbus-test.c":