[PATCH]: talloc_pooled_object patchset

Jeremy Allison jra at samba.org
Mon Aug 26 15:27:24 MDT 2013


On Mon, Aug 26, 2013 at 08:34:24PM +0200, Stefan (metze) Metzmacher wrote:
> >>> On Thu, Aug 22, 2013 at 09:00:42PM -0700, Jeremy Allison wrote:
> > 
> > That's funny. That's exactly the patch I originally had,
> > but then I realized that doing free(pool) implicitly does
> > exactly TC_INVALIDATE_FULL_CHUNK(pool_tc) so I removed it
> > entirely in the interests of efficiency.
> > 
> > We don't do an explitic invalidation on other code inside
> > talloc that calls free(), so I removed it as a redundency.
> > 
> > However if you think it makes the patchset clearer I'm
> > happy to re-add it - it just doesn't make any difference
> > to the valgrind mapping changes.
> 
> TC_INVALIDATE_FULL_CHUNK() does
> TC_INVALIDATE_FULL_VALGRIND_CHUNK, but also
> TC_INVALIDATE_FULL_FILL_CHUNK.
> 
> For TC_INVALIDATE_FULL_VALGRIND_CHUNK you're right that would not be needed.

TC_INVALIDATE_FULL_FILL_CHUNK just doesn't work in conjunction
with TC_INVALIDATE_FULL_VALGRIND_CHUNK. When setting invalid
valgrind areas they can overlap - but when you try to use
the memset code in conjunction, the memset code gives
valgrind errors when it writes on an overlapped region.

I discovered this when doing deep debugging for Volker's
nested pools code.

IMHO we should probably just rip out the memset code
and just depend on valgrind.

Jeremy.


More information about the samba-technical mailing list