Repository navigation
Closed
Description
test 2026-02-27T13:07:39.511298Z TestFramework (DEBUG): Calling deprecated makeMiningOld2 should raise an error
node0 2026-02-27T13:07:39.511430Z [capnp-loop] [ipc/capnp/protocol.cpp:50] [IpcLogFn] [ipc] {bitcoin-node-27865/b-capnp-loop-27872} IPC server recv request #11 Init.construct$Params
node0 2026-02-27T13:07:39.511453Z [capnp-loop] [ipc/capnp/protocol.cpp:47] [IpcLogFn] [ipc:trace] {bitcoin-node-27865/b-capnp-loop-27872} request data: ()
node0 2026-02-27T13:07:39.511493Z [capnp-loop] [ipc/capnp/protocol.cpp:50] [IpcLogFn] [ipc] {bitcoin-node-27865/b-capnp-loop-27872} IPC server send response #11 Init.construct$Results
node0 2026-02-27T13:07:39.511528Z [capnp-loop] [ipc/capnp/protocol.cpp:47] [IpcLogFn] [ipc:trace] {bitcoin-node-27865/b-capnp-loop-27872} response data: (threadMap = <external capability>)
node0 2026-02-27T13:07:39.511722Z [capnp-loop] [ipc/capnp/protocol.cpp:50] [IpcLogFn] [ipc] {bitcoin-node-27865/b-capnp-loop-27872} IPC server recv request #12 Init.makeMiningOld2$Params
node0 2026-02-27T13:07:39.511765Z [capnp-loop] [ipc/capnp/protocol.cpp:47] [IpcLogFn] [ipc:trace] {bitcoin-node-27865/b-capnp-loop-27872} request data: ()
Error: node0 2026-02-27T13:07:39.511806Z [capnp-loop] [ipc/capnp/protocol.cpp:59] [IpcLogFn] [error] ipc: {bitcoin-node-27865/b-capnp-loop-27872} IPC server unhandled exception: Old mining interface (@2) not supported. Please update your client!
test 2026-02-27T13:07:39.512059Z TestFramework (DEBUG): Closing down network thread
test 2026-02-27T13:07:39.562890Z TestFramework (INFO): Stopping nodes
test 2026-02-27T13:07:39.562975Z TestFramework.node0 (DEBUG): Stopping node
node0 stderr /home/admin/actions-runner/_work/_temp/src/ipc/libmultiprocess/src/mp/proxy.cpp:416:44: runtime error: member access within null pointer of type 'mp::Waiter'
#0 0x5b9b042f9bc7 in mp::ProxyServer<mp::ThreadMap>::makeThread(capnp::CallContext<mp::ThreadMap::MakeThreadParams, mp::ThreadMap::MakeThreadResults>)::$_0::operator()() const /home/admin/actions-runner/_work/_temp/src/ipc/libmultiprocess/src/mp/proxy.cpp:416:44
#1 0x5b9b042f9bc7 in void std::__invoke_impl<void, mp::ProxyServer<mp::ThreadMap>::makeThread(capnp::CallContext<mp::ThreadMap::MakeThreadParams, mp::ThreadMap::MakeThreadResults>)::$_0>(std::__invoke_other, mp::ProxyServer<mp::ThreadMap>::makeThread(capnp::CallContext<mp::ThreadMap::MakeThreadParams, mp::ThreadMap::MakeThreadResults>)::$_0&&) /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/invoke.h:61:14
#2 0x5b9b042f9bc7 in std::__invoke_result<mp::ProxyServer<mp::ThreadMap>::makeThread(capnp::CallContext<mp::ThreadMap::MakeThreadParams, mp::ThreadMap::MakeThreadResults>)::$_0>::type std::__invoke<mp::ProxyServer<mp::ThreadMap>::makeThread(capnp::CallContext<mp::ThreadMap::MakeThreadParams, mp::ThreadMap::MakeThreadResults>)::$_0>(mp::ProxyServer<mp::ThreadMap>::makeThread(capnp::CallContext<mp::ThreadMap::MakeThreadParams, mp::ThreadMap::MakeThreadResults>)::$_0&&) /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/invoke.h:96:14
#3 0x5b9b042f9bc7 in void std::thread::_Invoker<std::tuple<mp::ProxyServer<mp::ThreadMap>::makeThread(capnp::CallContext<mp::ThreadMap::MakeThreadParams, mp::ThreadMap::MakeThreadResults>)::$_0>>::_M_invoke<0ul>(std::_Index_tuple<0ul>) /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/std_thread.h:292:13
#4 0x5b9b042f9bc7 in std::thread::_Invoker<std::tuple<mp::ProxyServer<mp::ThreadMap>::makeThread(capnp::CallContext<mp::ThreadMap::MakeThreadParams, mp::ThreadMap::MakeThreadResults>)::$_0>>::operator()() /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/std_thread.h:299:11
#5 0x5b9b042f9bc7 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<mp::ProxyServer<mp::ThreadMap>::makeThread(capnp::CallContext<mp::ThreadMap::MakeThreadParams, mp::ThreadMap::MakeThreadResults>)::$_0>>>::_M_run() /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/std_thread.h:244:13
#6 0x7e490caa7db3 (/lib/x86_64-linux-gnu/libstdc++.so.6+0xecdb3) (BuildId: 753c6c8608b61d4e67be8f0c890e03e0aa046b8b)
#7 0x5b9b02f157da in asan_thread_start(void*) crtstuff.c
#8 0x7e490c719aa3 (/lib/x86_64-linux-gnu/libc.so.6+0x9caa3) (BuildId: 8e9fd827446c24067541ac5390e6f527fb5947bb)
#9 0x7e490c7a6c6b (/lib/x86_64-linux-gnu/libc.so.6+0x129c6b) (BuildId: 8e9fd827446c24067541ac5390e6f527fb5947bb)
SUMMARY: UndefinedBehaviorSanitizer: null-pointer-use /home/admin/actions-runner/_work/_temp/src/ipc/libmultiprocess/src/mp/proxy.cpp:416:44
test 2026-02-27T23:11:14.432126Z TestFramework (DEBUG): Calling deprecated makeMiningOld2 should raise an error
node0 2026-02-27T23:11:14.433082Z [capnp-loop] [ipc/capnp/protocol.cpp:53] [IpcLogFn] ipc: {bitcoin-node-27102/b-capnp-loop-27137} IPC server destroy N2mp11ProxyServerIN3ipc5capnp8messages6MiningEEE
node0 2026-02-27T23:11:14.433137Z [capnp-loop] [ipc/capnp/protocol.cpp:50] [IpcLogFn] [ipc] {bitcoin-node-27102/b-capnp-loop-27137} IPC server recv request #11 Init.construct$Params
node0 2026-02-27T23:11:14.433143Z [capnp-loop] [ipc/capnp/protocol.cpp:47] [IpcLogFn] [ipc:trace] {bitcoin-node-27102/b-capnp-loop-27137} request data: ()
node0 2026-02-27T23:11:14.433151Z [capnp-loop] [ipc/capnp/protocol.cpp:50] [IpcLogFn] [ipc] {bitcoin-node-27102/b-capnp-loop-27137} IPC server send response #11 Init.construct$Results
node0 2026-02-27T23:11:14.433156Z [capnp-loop] [ipc/capnp/protocol.cpp:47] [IpcLogFn] [ipc:trace] {bitcoin-node-27102/b-capnp-loop-27137} response data: (threadMap = <external capability>)
node0 2026-02-27T23:11:14.433243Z [capnp-loop] [ipc/capnp/protocol.cpp:50] [IpcLogFn] [ipc] {bitcoin-node-27102/b-capnp-loop-27137} IPC server recv request #12 Init.makeMiningOld2$Params
node0 2026-02-27T23:11:14.433255Z [capnp-loop] [ipc/capnp/protocol.cpp:47] [IpcLogFn] [ipc:trace] {bitcoin-node-27102/b-capnp-loop-27137} request data: ()
Error: 2026-02-27T23:11:14.433271Z [capnp-loop] [ipc/capnp/protocol.cpp:59] [IpcLogFn] [error] ipc: {bitcoin-node-27102/b-capnp-loop-27137} IPC server unhandled exception: Old mining interface (@2) not supported. Please update your client!
node0 2026-02-27T23:11:14.433329Z [capnp-loop] [ipc/capnp/protocol.cpp:53] [IpcLogFn] ipc: {bitcoin-node-27102/b-capnp-loop-27137} IPC server: socket disconnected.
node0 2026-02-27T23:11:14.433334Z [capnp-loop] [ipc/capnp/protocol.cpp:53] [IpcLogFn] ipc: {bitcoin-node-27102/b-capnp-loop-27137} IPC server destroy N2mp11ProxyServerIN3ipc5capnp8messages4InitEEE
test 2026-02-27T23:11:14.433542Z TestFramework (DEBUG): Closing down network thread
test 2026-02-27T23:11:14.485263Z TestFramework (INFO): Stopping nodes
test 2026-02-27T23:11:14.485316Z TestFramework.node0 (DEBUG): Stopping node
Reacted by Ryan Ofsky
Activity
fanquake commentedon Mar 2, 2026
cc @Sjors @ryanofsky
ryanofsky commentedon Mar 2, 2026
Thanks for the clear report! It seems like this problem was introduced in #34568 with the new
run_deprecated_mining_test.The stack trace shows the problem is a null
g_thread_context.waiterpointer being dereferenced inProxyServer<ThreadMap>::makeThreadwhich is creating a worker thread. That pointer is only set to null inProxyServer<Thread>::~ProxyServerwhen the worker thread is being destroyed. So the issue is just that the worker thread is destroyed too quickly after it is created, resulting in a null pointer use since it gets destroyed before it is fully initialized. A direct fix for this problem would be:Fixing the thread init/destroy race by acquiring a lock one line earlier so the thread can't be used or destroyed until it's locked and ready for requests.
An indirect fix would be to simply avoid creating and destroying a worker thread that is never used. It seems like
run_deprecated_mining_testis the only test we have that is doing this. The problem can be avoided by not creating actxvariable that is never used.Either of these changes should fix the problem and probably both make sense, so I can open PRs for both.
test: avoid interface_ipc.py race and null pointer dereference
Merge #34715: test: avoid interface_ipc.py race and null pointer dere…
achow101 commentedon Mar 4, 2026
Fixed by #34715
race fix: worker thread destroyed before it is initialized (#34711, #…
test: worker thread destroyed before it is initialized
Squashed 'src/ipc/libmultiprocess/' changes from 1868a84..789ac8c86d5
13 remaining items
race fix: worker thread destroyed before it is initialized
test: worker thread destroyed before it is initialized
race fix: worker thread destroyed before it is initialized
test: worker thread destroyed before it is initialized
race fix: worker thread destroyed before it is initialized
test: worker thread destroyed before it is initialized
race fix: worker thread destroyed before it is initialized
test: worker thread destroyed before it is initialized
race fix: worker thread destroyed before it is initialized
Merge #249: fixes for race conditions on disconnects
Merge #34804: Update libmultiprocess subtree to fix race conditions o…
Merge #34952: Update libmultiprocess subtree in 31.x branch to fix ra…
Merge bitcoin#34952: Update libmultiprocess subtree in 31.x branch to…
test: worker thread destroyed before it is initialized
race fix: worker thread destroyed before it is initialized