test: valgrind --trace-children=yes for bitcoin wrapper
What changed, and why it matters
This commit changes the Bitcoin Core test framework so that when tests are run with the optional --valgrind flag, Valgrind now follows child processes spawned by the main 'bitcoin' wrapper executable. Previously, Valgrind only watched the wrapper itself and could miss memory errors in the actual node processes it launched. This is a testing/quality improvement, not a fix for a user-facing security bug.
No security action required. This is a normal test-framework improvement. Reviewers may verify that --trace-children=yes does not produce excessive false positives in CI Valgrind runs.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch updates the functional test runner’s Valgrind invocation in test/functional/test_framework/util.py by adding –trace-children=yes, and updates the help text in test_framework.py to remove the note that Valgrind does not apply to binaries called from the bitcoin wrapper. This ensures memory-error detection covers subprocesses launched by the wrapper. It is a test-infrastructure change with no effect on production node code or consensus behavior.
Changed components
test/functional/test_framework/util.pytest/functional/test_framework/test_framework.pyInspect captured patch +2 / −1
diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py
index e3893eb4..9e05d227 100755
--- a/test/functional/test_framework/test_framework.py
+++ b/test/functional/test_framework/test_framework.py
@@ -192,7 +192,7 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
parser.add_argument("--perf", dest="perf", default=False, action="store_true",
help="profile running nodes with perf for the duration of the test")
parser.add_argument("--valgrind", dest="valgrind", default=False, action="store_true",
- help="Run binaries under the valgrind memory error detector: Expect at least a ~10x slowdown. Does not apply to previous release binaries or binaries called from the bitcoin wrapper executable.")
+ help="Run binaries under the valgrind memory error detector: Expect at least a ~10x slowdown. Does not apply to previous release binaries.")
parser.add_argument("--randomseed", type=int,
help="set a random seed for deterministically reproducing a previous test run")
parser.add_argument("--timeout-factor", dest="timeout_factor", type=float, help="adjust test timeouts by a factor. Setting it to 0 disables all timeouts")
diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py
index 3fabca8b..b6aa3568 100644
--- a/test/functional/test_framework/util.py
+++ b/test/functional/test_framework/util.py
@@ -256,6 +256,7 @@ class Binaries:
"valgrind",
f"--suppressions={suppressions_file}",
"--gen-suppressions=all",
+ "--trace-children=yes", # Needed for 'bitcoin' wrapper
"--exit-on-first-error=yes",
"--error-exitcode=1",
"--quiet",
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.