bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

init.sh: enable MALLOC_PERTURB_


From: Jim Meyering
Subject: init.sh: enable MALLOC_PERTURB_
Date: Sun, 09 May 2010 22:47:07 +0200

FYI,

This enables MALLOC_PERTURB_ only for tests that use init.sh,
but eventually that may be all of them.

In the mean time, it'd probably be worthwhile to
set MALLOC_PERTURB_ via a makefile snippet addition.
That's what I've just done in grep.

>From 820c292d76905e6f66ac99dbe2caaf3ce0c61121 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sun, 9 May 2010 22:39:34 +0200
Subject: init.sh: enable MALLOC_PERTURB_

* tests/init.sh: Enable glibc's malloc-perturbing option.
---
 ChangeLog     |    3 +++
 tests/init.sh |    7 +++++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 63d40c3..f2efae5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,9 @@

 2010-05-09  Jim Meyering  <address@hidden>

+       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 7772736..1c0b4b4 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.
--
1.7.1.189.g07419




reply via email to

[Prev in Thread] Current Thread [Next in Thread]