Skip to content

deps: libuv: cherry-pick aabb7651de#62561

Open
aduh95 wants to merge 2 commits intonodejs:mainfrom
aduh95:libuv-fix
Open

deps: libuv: cherry-pick aabb7651de#62561
aduh95 wants to merge 2 commits intonodejs:mainfrom
aduh95:libuv-fix

Conversation

@aduh95
Copy link
Copy Markdown
Contributor

@aduh95 aduh95 commented Apr 2, 2026

panjf2000 and others added 2 commits April 2, 2026 12:35
Original commit message:

  tcp: support customizing TCP_KEEPINTVL and TCP_KEEPCNT

  Implement `uv_tcp_keepalive_ex` function that extends
  `uv_tcp_keepalive` to support `TCP_KEEPINTVL` and `TCP_KEEPCN`
  socket options in addition to TCP_KEEPIDLE.

Refs: libuv/libuv@3a9a6e3
Original commit message:

  win: properly initialize OSVERSIONINFOW (nodejs#5107)

  Otherwise calling `RtlGetVersion()` might produce UB. Problem was
  causing random crashes in the node.js test suite with stack traces like
  this one:
  ```
  node.exe!__report_gsfailure(unsigned __int64 stack_cookie) Line 220
    at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\gs\gs_report.c(220)
  node.exe!uv__tcp_keepalive(uv_tcp_s * socket, unsigned __int64 on, int idle, unsigned int intvl, unsigned int cnt, unsigned int) Line 109
    at E:\node\deps\uv\src\win\tcp.c(109)
  [Inline Frame] node.exe!uv_tcp_keepalive_ex(uv_tcp_s * handle, int on, unsigned int idle, unsigned int intvl, unsigned int cnt) Line 1406
    at E:\node\deps\uv\src\win\tcp.c(1406)
  node.exe!uv_tcp_keepalive(uv_tcp_s * handle, int on, unsigned int idle) Line 1395
    at E:\node\deps\uv\src\win\tcp.c(1395)
  node.exe!node::TCPWrap::SetKeepAlive(const v8::FunctionCallbackInfo<v8::Value> & args) Line 213
    at E:\node\src\tcp_wrap.cc(213)
  [External Code]
  node.exe!v8::internal::`anonymous namespace'::Invoke(v8::internal::Isolate * isolate, const v8::internal::`anonymous namespace'::InvokeParams & params) Line 463
    at E:\node\deps\v8\src\execution\execution.cc(463)
  node.exe!v8::internal::Execution::Call(v8::internal::Isolate * isolate, v8::internal::DirectHandle<v8::internal::Object> callable, v8::internal::DirectHandle<v8::internal::Object> receiver, v8::base::Vector<const v8::internal::DirectHandle<v8::internal::Object>> args) Line 532
    at E:\node\deps\v8\src\execution\execution.cc(532)
  node.exe!v8::Function::Call(v8::Isolate * isolate, v8::Local<v8::Context> context, v8::Local<v8::Value> recv, int argc, v8::Local<v8::Value> * argv) Line 5374
    at E:\node\deps\v8\src\api\api.cc(5374)
  node.exe!v8::Function::Call(v8::Local<v8::Context> context, v8::Local<v8::Value> recv, int argc, v8::Local<v8::Value> * argv) Line 5381
    at E:\node\deps\v8\src\api\api.cc(5381)
  node.exe!node::InternalMakeCallback(node::Environment * env, v8::Local<v8::Object> resource, v8::Local<v8::Object> recv, const v8::Local<v8::Function> callback, int argc, v8::Local<v8::Value> * argv, node::async_context asyncContext, v8::Local<v8::Value> context_frame) Line 257
    at E:\node\src\api\callback.cc(257)
  node.exe!node::AsyncWrap::MakeCallback(const v8::Local<v8::Function> cb, int argc, v8::Local<v8::Value> * argv) Line 695
    at E:\node\src\async_wrap.cc(695)
  [Inline Frame] node.exe!node::AsyncWrap::MakeCallback(const v8::Local<v8::Name> symbol, int argc, v8::Local<v8::Value> * argv) Line 101
    at E:\node\src\async_wrap-inl.h(101)
  [Inline Frame] node.exe!node::AsyncWrap::MakeCallback(const v8::Local<v8::String> symbol, int argc, v8::Local<v8::Value> * argv) Line 78
    at E:\node\src\async_wrap-inl.h(78)
  node.exe!node::ConnectionWrap<node::TCPWrap,uv_tcp_s>::OnConnection(uv_stream_s * handle, int status) Line 73
    at E:\node\src\connection_wrap.cc(73)
  node.exe!uv__process_tcp_accept_req(uv_loop_s * loop, uv_tcp_s * handle, uv_req_s * raw_req) Line 1245
    at E:\node\deps\uv\src\win\tcp.c(1245)
  node.exe!uv__process_reqs(uv_loop_s * loop) Line 622
    at E:\node\deps\uv\src\win\core.c(622)
  node.exe!uv_run(uv_loop_s * loop, <unnamed-tag> mode) Line 736
    at E:\node\deps\uv\src\win\core.c(736)
  node.exe!node::SpinEventLoopInternal(node::Environment * env) Line 43
    at E:\node\src\api\embed_helpers.cc(43)
  [Inline Frame] node.exe!node::NodeMainInstance::Run(node::ExitCode * exit_code, node::Environment * env) Line 109
    at E:\node\src\node_main_instance.cc(109)
  node.exe!node::NodeMainInstance::Run() Line 99
    at E:\node\src\node_main_instance.cc(99)
  [Inline Frame] node.exe!node::StartInternal(int argc, char * * argv) Line 1576
    at E:\node\src\node.cc(1576)
  node.exe!node::Start(int argc, char * * argv) Line 1583
    at E:\node\src\node.cc(1583)
  node.exe!wmain(int argc, wchar_t * * wargv) Line 91
    at E:\node\src\node_main.cc(91)
  ```

  Fixes: libuv/libuv#5106

Refs: libuv/libuv@aabb765
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/security-wg

@nodejs-github-bot nodejs-github-bot added libuv Issues and PRs related to the libuv dependency or the uv binding. needs-ci PRs that need a full CI run. labels Apr 2, 2026
@aduh95 aduh95 added dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. dont-land-on-v24.x PRs that should not land on the v24.x-staging branch and should not be released in v24.x. dont-land-on-v25.x PRs that should not land on the v25.x-staging branch and should not be released in v25.x. labels Apr 2, 2026
@aduh95 aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. and removed dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. dont-land-on-v24.x PRs that should not land on the v24.x-staging branch and should not be released in v24.x. labels Apr 2, 2026
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 2, 2026
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. dont-land-on-v25.x PRs that should not land on the v25.x-staging branch and should not be released in v25.x. libuv Issues and PRs related to the libuv dependency or the uv binding. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants