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
{{ message }}
Repository navigation
Commit 9dfdac6
Browse filesBrowse the repository at this point in the historyBrowse files
util: Fix Windows SpawnProcess hang when child exits before connecting to named pipe
SpawnProcess on Windows creates a named pipe with PIPE_WAIT and then calls
ConnectNamedPipe synchronously. If the child exits or crashes before
connecting, ConnectNamedPipe blocks forever with no recovery path.
Fix by opening the pipe with FILE_FLAG_OVERLAPPED and using
WaitForMultipleObjects on both the connect event and the child process
handle. If the process handle signals first, the child died without
connecting and SpawnProcess throws instead of hanging. Since the pipe is
now in overlapped mode, WriteFile also requires an OVERLAPPED structure;
use GetOverlappedResult with bWait=TRUE to handle both synchronous and
asynchronous completion.
Add a Windows-only test that spawns a child which exits immediately
without opening the named pipe and asserts SpawnProcess does not block.
(bitcoin-core#231 (comment))
Co-Authored-By: ViniciusCestarii <viniciuscestari01@gmail.com>
This change was written with Claude Sonnet 4.6.
0 commit comments