talloc-2.1.12 issues with library destructor

Stefan Metzmacher metze at samba.org
Tue Apr 3 11:43:12 UTC 2018


Hi Lukas,

> So if I understand correctly then cannot cause any problem in samba
> and thus fixing https://bugzilla.samba.org/show_bug.cgi?id=7587
> was not necessary.
> 
> And as it was mention in this thread, using destructor in talloc is much worse
> then using atexit (which caused issues just on FreeBSD when used in shared
> libraries)
> 
> 
> What do you think about reverting 41b6810ba01f44537f470c806adb8686e1a39c48
> and changing documentation for the function talloc_autofree_context that
> it is recommended to used just in daemons and not in shared libraries?
> 
> IMHO, the intention mentioned in doc-comment for talloc_autofree_context
> still make a sense:
> 
> """
>  * This is a handy utility function that returns a talloc context
>  * which will be automatically freed on program exit. This can be used
>  * to reduce the noise in memory leak reports.
> """
> 
> And it works well if it is used in daemon an not in shared library
> (because atexit would be executed just once).

I'm working on something similar, I'll post patches shortly.

I think bug #7587 can already be closed as Samba doesn't use
talloc_autofree_context() anymore.

metze


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20180403/00cf5aaa/signature.sig>


More information about the samba-technical mailing list