mirror of
https://github.com/git/git
synced 2024-10-30 04:01:21 +00:00
Merge branch 'ep/test-malloc-check-with-glibc-2.34'
The method to trigger malloc check used in our tests no longer work with newer versions of glibc. * ep/test-malloc-check-with-glibc-2.34: test-lib: declare local variables as local test-lib.sh: Use GLIBC_TUNABLES instead of MALLOC_CHECK_ on glibc >= 2.34
This commit is contained in:
commit
b6763af74b
1 changed files with 18 additions and 0 deletions
|
@ -548,11 +548,29 @@ then
|
|||
}
|
||||
else
|
||||
setup_malloc_check () {
|
||||
local g
|
||||
local t
|
||||
MALLOC_CHECK_=3 MALLOC_PERTURB_=165
|
||||
export MALLOC_CHECK_ MALLOC_PERTURB_
|
||||
if _GLIBC_VERSION=$(getconf GNU_LIBC_VERSION 2>/dev/null) &&
|
||||
_GLIBC_VERSION=${_GLIBC_VERSION#"glibc "} &&
|
||||
expr 2.34 \<= "$_GLIBC_VERSION" >/dev/null
|
||||
then
|
||||
g=
|
||||
LD_PRELOAD="libc_malloc_debug.so.0"
|
||||
for t in \
|
||||
glibc.malloc.check=1 \
|
||||
glibc.malloc.perturb=165
|
||||
do
|
||||
g="${g#:}:$t"
|
||||
done
|
||||
GLIBC_TUNABLES=$g
|
||||
export LD_PRELOAD GLIBC_TUNABLES
|
||||
fi
|
||||
}
|
||||
teardown_malloc_check () {
|
||||
unset MALLOC_CHECK_ MALLOC_PERTURB_
|
||||
unset LD_PRELOAD GLIBC_TUNABLES
|
||||
}
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue