diff options
| author | Aaron Merey <[email protected]> | 2025-01-30 20:17:28 -0500 |
|---|---|---|
| committer | Aaron Merey <[email protected]> | 2025-02-07 17:13:51 -0500 |
| commit | 91d89c007b1a99bfdff79fa5dd55a208289cec1e (patch) | |
| tree | 062d19d1b6eea1daef5f0a6fcb68d3e8ede3e9de | |
| parent | 78bdee7cb881b6b6df23872d898458fa4b486ac0 (diff) | |
tests/backtrace-subr.sh: Avoid valgrind track-fds in check_native_core
valgrind --track-fds=yes might incorrectly report an error due to the use
of inherited file descriptors in check_native_core.
Prevent this false positive by temporarily removing "--track-fds=yes" from
$VALGRIND_CMD for the duration of the testrun in check_native_core.
Signed-off-by: Aaron Merey <[email protected]>
| -rw-r--r-- | tests/backtrace-subr.sh | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/backtrace-subr.sh b/tests/backtrace-subr.sh index b63e3814..0a5b38f8 100644 --- a/tests/backtrace-subr.sh +++ b/tests/backtrace-subr.sh @@ -187,7 +187,9 @@ check_native_core() fi if [ "x$SAVED_VALGRIND_CMD" != "x" ]; then - VALGRIND_CMD="$SAVED_VALGRIND_CMD" + # Restore $VALGRIND_CMD but disable --track-fds for the following testrun. + # Valgrind --track-fds might complain about an inherited fd. + VALGRIND_CMD=$(sed 's/--track-fds=yes//g' <<< "$SAVED_VALGRIND_CMD") export VALGRIND_CMD fi @@ -195,6 +197,12 @@ check_native_core() # - see function check_err. tempfiles $core{,.{bt,err}} (set +ex; testrun ${abs_builddir}/backtrace -e ${abs_builddir}/$child --core=$core 1>$core.bt 2>$core.err; true) + + if [ "x$SAVED_VALGRIND_CMD" != "x" ]; then + VALGRIND_CMD="$SAVED_VALGRIND_CMD" + export VALGRIND_CMD + fi + cat $core.{bt,err} check_native_unsupported $core.err $child-$core check_all $core.{bt,err} $child-$core |
