The Samba-Bugzilla – Attachment 16296 Details for
Bug 14540
talloc_set_memlimit causes all reallocs to fail when used on pools.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Add additional debug text to memlimit tests
0001-Add-more-debugging-text-for-existing-memlimit-pool-t.patch (text/plain), 1.83 KB, created by
Arran Cudbard-Bell
on 2020-10-21 23:54:23 UTC
(
hide
)
Description:
Add additional debug text to memlimit tests
Filename:
MIME Type:
Creator:
Arran Cudbard-Bell
Created:
2020-10-21 23:54:23 UTC
Size:
1.83 KB
patch
obsolete
>From 8ceab8aa93994274d6bed6d07894eb66535079e7 Mon Sep 17 00:00:00 2001 >From: Arran Cudbard-Bell <a.cudbardb@freeradius.org> >Date: Tue, 20 Oct 2020 14:10:30 -0500 >Subject: [PATCH] Add more debugging text for existing memlimit + pool tests > >Signed-off-by: Arran Cudbard-Bell <a.cudbardb@freeradius.org> >--- > lib/talloc/testsuite.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > >diff --git a/lib/talloc/testsuite.c b/lib/talloc/testsuite.c >index 6c9bf203b7c..571c32ca00f 100644 >--- a/lib/talloc/testsuite.c >+++ b/lib/talloc/testsuite.c >@@ -1767,24 +1767,38 @@ static bool test_memlimit(void) > talloc_free(root); > > /* Test memlimits with pools. */ >+ printf("==== talloc_pool(NULL, 10*1024)\n"); > pool = talloc_pool(NULL, 10*1024); > torture_assert("memlimit", pool != NULL, > "failed: alloc should not fail due to memory limit\n"); >+ >+ printf("==== talloc_set_memlimit(pool, 10*1024)\n"); > talloc_set_memlimit(pool, 10*1024); > for (i = 0; i < 9; i++) { >+ printf("==== talloc_size(pool, 1024) %i/10\n", i + 1); > l1 = talloc_size(pool, 1024); > torture_assert("memlimit", l1 != NULL, > "failed: alloc should not fail due to memory limit\n"); >+ talloc_report_full(pool, stdout); > } > /* The next alloc should fail. */ >+ printf("==== talloc_size(pool, 1024) 10/10\n"); > l2 = talloc_size(pool, 1024); > torture_assert("memlimit", l2 == NULL, > "failed: alloc should fail due to memory limit\n"); > >+ talloc_report_full(pool, stdout); >+ > /* Moving one of the children shouldn't change the limit, > as it's still inside the pool. */ >+ >+ printf("==== talloc_new(NULL)\n"); > root = talloc_new(NULL); >+ >+ printf("==== talloc_steal(root, l1)\n"); > talloc_steal(root, l1); >+ >+ printf("==== talloc_size(pool, 1024)\n"); > l2 = talloc_size(pool, 1024); > torture_assert("memlimit", l2 == NULL, > "failed: alloc should fail due to memory limit\n"); >-- >2.28.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 14540
: 16296 |
16297
|
16298
|
16313
|
16314