test: Move valgrind.supp to the other sanitizer_suppressions files
What changed, and why it matters
This commit simply moves a Valgrind suppressions file from one directory to another. It does not change any code that runs in production, nor does it alter the suppressions themselves. All references to the file's path are updated so tests and documentation still point to the right location. There is no security issue here.
No action required. This is a non-functional file relocation with no security relevance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit relocates contrib/valgrind.supp to test/sanitizer_suppressions/valgrind.supp and updates three path references: ci/test/wrap-valgrind.sh, doc/developer-notes.md, and test/functional/test_framework/util.py. The file content is identical. This is a repository organization/test-infrastructure change only.
Changed components
test infrastructure path referencesValgrind CI wrapper scriptdeveloper documentationfunctional test framework utilityInspect captured patch +57 / −57
diff --git a/ci/test/wrap-valgrind.sh b/ci/test/wrap-valgrind.sh
index e351cf24..4ed3f2d6 100755
--- a/ci/test/wrap-valgrind.sh
+++ b/ci/test/wrap-valgrind.sh
@@ -12,7 +12,7 @@ for b_name in "${BASE_OUTDIR}/bin"/*; do
echo "Wrap $b ..."
mv "$b" "${b}_orig"
echo '#!/usr/bin/env bash' > "$b"
- echo "exec valgrind --gen-suppressions=all --quiet --error-exitcode=1 --suppressions=${BASE_ROOT_DIR}/contrib/valgrind.supp \"${b}_orig\" \"\$@\"" >> "$b"
+ echo "exec valgrind --gen-suppressions=all --quiet --error-exitcode=1 --suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/valgrind.supp \"${b}_orig\" \"\$@\"" >> "$b"
chmod +x "$b"
done
done
diff --git a/contrib/valgrind.supp b/contrib/valgrind.supp
deleted file mode 100644
index c7a890aa..00000000
--- a/contrib/valgrind.supp
+++ /dev/null
@@ -1,52 +0,0 @@
-# This valgrind suppressions file includes known Valgrind warnings in our
-# dependencies that cannot be fixed in-tree.
-#
-# Example use:
-# $ valgrind --suppressions=contrib/valgrind.supp build/bin/test_bitcoin
-# $ valgrind --suppressions=contrib/valgrind.supp --leak-check=full \
-# --show-leak-kinds=all build/bin/test_bitcoin
-#
-# To create suppressions for found issues, use the --gen-suppressions=all option:
-# $ valgrind --suppressions=contrib/valgrind.supp --leak-check=full \
-# --show-leak-kinds=all --gen-suppressions=all --show-reachable=yes \
-# --error-limit=no build/bin/test_bitcoin
-#
-# Note that suppressions may depend on OS and/or library versions.
-# Tested on aarch64 and x86_64 with Ubuntu Noble system libs, using clang-16
-# and GCC, without gui.
-{
- Suppress leaks on shutdown
- Memcheck:Leak
- ...
- fun:_Z8ShutdownR11NodeContext
-}
-{
- Suppress leveldb leak
- Memcheck:Leak
- match-leak-kinds: reachable
- fun:_Znwm
- ...
- fun:_ZN7leveldb6DBImpl14BackgroundCallEv
-}
-{
- Suppress leveldb leak
- Memcheck:Leak
- fun:_Znwm
- ...
- fun:GetCoin
-}
-{
- Suppress LogInstance still reachable memory warning
- Memcheck:Leak
- match-leak-kinds: reachable
- fun:_Znwm
- fun:_Z11LogInstancev
-}
-{
- Suppress BCLog::Logger::StartLogging() still reachable memory warning
- Memcheck:Leak
- match-leak-kinds: reachable
- fun:malloc
- ...
- fun:_ZN5BCLog6Logger12StartLoggingEv
-}
diff --git a/doc/developer-notes.md b/doc/developer-notes.md
index 97ffc0cd..31ffd370 100644
--- a/doc/developer-notes.md
+++ b/doc/developer-notes.md
@@ -384,13 +384,13 @@ other input.
Valgrind is a programming tool for memory debugging, memory leak detection, and
profiling. The repo contains a Valgrind suppressions file
-([`valgrind.supp`](https://github.com/bitcoin/bitcoin/blob/master/contrib/valgrind.supp))
+([`valgrind.supp`](/test/sanitizer_suppressions/valgrind.supp))
which includes known Valgrind warnings in our dependencies that cannot be fixed
in-tree. Example use:
```shell
-$ valgrind --suppressions=contrib/valgrind.supp build/bin/test_bitcoin
-$ valgrind --suppressions=contrib/valgrind.supp --leak-check=full \
+$ valgrind --suppressions=test/sanitizer_suppressions/valgrind.supp build/bin/test_bitcoin
+$ valgrind --suppressions=test/sanitizer_suppressions/valgrind.supp --leak-check=full \
--show-leak-kinds=all build/bin/test_bitcoin --log_level=test_suite
$ valgrind -v --leak-check=full build/bin/bitcoind -printtoconsole
$ ./build/test/functional/test_runner.py --valgrind
diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py
index b9a76aef..d246a744 100644
--- a/test/functional/test_framework/util.py
+++ b/test/functional/test_framework/util.py
@@ -251,7 +251,7 @@ class Binaries:
def __init__(self, paths, bin_dir, *, use_valgrind=False):
self.paths = paths
self.bin_dir = bin_dir
- suppressions_file = pathlib.Path(__file__).resolve().parents[3] / "contrib" / "valgrind.supp"
+ suppressions_file = pathlib.Path(__file__).resolve().parents[3] / "test" / "sanitizer_suppressions" / "valgrind.supp"
self.valgrind_cmd = [
"valgrind",
f"--suppressions={suppressions_file}",
diff --git a/test/sanitizer_suppressions/valgrind.supp b/test/sanitizer_suppressions/valgrind.supp
new file mode 100644
index 00000000..584cdcf7
--- /dev/null
+++ b/test/sanitizer_suppressions/valgrind.supp
@@ -0,0 +1,52 @@
+# This valgrind suppressions file includes known Valgrind warnings in our
+# dependencies that cannot be fixed in-tree.
+#
+# Example use:
+# $ valgrind --suppressions=test/sanitizer_suppressions/valgrind.supp build/bin/test_bitcoin
+# $ valgrind --suppressions=test/sanitizer_suppressions/valgrind.supp --leak-check=full \
+# --show-leak-kinds=all build/bin/test_bitcoin
+#
+# To create suppressions for found issues, use the --gen-suppressions=all option:
+# $ valgrind --suppressions=test/sanitizer_suppressions/valgrind.supp --leak-check=full \
+# --show-leak-kinds=all --gen-suppressions=all --show-reachable=yes \
+# --error-limit=no build/bin/test_bitcoin
+#
+# Note that suppressions may depend on OS and/or library versions.
+# Tested on aarch64 and x86_64 with Ubuntu Noble system libs, using clang-16
+# and GCC, without gui.
+{
+ Suppress leaks on shutdown
+ Memcheck:Leak
+ ...
+ fun:_Z8ShutdownR11NodeContext
+}
+{
+ Suppress leveldb leak
+ Memcheck:Leak
+ match-leak-kinds: reachable
+ fun:_Znwm
+ ...
+ fun:_ZN7leveldb6DBImpl14BackgroundCallEv
+}
+{
+ Suppress leveldb leak
+ Memcheck:Leak
+ fun:_Znwm
+ ...
+ fun:GetCoin
+}
+{
+ Suppress LogInstance still reachable memory warning
+ Memcheck:Leak
+ match-leak-kinds: reachable
+ fun:_Znwm
+ fun:_Z11LogInstancev
+}
+{
+ Suppress BCLog::Logger::StartLogging() still reachable memory warning
+ Memcheck:Leak
+ match-leak-kinds: reachable
+ fun:malloc
+ ...
+ fun:_ZN5BCLog6Logger12StartLoggingEv
+}
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.