Memory leak in dbus / dbus-c++ ?

Havoc Pennington hp at redhat.com
Tue Jul 31 08:13:02 PDT 2007



Thiago Macieira wrote:
> Olivier Hochreutiner wrote:
>> I used BoundChecker to detect where the memory that is not freed in
>> allocated. It reports three places in the code (see attached file). I
>> investigated the problem a bit and it seems that reply messages are
>> not freed ?
> 
> DBusMessage memory blocks are recycled for reuse internally. That 
> shouldn't count as memory leaks, because there are still pointers to the 
> blocks.
> 
> However, they would be memory leaks if the binding doesn't properly call 
> dbus_message_unref.

The way to tell the difference is, does memory continuously rise or just 
rise to a certain point?

Olivier, the leak is probably not in libdbus because the test suite 
pretty extensively checks for leaks. Of course it doesn't 100% 
comprehensively check, so a bug is still possible.

I would look in the bindings first though for a missing unref.

Havoc



More information about the dbus mailing list