talloc: talloc_set_memlimit causes all reallocs to fail when used on pools. talloc_set_memlimit not enforced correctly on pools.

Jeremy Allison jra at samba.org
Tue Oct 20 18:24:42 UTC 2020


On Tue, Oct 20, 2020 at 01:03:14PM -0500, Arran Cudbard-Bell wrote:
> 
> OK.  That patch seems to mostly work but there are a few
> issues.
> 
> First is an easy one. After a realloc failure due to hitting the
> memlimit, the chunk remains marked as free, so when a
> report gets run later in the test suite, we get a use-after-free
> error.

Thanks for catching that. New version attached
with your changes squashed (but moved to before
we set errno, always do that last :-).

> Then there's another issue with object_count ending
> up off by one, which means talloc_free_children doesn't
> actually return memory to the pool, and that messes up
> some of the other tests I'm adding.  Just tracking down
> when and why this happens now.... It might have been a
> pre-existing issue and not related to this patch, I'm just
> seeing it because of using talloc_free_children to reset
> the pool between some tests.

OK, that I don't understand. I'll wait for your analysis...

Jeremy.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-memlimit-on-pool-realloc.patch
Type: text/x-diff
Size: 3711 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20201020/47c4ebbe/0001-Fix-memlimit-on-pool-realloc.diff>


More information about the samba-technical mailing list