summaryrefslogtreecommitdiff
path: root/tests/init.sh
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2010-05-09 22:39:34 +0200
committerJim Meyering <meyering@redhat.com>2010-05-09 22:40:35 +0200
commit820c292d76905e6f66ac99dbe2caaf3ce0c61121 (patch)
treec016a3baf8b922d8c1e3a533a1a60163720308e4 /tests/init.sh
parent9c827e02efc96390ff7b3e2868684bad1e4b2b1d (diff)
downloadgnulib-820c292d76905e6f66ac99dbe2caaf3ce0c61121.tar.gz
init.sh: enable MALLOC_PERTURB_
* tests/init.sh: Enable glibc's malloc-perturbing option.
Diffstat (limited to 'tests/init.sh')
-rw-r--r--tests/init.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/init.sh b/tests/init.sh
index 7772736970..1c0b4b4f11 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.