Skip to content

Commit 5e7c8b7

Browse files
avargitster
authored andcommitted
test-lib: have SANITIZE=leak imply TEST_NO_MALLOC_CHECK
Since 131b94a (test-lib.sh: Use GLIBC_TUNABLES instead of MALLOC_CHECK_ on glibc >= 2.34, 2022-03-04) compiling with SANITIZE=leak has missed reporting some leaks. The old MALLOC_CHECK method used before glibc 2.34 seems to have been (mostly?) compatible with it, but after 131b94a e.g. running: TEST_NO_MALLOC_CHECK=1 make SANITIZE=leak test T=t6437-submodule-merge.sh Would report a leak in builtin/commit.c, but this would not: TEST_NO_MALLOC_CHECK= make SANITIZE=leak test T=t6437-submodule-merge.sh Since the interaction is clearly breaking the SANITIZE=leak mode, let's mark them as explicitly incompatible. A related regression for SANITIZE=address was fixed in 067109a (tests: make SANITIZE=address imply TEST_NO_MALLOC_CHECK, 2022-04-09). Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Acked-by: Phillip Wood <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a0feb86 commit 5e7c8b7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

t/test-lib.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,9 +545,11 @@ case $GIT_TEST_FSYNC in
545545
esac
546546

547547
# Add libc MALLOC and MALLOC_PERTURB test only if we are not executing
548-
# the test with valgrind and have not compiled with SANITIZE=address.
548+
# the test with valgrind and have not compiled with conflict SANITIZE
549+
# options.
549550
if test -n "$valgrind" ||
550551
test -n "$SANITIZE_ADDRESS" ||
552+
test -n "$SANITIZE_LEAK" ||
551553
test -n "$TEST_NO_MALLOC_CHECK"
552554
then
553555
setup_malloc_check () {

0 commit comments

Comments
 (0)