[patch] do not segfault when D-Bus connection is reused

Havoc Pennington hp at redhat.com
Thu Aug 24 08:19:41 PDT 2006


Timo Hoenig wrote:
> The problem is that dbus_bus_get() now bumps the reference count twice
> while it is decremented only once -- by the applications themselves.

Can you explain more what the crash is? This sounds like a memory leak, 
not a crash?

> The attached patch makes dbus_bus_close() call
> _dbus_bus_check_connection_and_unref() which decrements the
> corresponding reference count of the hard reference.

I'd like to understand better why this has to be done synchronously and 
not only asynchronously when the Disconnected message is processed.

I'm guessing the problem is that dbus_bus_get returns an 
already-disconnected connection?

One thought is that doesn't seem avoidable in a threaded situation, so 
maybe it should not cause an error if it currently does...

Havoc



More information about the dbus mailing list