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

Arran Cudbard-Bell a.cudbardb at freeradius.org
Tue Oct 20 19:50:05 UTC 2020



> On Oct 20, 2020, at 2:16 PM, Jeremy Allison <jra at samba.org> wrote:
> 
> On Tue, Oct 20, 2020 at 01:42:00PM -0500, Arran Cudbard-Bell wrote:
>> 
>> 
>>> On Oct 20, 2020, at 1:33 PM, Jeremy Allison <jra at samba.org> wrote:
>>> 
>>> On Tue, Oct 20, 2020 at 01:03:14PM -0500, Arran Cudbard-Bell wrote:
>>>> 
>>>> 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.
>> 
>> Apologies, there was a steal I didn't spot in the tests.
>> One of the chunks was moved out of the pool into the root ctx.
>> 
>> Explicitly freeing the chunk or stealing it back into the pool
>> means talloc_free_children works as expected.
> 
> FYI, once you've gotten everything working can you
> send your test cases to me so I can add them into
> the regression test suite for talloc ?

Attached.

> Then we'll add a new bug in bugzilla, update the minor library
> version number and create a gitlab MR.

Sounds good, thanks!

-Arran


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-more-debugging-text-for-existing-memlimit-pool-t.patch
Type: application/octet-stream
Size: 1876 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20201020/dc4b7e1c/0001-Add-more-debugging-text-for-existing-memlimit-pool-t.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-More-tests-for-realloc-when-used-with-memlimited-poo.patch
Type: application/octet-stream
Size: 4404 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20201020/dc4b7e1c/0002-More-tests-for-realloc-when-used-with-memlimited-poo.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Add-note-on-memlimit-and-pools.patch
Type: application/octet-stream
Size: 1015 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20201020/dc4b7e1c/0003-Add-note-on-memlimit-and-pools.obj>


More information about the samba-technical mailing list