This error occurs when non-C++ clients make simultaneous IPC calls to the server using the same Server thread.
The libmultiprocess C++ client ensures a 1-to-1 mapping of client-to-server threads, so simultaneous calls using the same thread cannot be made.
Testing
I have added a unit test in the last commit.
You can cherry-pick this commit on master to reproduce the crash.
DrahtBot
commented at 11:04 AM on September 23, 2025:
none
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--021abf342d371248e50ceaed478a90ca-->
Reviews
See the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
<!--5faf32d7da4f0f540f40219e4f7537a3-->
LLM Linter (✨ experimental)
Possible typos and grammar issues:
// Use callFnAsync() to get the client to setup the request_thread that will be used for the test. -> ... to set up the request_thread that will be used for the test. [“setup” is a noun; the verb form should be “set up”.]
// NOTE: '3' was choosen because it was the lowest number -> // NOTE: '3' was chosen because it was the lowest number [“choosen” is a misspelling of “chosen”.]
<sup>drahtbot_id_5_m</sup>
ryanofsky
commented at 3:33 PM on September 23, 2025:
collaborator
I do think it should be pretty straightforward to write a c++ unit test too, not sure if you were planning on doing that or if something was in the way.
Eunovo
commented at 9:44 AM on September 24, 2025:
contributor
I wasn't sure it was worth it to add the Python test. It could be useful for reproducing scenarios experienced by non-libmultiprocess clients in general, but I'm not convinced.
I do think it should be pretty straightforward to write a c++ unit test too, not sure if you were planning on doing that or if something was in the way.
I think it might be possible if I use the Capnp library directly instead of the libmultiprocess client.
ryanofsky
commented at 11:01 AM on September 24, 2025:
collaborator
I think it might be possible if I use the Capnp library directly instead of the libmultiprocess client.
Yes that would be the idea. You should be able to modify existing tests which connect with the libmultiprocess client, and use the ProxyClient<messages::FooInterface> it object it provides. But instead of calling libmultiprocess methods directly on that object, call capnproto methods on the object's messages::FooInterface::Client m_client member.
Fix crash on simultaneous IPC calls using the same thread
This error occurs when non-libmultiprocess clients make simultaenous IPC calls to the server using the same Server thread.
The libmultiprocess Cpp client ensures a 1-to-1 mapping of client-to-server threads, so simultaneous calls using the same thread cannot be made.
eb069ab75d
Eunovo force-pushed on Sep 26, 2025
Eunovo force-pushed on Sep 26, 2025
Eunovo
commented at 5:48 PM on September 26, 2025:
contributor
Yes that would be the idea. You should be able to modify existing tests which connect with the libmultiprocess client, and use the ProxyClient<messages::FooInterface> it object it provides. But instead of calling libmultiprocess methods directly on that object, call capnproto methods on the object's messages::FooInterface::Client m_client member.
Done
ryanofsky
commented at 6:26 PM on September 26, 2025:
collaborator
Code review 21886f2bbdf7238282909f04c8c0d57ec4f75726. Thanks for the new test!
The approach in the test seems pretty clever. In order to trigger the "thread busy" error, you need the server IPC thread to be busy waiting for something when a new request comes in. By having the server run the "callbackSaved" method, it guarantees the thread will be busy because it will be stuck trying to call the client while the event loop is occupied.
I think a more direct approach is probably possible, maybe by adding new FooInterface wait and stopWaiting methods where wait just blocks indefinitely until stopWaiting is called, and the "thread busy" error can be called by just making 2 wait requests simultaneously. Or instead of adding any new methods, the existing callFnAsync method can be called instead of wait() and m_fn could just be set in the beginning of the test to wait indefinitely until the end of the test.
I do like current approach though and there's no need to change it.
test: simultaneous IPC calls using same thread
Although the libmultiprocess client prevents this kind of situation from occuring, it easily occurs in non-libmultiprocess clients
1238170f68
Eunovo force-pushed on Sep 29, 2025
Eunovo
commented at 10:19 AM on September 29, 2025:
contributor
ryanofsky
commented at 7:13 PM on September 29, 2025:
collaborator
That's interesting. 1238170f68e8fa7ae41c79465df5cdae34d568e9 looks like a straightforward test for the problem, and I would also expect only 2 simultaneous calls to necessary not 3.
Code review ACK1238170f68e8fa7ae41c79465df5cdae34d568e9, since the code changes here all make sense except the initial running = 3 value, and there is a comment about that, so at least it's called out and may be something that can be improved later.
ryanofsky merged this on Oct 2, 2025
ryanofsky closed this on Oct 2, 2025
ryanofsky referenced this in commit 3f74b5aa02 on Oct 2, 2025
ryanofsky referenced this in commit 5bb3cbdfba on Oct 2, 2025
ryanofsky referenced this in commit 91b606ac8e on Oct 2, 2025
ryanofsky referenced this in commit 1d74abcf3a on Oct 2, 2025
ryanofsky referenced this in commit 1cfe54149d on Oct 2, 2025
ryanofsky
commented at 7:15 PM on October 2, 2025:
collaborator
since the code changes here all make sense except the initial running = 3 value
Figured out the reason running = 3 is required. The Waiter class is actually capable of waiting for one previously posted function to be executed when a new one is posted. It just doesn't allow a third function to be posted when one is currently executing and one is currently waiting to be executed. So the test needs to send two pending requests to occupy the wait class before "thread busy" will be returned.
ryanofsky referenced this in commit c332774409 on Oct 2, 2025
ryanofsky referenced this in commit b74e1bba01 on Oct 2, 2025
ryanofsky referenced this in commit 73d22ba2e9 on Oct 2, 2025
ryanofsky referenced this in commit 0fc31ec036 on Oct 3, 2025
ryanofsky referenced this in commit f4344ae87d on Oct 7, 2025
ryanofsky referenced this in commit 5191781886 on Oct 7, 2025
ryanofsky referenced this in commit 0f01e1577f on Oct 7, 2025
ryanofsky referenced this in commit abcd4c4ff9 on Oct 7, 2025
Sjors referenced this in commit 3e34afe882 on Oct 7, 2025
fanquake referenced this in commit becf150013 on Oct 10, 2025
Sjors referenced this in commit 7e61dcfa61 on Oct 10, 2025
fanquake referenced this in commit a14e7b9dee on Oct 16, 2025
morozow referenced this in commit ed7fc322ea on May 8, 2026
Sjors referenced this in commit 0dd3f5c989 on May 12, 2026
Kino1994 referenced this in commit c48311e5d3 on Jun 28, 2026
BigcoinBGC referenced this in commit 3fcca93d0d on Jun 30, 2026
Kino1994 referenced this in commit 480cdd0257 on Aug 19, 2026
xyzconstant referenced this in commit d38bbb535a on Aug 27, 2026
xyzconstant referenced this in commit e647ba046f on Aug 27, 2026
xyzconstant referenced this in commit 191a8321c1 on Aug 27, 2026
This is a metadata mirror of the GitHub repository
bitcoin-core/libmultiprocess.
This site is not affiliated with GitHub.
Content is generated from a GitHub metadata backup.
generated: 2026-10-08 00:30 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me