[Samba] Samba memory usage - how big is it?

Volker Lendecke Volker.Lendecke at SerNet.DE
Thu Nov 13 15:03:34 GMT 2008


On Thu, Nov 13, 2008 at 02:24:46PM +0100, Martin Zielinski wrote:
> Hi Volker, all!
> 
> Yesterday I reported a memleak in the smbd on the technical mailing list 
> with an attached pool-usage dump.
> 
> I still do not fully understand the talloc system nor the memcache 
> functions, but as we currently have your attention on this topic :-)
> 
> samba-3.2.4 - passdb/pdb_interface.c - pdb_getsampwnam()
> 
> Quick shot from the hip:
> 
> If the memcache_add_talloc () reuses the existing record - the previous 
> record (which is a pointer to talloced() data) is not being destroyed.
> 
> Nonsense, or leak?

Looks like a leak. I have to revisit that code, in
particular as it has changed significantly in master.

> P.S. There are several situations in the code, where the allocated samu 
> structs are not destroyed in case of an error. But I'm still after it.

If they are allocated from a temporary talloc context, the
idea at least is that freeing that talloc context also frees
the samu structure. If that is not the case, we have a bug
in talloc.

Volker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba/attachments/20081113/180b0e89/attachment.bin


More information about the samba mailing list