You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[v1][Windows] Launching a child process fails due to a pipe name clash with unrelated (plug-in) DLL running its own child process around the same time
#476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Imagine an application that is a plug-in host that loads unrelated DLLs (e.g. from different vendors) as its plug-ins. If two or more such plug-ins use Boost.Process under the hood (e.g. header-only, with no boost_process*.dll) to launch child processes and e.g. read their output, and if it happens so that they do it around the same time (e.g. upon project opened), then chances are high that some of them will fail with error 231: All pipe instances are busy because each plug-in will generate and attempt using the same pipe name.
Reproduce:
Download the following source files to the same empty folder:
Adjust the BOOST_ROOT variable value in rebuild.cmd to point to the Boost directory that has its libs built statically (to model the real-life situation and avoid dependency on boost_process*.dll).
Run rebuild.cmd — it should produce, among others, EXE.exe , DLL1.dll and DLL2.dll. DLL1.dll and DLL2.dll are identical and model two distinct plug-ins.
Run EXE.exe.
Expected:
Assuming the current directory is F:\Experiments\Boost, we should get some output like this:
CMD finished. Code: 0. Output:
Microsoft Windows [Version 10.0.19045.5737]
(c) Microsoft Corporation. All rights reserved.
F:\Experiments\Boost>
doubled and intertwined due to concurrent execution of two threads. E.g.:
CMD finished. Code: CMD finished. Code: 0. Output:
Microsoft Windows [Version 10.0.19045.5737]
(c) Microsoft Corporation. All rights reserved.
F:\Experiments\Boost>
0. Output:
Microsoft Windows [Version 10.0.19045.5737]
(c) Microsoft Corporation. All rights reserved.
F:\Experiments\Boost>
Actual:
Due to both plug-ins trying to use the same pipe name, one of the child processes will fail to launch, so we get e.g.:
CMD failed to start. Code: system:231. Message:
create_named_pipe(\\.\pipe\boost_process_auto_pipe_24652_0) failed: All pipe instances are busy
CMD finished. Code: 0. Output:
Microsoft Windows [Version 10.0.19045.5737]
(c) Microsoft Corporation. All rights reserved.
F:\Experiments\Boost>
The text was updated successfully, but these errors were encountered:
Include numerical representation of local static variable's address into the pipe name to discriminate Boost.Process instances in independent DLLs.
Fixesboostorg#476
Also (auto-)remove excessive concurrent empty lines.
Include numerical representation of local static variable's address into the pipe name to discriminate Boost.Process instances in independent DLLs.
Fixesboostorg#476
Also (auto-)remove excessive concurrent empty lines.
RK-BFX
added a commit
to boris-fx/mocha-boost
that referenced
this issue
Apr 14, 2025
General
Imagine an application that is a plug-in host that loads unrelated DLLs (e.g. from different vendors) as its plug-ins. If two or more such plug-ins use Boost.Process under the hood (e.g. header-only, with no
boost_process*.dll
) to launch child processes and e.g. read their output, and if it happens so that they do it around the same time (e.g. upon project opened), then chances are high that some of them will fail with error 231:All pipe instances are busy
because each plug-in will generate and attempt using the same pipe name.Reproduce:
Download the following source files to the same empty folder:
exe.cpp
dll.cpp
It also includes
#if
ed-out code for v2 as that suffers from the same issue (ASIO#1619).rebuild.cmd
For convenience, they are attached as an archive, along with
vcpkg
configuration files I used to fetch Boost libs:Boost.Process-v1_Windows-pipe-name-clash_2025-04-09.zip
.Adjust the
BOOST_ROOT
variable value inrebuild.cmd
to point to the Boost directory that has its libs built statically (to model the real-life situation and avoid dependency onboost_process*.dll
).Run
rebuild.cmd
— it should produce, among others,EXE.exe
,DLL1.dll
andDLL2.dll
.DLL1.dll
andDLL2.dll
are identical and model two distinct plug-ins.Run
EXE.exe
.Expected:
Assuming the current directory is
F:\Experiments\Boost
, we should get some output like this:doubled and intertwined due to concurrent execution of two threads. E.g.:
Actual:
Due to both plug-ins trying to use the same pipe name, one of the child processes will fail to launch, so we get e.g.:
The text was updated successfully, but these errors were encountered: