test: Add missing resolve() to valgrind.supp file
What changed, and why it matters
This is a one-line fix in Bitcoin Core's test framework. It ensures that when running tests under the Valgrind memory-checking tool, the correct suppressions file is found even if the test script is accessed through a symbolic link. It does not change the Bitcoin node software itself and has no security impact on users' funds or the network.
No security action needed. Treat as a normal test-framework correctness fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change adds .resolve() to pathlib.Path(__file__).parents[3] when locating contrib/valgrind.supp. In feature_framework_testshell.py, sys.path is manually set to the build-tree directory, so __file__ may point at a symlink in the build tree rather than the physical source file. Without .resolve(), parents[3] resolves to the build directory and the suppressions file is not found. With .resolve(), the symlink is followed first, so the path is computed from the real source root. This only affects the test harness’s Valgrind invocation and has no runtime effect on Bitcoin Core.
Changed components
test/functional/test_framework/util.pyInspect captured patch +1 / −1
diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py
index b6aa3568..b9a76aef 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__).parents[3] / "contrib" / "valgrind.supp"
+ suppressions_file = pathlib.Path(__file__).resolve().parents[3] / "contrib" / "valgrind.supp"
self.valgrind_cmd = [
"valgrind",
f"--suppressions={suppressions_file}",
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.