deps: cherry-pick libuv/libuv@a6d06ba - #65092
Open
yury-s wants to merge 1 commit into
Open
Conversation
Original commit message:
win: fix crash when closing a pipe after a failed bind
uv_pipe_pending_instances() sets the UV_HANDLE_PIPESERVER flag before the
pipe is bound. When the subsequent bind fails, e.g. with UV_EADDRINUSE
after losing a bind race on a well-known pipe name, uv_pipe_bind2() frees
accept_reqs and resets it to NULL, but the flag stays set. Closing the
handle then dereferences the NULL accept_reqs array in uv__pipe_close()
(release builds crash with an access violation; debug builds trip the
assert in uv__pipe_endgame()).
Tolerate accept_reqs == NULL at both cleanup sites.
Fixes: nodejs#65057
Refs: libuv/libuv#5224
Refs: libuv/libuv@a6d06ba
Collaborator
|
Review requested:
|
avivkeller
approved these changes
Aug 7, 2026
avivkeller
left a comment
Member
There was a problem hiding this comment.
Commit content matches that of upstream
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-pick the libuv fix for a crash on Windows: with
NODE_PENDING_PIPE_INSTANCESset, a process that loses a named-pipe bind race (EADDRINUSEfrom a concurrentlisten()on the same pipe name) dies with an access violation (0xC0000005) while closing the failed server handle.uv_pipe_pending_instances()pre-setsUV_HANDLE_PIPESERVER, the failed bind resetsaccept_reqstoNULL, anduv__pipe_close()then dereferences theNULLarray.The upstream commit includes a regression test (
pipe_bind_error_addrinuse_pending_instances).Fixes: #65057
Refs: libuv/libuv#5224
Refs: libuv/libuv@a6d06ba