Skip to content

Commit 9aa0331

Browse files
committed
Merge branch 'jk/test-malloc-debug-check' into next
Avoid build/test breakage on a system without working malloc debug support dynamic library. * jk/test-malloc-debug-check: test-lib: check malloc debug LD_PRELOAD before using
2 parents 895d633 + 02d9003 commit 9aa0331

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

t/test-lib.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -593,9 +593,12 @@ then
593593
}
594594
else
595595
_USE_GLIBC_TUNABLES=
596+
_USE_GLIBC_PRELOAD=libc_malloc_debug.so.0
596597
if _GLIBC_VERSION=$(getconf GNU_LIBC_VERSION 2>/dev/null) &&
597598
_GLIBC_VERSION=${_GLIBC_VERSION#"glibc "} &&
598-
expr 2.34 \<= "$_GLIBC_VERSION" >/dev/null
599+
expr 2.34 \<= "$_GLIBC_VERSION" >/dev/null &&
600+
stderr=$(LD_PRELOAD=$_USE_GLIBC_PRELOAD git version 2>&1 >/dev/null) &&
601+
test -z "$stderr"
599602
then
600603
_USE_GLIBC_TUNABLES=YesPlease
601604
fi
@@ -607,7 +610,7 @@ else
607610
if test -n "$_USE_GLIBC_TUNABLES"
608611
then
609612
g=
610-
LD_PRELOAD="libc_malloc_debug.so.0"
613+
LD_PRELOAD=$_USE_GLIBC_PRELOAD
611614
for t in \
612615
glibc.malloc.check=1 \
613616
glibc.malloc.perturb=165

0 commit comments

Comments
 (0)