]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
tests: Enable valgrind for stack trace testcases
authorMark Wielaard <mark@klomp.org>
Wed, 1 Jul 2026 20:43:21 +0000 (22:43 +0200)
committerMark Wielaard <mark@klomp.org>
Sat, 4 Jul 2026 00:31:31 +0000 (02:31 +0200)
Various stacks that did produced backtraces disabled valgrind in 2015
because of a valgrind bug. https://bugs.kde.org/show_bug.cgi?id=327427
Somewhere in the last 10 years this valgrind bug seems to have been
fixed. So also run these stack tests under valgrind (when enabled).

* tests/run-backtrace-demangle.sh: Don't unset VALGRIND_CMD.
* tests/run-stack-d-test.sh: Likewise.
* tests/run-stack-demangled-test.sh: Likewise.
* tests/run-stack-demangled-test.sh: Likewise.

Signed-off-by: Mark Wielaard <mark@klomp.org>
tests/run-backtrace-demangle.sh
tests/run-stack-d-test.sh
tests/run-stack-demangled-test.sh
tests/run-stack-i-test.sh

index 403a4852763f2d9a8e5f4c1f0c505b4834633502..e19a2511f4356b6fbdbbadd7bf3588f2619e97fc 100755 (executable)
@@ -26,11 +26,6 @@ child=testfile-backtrace-demangle
 testfiles $child{,.core}
 tempfiles $child.{bt,err}
 
-# Disable valgrind while dumping because of a bug unmapping libc.so.
-# https://bugs.kde.org/show_bug.cgi?id=327427
-SAVED_VALGRIND_CMD="$VALGRIND_CMD"
-unset VALGRIND_CMD
-
 # There can be more than 3 frames, but depending on the system/installed
 # glibc we might not be able to unwind fully till the end.
 # cxxfunc -> f -> main
@@ -39,11 +34,6 @@ unset VALGRIND_CMD
 testrun ${abs_top_builddir}/src/stack -n 2 -e $child --core $child.core >$child.bt 2>$child.err || exitcode=$?
 cat $child.{bt,err}
 
-if [ "x$SAVED_VALGRIND_CMD" != "x" ]; then
-  VALGRIND_CMD="$SAVED_VALGRIND_CMD"
-  export VALGRIND_CMD
-fi
-
 if test $exitcode != 1 || ! grep "shown max number of frames" $child.err; then
   echo >&2 $2: expected more than 2 frames
   false
index a9f03806fc5e4a53bfb2d36f791565fbbca347e2..41982014d1f88a726b36694cd1d2a8db98a60ebf 100755 (executable)
@@ -68,11 +68,6 @@ else
 STACKCMD=${abs_top_builddir}/src/stack
 fi
 
-# Disable valgrind while dumping because of a bug unmapping libc.so.
-# https://bugs.kde.org/show_bug.cgi?id=327427
-SAVED_VALGRIND_CMD="$VALGRIND_CMD"
-unset VALGRIND_CMD
-
 # Without -d the top function comes out as fu. Use --raw to not demangle.
 testrun_compare ${abs_top_builddir}/src/stack -r -n 2 -e testfiledwarfinlines --core testfiledwarfinlines.core<<EOF
 PID 13654 - core
@@ -114,9 +109,4 @@ TID 13654:
 $STACKCMD: tid 13654: shown max number of frames (2, use -n 0 for unlimited)
 EOF
 
-if [ "x$SAVED_VALGRIND_CMD" != "x" ]; then
-  VALGRIND_CMD="$SAVED_VALGRIND_CMD"
-  export VALGRIND_CMD
-fi
-
 exit 0
index ac5bc6175d40233e0422c3fd61b9f65e4e1fd3a1..f5828b1fc9dc7e69d4d4d223ffacb50a07714cee 100755 (executable)
@@ -37,11 +37,6 @@ else
 STACKCMD=${abs_top_builddir}/src/stack
 fi
 
-# Disable valgrind while dumping because of a bug unmapping libc.so.
-# https://bugs.kde.org/show_bug.cgi?id=327427
-SAVED_VALGRIND_CMD="$VALGRIND_CMD"
-unset VALGRIND_CMD
-
 # Without -d the top function comes out as fu.
 testrun_compare ${abs_top_builddir}/src/stack -n 2 -e testfiledwarfinlines --core testfiledwarfinlines.core<<EOF
 PID 13654 - core
@@ -97,9 +92,4 @@ TID 13654:
 $STACKCMD: tid 13654: shown max number of frames (6, use -n 0 for unlimited)
 EOF
 
-if [ "x$SAVED_VALGRIND_CMD" != "x" ]; then
-  VALGRIND_CMD="$SAVED_VALGRIND_CMD"
-  export VALGRIND_CMD
-fi
-
 exit 0
index bc46d9d54a0dae524f5282c6264850d61006b34b..6c680a93024a128ebdf8da0e02703567d9c80780 100755 (executable)
@@ -29,11 +29,6 @@ else
 STACKCMD=${abs_top_builddir}/src/stack
 fi
 
-# Disable valgrind while dumping because of a bug unmapping libc.so.
-# https://bugs.kde.org/show_bug.cgi?id=327427
-SAVED_VALGRIND_CMD="$VALGRIND_CMD"
-unset VALGRIND_CMD
-
 # Compare with run-stack-d-test.sh to see the output without --inlines.
 # Only two call frames are visible (there is a jump from main to fu or
 # fubar). Explicitly use --raw so demangler support being configured in
@@ -86,9 +81,4 @@ TID 13654:
 $STACKCMD: tid 13654: shown max number of frames (6, use -n 0 for unlimited)
 EOF
 
-if [ "x$SAVED_VALGRIND_CMD" != "x" ]; then
-  VALGRIND_CMD="$SAVED_VALGRIND_CMD"
-  export VALGRIND_CMD
-fi
-
 exit 0