test: avoid interface_ipc.py race and null pointer dereference
What changed, and why it matters
This is a fix for a flaky Bitcoin Core functional test, not a security vulnerability in the live Bitcoin network or wallet software. The test was creating and immediately destroying an unused worker thread, which could trigger a race condition or null pointer dereference during testing. The patch avoids the problematic helper function and directly creates the needed connection. It does not affect production code paths.
No security action required. Treat as ordinary test stability improvement. Reviewers may verify the test still covers the deprecated mining interface correctly.
Security signals we found
null pointer dereference mentioned in commit title
race condition mentioned in commit title and message
test-only change in functional test suite
no production code modified
Evidence from the diff
The commit modifies test/functional/interface_ipc.py’s run_deprecated_mining_test. Previously it called make_capnp_init_ctx(self), which apparently spawned a worker thread that was then immediately torn down, causing a race and possible null pointer dereference observed in CI. The patch inlines the connection setup (AsyncIoStream.create_unix_connection + TwoPartyClient bootstrap) without the worker thread, eliminating the race. This is a test-only reliability fix.
Changed components
test/functional/interface_ipc.pyrun_deprecated_mining_testInspect captured patch +3 / −1
diff --git a/test/functional/interface_ipc.py b/test/functional/interface_ipc.py
index 2fc4497a..280d14d8 100755
--- a/test/functional/interface_ipc.py
+++ b/test/functional/interface_ipc.py
@@ -71,7 +71,9 @@ class IPCInterfaceTest(BitcoinTestFramework):
def run_deprecated_mining_test(self):
self.log.info("Running deprecated mining interface test")
async def async_routine():
- ctx, init = await make_capnp_init_ctx(self)
+ node = self.nodes[0]
+ connection = await capnp.AsyncIoStream.create_unix_connection(node.ipc_socket_path)
+ init = capnp.TwoPartyClient(connection).bootstrap().cast_as(self.capnp_modules['init'].Init)
self.log.debug("Calling deprecated makeMiningOld2 should raise an error")
try:
await init.makeMiningOld2()
Why this scored 16/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.