dbus-gmain.c mem leak

David Zeuthen david at fubar.dk
Mon Apr 18 18:31:20 PDT 2005


On Mon, 2005-04-18 at 21:20 -0400, Havoc Pennington wrote:
> On Mon, 2005-04-18 at 20:27 -0400, David Zeuthen wrote:
> > 
> > Anyone got a clue what's happening before I investigate further? 
> > 
> 
> Haven't seen it. Valgrind definitely isn't helping much, just looks like
> the global main context or something, which is expected.

Right, only it keeps growing the longer the test case is running; maybe
valgrind is lying, maybe there's a bug in glib...  fun fun :-) I'll look
into it more deeply as I want to get this fixed because on a system
where there's a method call on hal roughly every second (where the
filter_function does the dbus_bus_get_unix_user() for that particular
method to check privileges) the leak gets pretty big in just a couple of
days. 

(another (post 1.0) feature is that libdbus probably should cache the
results of dbus_bus_get_unix_user() when invoked on unique names to
reduce traffic as I suspect it's a fairly common pattern to do the check
this from the method call handler)

> > Also, would it be useful to integrate this test into the dbus source
> > tree? If so, what is the best approach to integrate it?
> 
> I don't know how to do an automated leak check unit test with glib
> involved, since glib will allocate memory it never frees... the way
> you'd do it with only dbus involved would be to use
> _dbus_get_malloc_blocks_outstanding().

Yeah - unfortunately this isn't the case.

Cheers,
David




More information about the dbus mailing list