[PATCH] Remove all uses of talloc_autofree_context() from our code (except for test)

Andrew Bartlett abartlet at samba.org
Tue Jul 25 20:13:59 UTC 2017


On Tue, 2017-07-25 at 13:04 -0700, Jeremy Allison via samba-technical
wrote:
> On Tue, Jul 25, 2017 at 09:58:06PM +0200, Volker Lendecke wrote:
> > On Tue, Jul 25, 2017 at 12:37:24PM -0700, Jeremy Allison wrote:
> > > > Does "smbcontrol smbd pool-usage" still work after this change?
> > > 
> > > No. If we're not using the global null_context within
> > > talloc anymore, then pool usage doesn't have a central
> > > place to track all allocations off it.
> > 
> > That's tough. I definitely want pool-usage to be available everywhere
> > and always. When you need it, it's too late to activate it.
> 
> Having it available "everywhere and always" is inconsistent
> with the design criteria behind this patchset. For that you
> need a completely MT-safe talloc - you know it and I know it :-).
> 
> If you'd have mentioned that in the beginning then I wouldn't
> have spent literally *months* of work getting this done and
> cleaning up the code to this state.

It wasn't ever mentioned as a required casualty Jermey, Sorry.

I always assumed this work was about libsmbclient etc, making our
libraries not suck when used MT.

> talloc_autofree_context() is my 'nested event loops' :-). Having
> it in the code hides real bugs and complicates memory management
> by giving a lazy option everyone uses. It's how we ended up
> with the module initialization mess and other design problems.
> 
> Is there some compromise we can come to of starting smbd
> with a --track-pool usage parameter ?
> 
> If you've got a leak that can be reproduced then it's usually
> possible to recreate it with a restart of the smbd binary.

That works for fast leaks, but not slow ones.  

Sorry,

Andrew Bartlett
-- 
Andrew Bartlett                       http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba




More information about the samba-technical mailing list