]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
tests/Makefile.am: Add --track-destroy=yes to valgrind_cmd
authorAaron Merey <amerey@redhat.com>
Fri, 1 May 2026 17:11:47 +0000 (13:11 -0400)
committerAaron Merey <amerey@redhat.com>
Wed, 13 May 2026 14:59:15 +0000 (10:59 -0400)
Add --track-destroy=yes to valgrind_cmd when --tool=helgrind.  This
reports missing pthread_{mutex,rwlock}_destroy calls when a lock is
initialized at the address of a live rwlock or mutex.

Signed-off-by: Aaron Merey <amerey@redhat.com>
configure.ac
tests/Makefile.am

index 80c7fd8bae61c58bcdf9f6b2b7cc0fd3eeed0449..fbe039d5b43a30ba7f385bf22f24f1faa6dce16d 100644 (file)
@@ -405,6 +405,18 @@ fi
 AM_CONDITIONAL(USE_VALGRIND, test "$use_valgrind" = yes -o "$use_helgrind" = yes)
 AM_CONDITIONAL(USE_HELGRIND, test "$use_helgrind" = yes)
 
+HELGRIND_TRACK_DESTROY=
+if test "$use_helgrind" = yes; then
+  AC_MSG_CHECKING([whether helgrind supports --track-destroy])
+  if valgrind --tool=helgrind --help | grep -qe "--track-destroy"; then
+    HELGRIND_TRACK_DESTROY="--track-destroy=yes"
+    AC_MSG_RESULT([yes])
+  else
+    AC_MSG_RESULT([no])
+  fi
+fi
+AC_SUBST([HELGRIND_TRACK_DESTROY])
+
 AC_ARG_WITH([valgrind],
 AS_HELP_STRING([--with-valgrind],[include directory for Valgrind headers]),
 [with_valgrind_headers=$withval], [with_valgrind_headers=no])
index 9a005416a398a31c5a71a46d5d207ed4458eef18..8ae7d126636e96dbc25da61d1a83699accec1e9e 100644 (file)
@@ -722,7 +722,8 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh run-ar.sh \
 
 
 if USE_HELGRIND
-valgrind_cmd=valgrind -q --tool=helgrind --error-exitcode=1 --track-fds=yes
+valgrind_cmd=valgrind -q --tool=helgrind --error-exitcode=1 --track-fds=yes \
+       @HELGRIND_TRACK_DESTROY@
 else
 if USE_VALGRIND
 valgrind_cmd=valgrind -q --leak-check=full --error-exitcode=1 --track-fds=yes