-
Notifications
You must be signed in to change notification settings - Fork 700
fix(nbdkit): disable malloc-debug checking #18705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 4.0
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
| From: Tobias Brick <tobiasb@microsoft.com> | ||
| Date: Thu, 3 Sep 2026 20:17:00 +0000 | ||
| Subject: [PATCH] tests: disable glibc malloc check | ||
|
|
||
| The glibc malloc-debug checker interposes allocation APIs through | ||
| libc_malloc_debug.so.0. SymCrypt has unversioned allocator references that | ||
| can bind aligned_alloc to libc while binding free to the debug allocator, | ||
| causing OpenSSL consumers to abort during provider initialization. | ||
|
|
||
| Keep malloc perturbation enabled with values in glibc's valid 1-255 range | ||
| to retain detection of uninitialized and use-after-free behavior without | ||
| enabling the incompatible checked allocator. | ||
| --- | ||
| tests/Makefile.am | 11 ++++------- | ||
| 1 file changed, 4 insertions(+), 7 deletions(-) | ||
|
|
||
| diff --git a/tests/Makefile.am b/tests/Makefile.am | ||
| index 3af137f..cf49212 100644 | ||
| --- a/tests/Makefile.am | ||
| +++ b/tests/Makefile.am | ||
| @@ -69,18 +69,15 @@ TESTS_ENVIRONMENT = \ | ||
| LIBNBD_DEBUG=1 \ | ||
| $(NULL) | ||
|
|
||
| -# Enable malloc-check as a cheap way to find some use-after-free and | ||
| -# uninitialized read problems when using glibc, and doesn't affect | ||
| -# normal operation or other libc. | ||
| +# Perturb allocated and freed memory as a cheap way to find some | ||
| +# use-after-free and uninitialized read problems. | ||
| -random = $(shell bash -c 'echo $$(( 1 + (RANDOM & 255) ))') | ||
| +random = $(shell bash -c 'echo $$(( 1 + (RANDOM % 255) ))') | ||
| if HAVE_GLIBC_234 | ||
| TESTS_ENVIRONMENT += \ | ||
| - LD_PRELOAD="$${LD_PRELOAD:+"$$LD_PRELOAD:"}libc_malloc_debug.so.0" \ | ||
| - GLIBC_TUNABLES=glibc.malloc.check=1:glibc.malloc.perturb=$(random) \ | ||
| + GLIBC_TUNABLES=glibc.malloc.perturb=$(random) \ | ||
| $(NULL) | ||
| else | ||
| TESTS_ENVIRONMENT += \ | ||
| - MALLOC_CHECK_=1 \ | ||
| MALLOC_PERTURB_=$(random) \ | ||
| $(NULL) | ||
| endif | ||
| -- | ||
| 2.55.0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # SymCrypt's unversioned allocator references can split between libc and | ||
| # libc_malloc_debug when glibc's malloc-debug checked allocator is enabled. | ||
| # This causes a crash on free() during SymCrypt load. | ||
|
|
||
| [metadata] | ||
| category = "azl-temp-workaround" | ||
| upstream-status = "unknown" | ||
| bugs = [ | ||
| { url = "https://dev.azure.com/mariner-org/mariner/_workitems/edit/23389" }, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question(blocking): Did you mean to leave in a reference to the internal bug here? If there's a GitHub-located bug filed against SymCrypt that might be the more appropriate reference.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that's intentional. There are many other examples of doing this with an internal bug url. There is no SymCrypt issue filed.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, I see that, Tobias Brick (@tobiasb-ms), and won't block on this. But also I'm not convinced those are really the intended use of the If there are no upstream bugs and there's already sufficient explanation of the issue here, I don't know that the persistent reference is too useful. (And if there were additional useful context that's publishable in GitHub, we should see if we could do that instead.) |
||
| ] | ||
|
|
||
| [[overlays]] | ||
| description = "Disable incompatible glibc malloc-debug checking in tests" | ||
| type = "patch-add" | ||
| source = "../0001-tests-disable-glibc-malloc-check.patch" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
| From: Tobias Brick <tobiasb@microsoft.com> | ||
| Date: Thu, 3 Sep 2026 20:17:00 +0000 | ||
| Subject: [PATCH] tests: disable glibc malloc check | ||
|
|
||
| The glibc malloc-debug checker interposes allocation APIs through | ||
| libc_malloc_debug.so.0. SymCrypt has unversioned allocator references that | ||
| can bind aligned_alloc to libc while binding free to the debug allocator, | ||
| causing OpenSSL consumers to abort during provider initialization. | ||
|
|
||
| Keep malloc perturbation enabled with values in glibc's valid 1-255 range | ||
| to retain detection of uninitialized and use-after-free behavior without | ||
| enabling the incompatible checked allocator. | ||
| --- | ||
| tests/Makefile.am | 11 ++++------- | ||
| 1 file changed, 4 insertions(+), 7 deletions(-) | ||
|
|
||
| diff --git a/tests/Makefile.am b/tests/Makefile.am | ||
| index 3af137f..cf49212 100644 | ||
| --- a/tests/Makefile.am | ||
| +++ b/tests/Makefile.am | ||
| @@ -69,18 +69,15 @@ TESTS_ENVIRONMENT = \ | ||
| LIBNBD_DEBUG=1 \ | ||
| $(NULL) | ||
|
|
||
| -# Enable malloc-check as a cheap way to find some use-after-free and | ||
| -# uninitialized read problems when using glibc, and doesn't affect | ||
| -# normal operation or other libc. | ||
| +# Perturb allocated and freed memory as a cheap way to find some | ||
| +# use-after-free and uninitialized read problems. | ||
| -random = $(shell bash -c 'echo $$(( 1 + (RANDOM & 255) ))') | ||
| +random = $(shell bash -c 'echo $$(( 1 + (RANDOM % 255) ))') | ||
| if HAVE_GLIBC_234 | ||
| TESTS_ENVIRONMENT += \ | ||
| - LD_PRELOAD="$${LD_PRELOAD:+"$$LD_PRELOAD:"}libc_malloc_debug.so.0" \ | ||
| - GLIBC_TUNABLES=glibc.malloc.check=1:glibc.malloc.perturb=$(random) \ | ||
| + GLIBC_TUNABLES=glibc.malloc.perturb=$(random) \ | ||
| $(NULL) | ||
| else | ||
| TESTS_ENVIRONMENT += \ | ||
| - MALLOC_CHECK_=1 \ | ||
| MALLOC_PERTURB_=$(random) \ | ||
| $(NULL) | ||
| endif | ||
| -- | ||
| 2.55.0 |
Uh oh!
There was an error while loading. Please reload this page.