Hi Mark,
On Wed, Jul 1, 2026 at 4:44 PM Mark Wielaard <[email protected]> wrote:
>
> 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 <[email protected]>
LGTM.
Aaron
> ---
> tests/run-backtrace-demangle.sh | 10 ----------
> tests/run-stack-d-test.sh | 10 ----------
> tests/run-stack-demangled-test.sh | 10 ----------
> tests/run-stack-i-test.sh | 10 ----------
> 4 files changed, 40 deletions(-)
>
> diff --git a/tests/run-backtrace-demangle.sh b/tests/run-backtrace-demangle.sh
> index 403a4852763f..e19a2511f435 100755
> --- a/tests/run-backtrace-demangle.sh
> +++ b/tests/run-backtrace-demangle.sh
> @@ -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
> diff --git a/tests/run-stack-d-test.sh b/tests/run-stack-d-test.sh
> index a9f03806fc5e..41982014d1f8 100755
> --- a/tests/run-stack-d-test.sh
> +++ b/tests/run-stack-d-test.sh
> @@ -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
> diff --git a/tests/run-stack-demangled-test.sh
> b/tests/run-stack-demangled-test.sh
> index ac5bc6175d40..f5828b1fc9dc 100755
> --- a/tests/run-stack-demangled-test.sh
> +++ b/tests/run-stack-demangled-test.sh
> @@ -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
> diff --git a/tests/run-stack-i-test.sh b/tests/run-stack-i-test.sh
> index bc46d9d54a0d..6c680a93024a 100755
> --- a/tests/run-stack-i-test.sh
> +++ b/tests/run-stack-i-test.sh
> @@ -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
> --
> 2.54.0
>