]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
tests: Disable valgrind for core dumping and for self-introspecting tests.
authorMark Wielaard <mjw@redhat.com>
Fri, 13 Dec 2013 21:42:46 +0000 (22:42 +0100)
committerMark Wielaard <mjw@redhat.com>
Fri, 13 Dec 2013 21:57:30 +0000 (22:57 +0100)
The only tests that fork and exec are those that will then try to ptrace
attach the child for unwind testing. That won't work when the child is
also running under valgrind. So remove --trace-children=yes. Also disable
valgrind while dumping a core or for tests that try to inspect their own
state. They will get confused otherwise finding pieces of valgrind in
their maps.

Note we still seem to hit the following valgrind bug because the way we
map and unmap some shared libraries gets valgrind confused:
https://bugs.kde.org/show_bug.cgi?id=327427

Signed-off-by: Mark Wielaard <mjw@redhat.com>
tests/ChangeLog
tests/Makefile.am
tests/backtrace-subr.sh
tests/run-backtrace-data.sh
tests/run-backtrace-dwarf.sh

index 31638d3c47853da0a83e64458c945899b3786046..44f4ef66db39303017a5db93c23b526284ac5e3d 100644 (file)
@@ -1,3 +1,11 @@
+2013-12-10  Mark Wielaard  <mjw@redhat.com>
+
+       * Makefile.am (valgrind_cmd): Remove --trace-children=yes.
+       * backtrace-subr.sh (check_native_core): Disable valgrind while
+       dumping core.
+       * run-backtrace-data.sh: Disable valgrind.
+       * run-backtrace-dwarf.sh: Likewise.
+
 2013-12-09  Mark Wielaard  <mjw@redhat.com>
 
        * varlocs.c (print_expr): Update comment to explain empty location
index fbcc752e666ef909f050dd8f41d7ad80de8928e2..006b2322e8b26b888cd0e63e26b48404a655b258 100644 (file)
@@ -248,7 +248,7 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \
             backtrace.x86_64.core.bz2 backtrace.x86_64.exec.bz2
 
 if USE_VALGRIND
-valgrind_cmd='valgrind -q --trace-children=yes --error-exitcode=1 --run-libc-freeres=no'
+valgrind_cmd='valgrind -q --error-exitcode=1 --run-libc-freeres=no'
 endif
 
 
index 39d40b3f7b4d07fa03a759cb4282dfe34d76bcbb..580a1cea24220648240f936631fe8ef6cf32c3d7 100644 (file)
@@ -104,7 +104,18 @@ check_native()
 check_native_core()
 {
   child=$1
+
+  # Disable valgrind while dumping core.
+  SAVED_VALGRIND_CMD="$VALGRIND_CMD"
+  unset VALGRIND_CMD
+
   core="core.`ulimit -c unlimited; set +ex; testrun ${abs_builddir}/$child --gencore; true`"
+
+  if [ "x$SAVED_VALGRIND_CMD" != "x" ]; then
+    VALGRIND_CMD="$SAVED_VALGRIND_CMD"
+    export VALGRIND_CMD
+  fi
+
   # Do not abort on non-zero exit code due to some warnings of ./backtrace
   # - see function check_err.
   tempfiles $core{,.{bt,err}}
index 30127c34c6c5cc39fb754d7fec1fc0b7c93efaad..34a4f01d80287194e3d4fb7a1ee377944ea5cfec 100755 (executable)
 
 . $srcdir/backtrace-subr.sh
 
+# This test really cannot be run under valgrind, it tries to introspect
+# its own maps and registers and will find valgrinds instead.
+unset VALGRIND_CMD
+
 tempfiles data.{bt,err}
 (set +ex; testrun ${abs_builddir}/backtrace-data 1>data.bt 2>data.err; true)
 cat data.{bt,err}
index 2f4ba0f5bee5b55169f9fb5ff985ef8160b28c2a..a133b32d3e79b12aa855776e80c5d6cd81d0d520 100755 (executable)
 
 . $srcdir/backtrace-subr.sh
 
+# This test really cannot be run under valgrind, it tries to introspect
+# itself through ptrace and will find bits and pieces of valgrind.
+# On top of that valgrind also tries to read all the unwind info and
+# will warn and complain about various opcodes it doesn't understand...
+unset VALGRIND_CMD
+
 tempfiles dwarf.{bt,err}
 (set +ex; testrun ${abs_builddir}/backtrace-dwarf 1>dwarf.bt 2>dwarf.err; true)
 cat dwarf.{bt,err}