From: Jim Meyering Date: Sun, 9 May 2010 20:39:34 +0000 (+0200) Subject: init.sh: enable MALLOC_PERTURB_ X-Git-Tag: v0.1~4155 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=820c292d76905e6f66ac99dbe2caaf3ce0c61121;p=gnulib.git init.sh: enable MALLOC_PERTURB_ * tests/init.sh: Enable glibc's malloc-perturbing option. --- diff --git a/ChangeLog b/ChangeLog index 63d40c327..f2efae51c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,9 @@ 2010-05-09 Jim Meyering + init.sh: enable MALLOC_PERTURB_ + * tests/init.sh: Enable glibc's malloc-perturbing option. + maint.mk: improve sc_cross_check_PATH_usage_in_tests With my recent change in init.sh from the two-line form: -# : ${srcdir=.} diff --git a/tests/init.sh b/tests/init.sh index 777273697..1c0b4b4f1 100644 --- a/tests/init.sh +++ b/tests/init.sh @@ -94,6 +94,13 @@ fi test -n "$EXEEXT" && shopt -s expand_aliases +# Enable glibc's malloc-perturbing option. +# This is cheap and useful for exposing code that depends on the fact that +# malloc-related functions often return memory that is mostly zeroed. +# If you have the time and cycles, use valgrind to do an even better job. +${MALLOC_PERTURB_=87} +export MALLOC_PERTURB_ + # We use a trap below for cleanup. This requires us to go through # hoops to get the right exit status transported through the handler. # So use `Exit STATUS' instead of `exit STATUS' inside of the tests.