summaryrefslogtreecommitdiff
path: root/t/test-lib.sh
diff options
context:
space:
mode:
authorPhillip Wood <phillip.wood@dunelm.org.uk>2022-04-09 12:28:37 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-04-11 19:12:02 (GMT)
commit067109a5e7db3fdffc25240bfc3b350962cd6bd6 (patch)
tree2eb07106bad82fca90ce1db6e3a26d5bb038e6c4 /t/test-lib.sh
parentbaedc5954348b30faa421333289b30818daf36c3 (diff)
downloadgit-067109a5e7db3fdffc25240bfc3b350962cd6bd6.zip
git-067109a5e7db3fdffc25240bfc3b350962cd6bd6.tar.gz
git-067109a5e7db3fdffc25240bfc3b350962cd6bd6.tar.bz2
tests: make SANITIZE=address imply TEST_NO_MALLOC_CHECK
As the address sanitizer checks for a superset of the issues detected by setting MALLOC_CHECK_ (which tries to detect things like double frees and off-by-one errors) there is no need to set the latter when compiling with -fsanitize=address. This fixes a regression introduced by 131b94a10a ("test-lib.sh: Use GLIBC_TUNABLES instead of MALLOC_CHECK_ on glibc >= 2.34", 2022-03-04) which causes all the tests to fail with the message ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD. when git is compiled with SANITIZE=address on systems with glibc >= 2.34. I have tested SANITIZE=leak and SANITIZE=undefined and they do not suffer from this regression so the fix in this patch should be sufficient. Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/test-lib.sh')
-rw-r--r--t/test-lib.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh
index cf3fa45..28ac9e2 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -503,9 +503,10 @@ case $GIT_TEST_FSYNC in
;;
esac
-# Add libc MALLOC and MALLOC_PERTURB test
-# only if we are not executing the test with valgrind
+# Add libc MALLOC and MALLOC_PERTURB test only if we are not executing
+# the test with valgrind and have not compiled with SANITIZE=address.
if test -n "$valgrind" ||
+ test -n "$SANITIZE_ADDRESS" ||
test -n "$TEST_NO_MALLOC_CHECK"
then
setup_malloc_check () {