[Windows] `kimi web` exits with 0xC0000409 (FAST_FAIL_STACK_COOKIE_CHECK_FAILURE) — bundled Node 24.15.0 carries the known libuv RtlGetVersion stack overflow
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 74/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- node.js, typescript
Hướng nghiên cứu
Đọc .nvmrc và .github/workflows/_native-build.yml để xác nhận phiên bản Node nào được nhúng trong bản dựng native. Kiểm tra các bản sửa lỗi Node và libuv upstream được tham chiếu, sau đó cập nhật phiên bản runtime để các tệp nhị phân Windows có bản sửa lỗi. Hoàn tất khi bản dựng native sử dụng một bản phát hành Node đã được sửa lỗi và sự cố Windows được báo cáo không còn tái hiện.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What version of Kimi Code is running?
2.5.2 (native Windows binary, FileVersion 24.15.0, i.e. the bundled Node runtime)
Note: this is not fixed on the current latest. .nvmrc is still 24.15.0 on main and on tag @moonshot-ai/[email protected], and .github/workflows/_native-build.yml builds the SEA with node-version-file: .nvmrc, so every shipped Windows binary carries the vulnerable runtime.
Which open platform/subscription were you using?
kimi-for-coding (managed:kimi-code). The crash is provider-independent — it also happens with a custom OpenAI-compatible provider, because it is in the TCP connect path, not in the model request path.
Which model were you using?
deepseek-v4.1-flash via a custom OpenAI-compatible provider (also reproduced with kimi-for-coding).
What platform is your computer?
Microsoft Windows NT 10.0.26300.0 x64 (Windows 11, build 26300)
What issue are you seeing?
kimi web on Windows dies silently after anywhere from a few minutes to a few hours of normal use:
- no JS error, no stack trace, no log line in
--log-level infooutput - no Windows Error Reporting entry (the process is killed by a fail-fast, so WER never runs)
- the only trace is the process exit code
exit code 0xC0000409 (STATUS_STACK_BUFFER_OVERRUN)
ExceptionCode 0xC0000409
ExceptionInformation[0] = 0x2 (FAST_FAIL_STACK_COOKIE_CHECK_FAILURE)
Faulting address: kimi.exe+0x21F2189 (__report_gsfailure, int 0x29)
Observed crashes on one machine (2026-11-13), all started with kimi web --port 5090 --host --log-level info:
| started | died | exit code |
|---|---|---|
| 21:10:37 (official 2.5.2 binary, launched under procdump) | 21:50:34 | 0xC0000409 |
| 22:35:35 (2.5.2 from source, Node 24.15.0) | 23:31:44 | 0xC0000409 |
| 23:36:46 (same) | 23:44:22 | 0xC0000409 |
This has been happening consistently for weeks, on both the TUI and kimi web.
What steps can reproduce the bug?
In production it is probabilistic: just run the server and use it normally (the web UI, long sessions, tool calls). It correlates with number of outbound TCP connects, not with any particular request — every connect calls into the vulnerable code path.
The upstream libuv issue (libuv/libuv#5394) has a deterministic reproducer; it crashed 32/80 rounds on Node v24.15.0 on the reporter's machine. On my machine I could not make it fire in 70 runs of that same script — the trigger depends on what value happens to be left in one uninitialized stack slot, so the rate varies by machine/build — but the crash dumps prove the mechanism below.
// repro.mjs — from libuv/libuv#5394
import { createServer } from "node:http";
for (let i = 0; i < 84; i++) {
const server = createServer((req, res) => {
req.on("data", () => {});
req.on("end", () => {
res.writeHead(200, { "Content-Type": "application/json; charset=utf-8" });
res.end("{}");
});
});
await new Promise((resolve) => server.listen(0, "127.0.0.1", resolve));
const port = server.address().port;
const res = await fetch(`http://127.0.0.1:${port}/x`, {
signal: AbortSignal.timeout(30000),
});
await res.text();
await new Promise((resolve, reject) => server.close((e) => (e ? reject(e) : resolve())));
}
for ($r = 1; $r -le 80; $r++) {
node repro.mjs 2>&1 | Out-Null
if ($LASTEXITCODE -ne 0) { "round $r crashed: 0x{0:x8}" -f ($LASTEXITCODE -band 0xFFFFFFFFL) }
}
What is the expected behavior?
The server process stays up. If it must fail, it should log something actionable instead of vanishing.
Additional information
Full root cause, confirmed from a procdump -e -ma full-memory dump of the crash:
The crash is a stack-buffer overflow inside libuv, not in kimi code.
-
In
deps/uv/src/win/tcp.c,uv__is_fast_loopback_fail_supported()(renameduv__windows10_version1709()in libuv 1.52) does:OSVERSIONINFOW os_info; /* 276 bytes, dwOSVersionInfoSize NOT initialized */ if (!pRtlGetVersion) return 0; pRtlGetVersion(&os_info); -
ntdll!RtlGetVersionbranches on the (uninitialized)dwOSVersionInfoSize. If that field happens to equal0x11c(284,sizeof(RTL_OSVERSIONINFOEXW)), it takes the "EX" path and writes 284 bytes into the 276-byteOSVERSIONINFOW. -
In the clang-cl-built Node 24.15.0 frame for
uv__tcp_try_connect,os_infosits at[rsp+0xd4]and ends at exactly[rsp+0x1e8]— which is the compiler's/GScookie slot. The 8 extra bytes land on the cookie:[rsp+0x1e8] = 0x0001010000000000 ^^ ServicePackMajor = 0 ^^ ServicePackMinor = 0 ^^ SuiteMask = 0x0100 ^^ ProductType = 1 (VER_NT_WORKSTATION) -
The function returns through
__security_check_cookie, the check fails, and__report_gsfailurecalls__fastfail(FAST_FAIL_STACK_COOKIE_CHECK_FAILURE)→0xC0000409. No handler can run; the process is gone. -
I reproduced step 2 in isolation (call
RtlGetVersionon a 276-byte buffer withdwOSVersionInfoSize = 0x11c): the 8 bytes after the buffer become00 00 00 00 00 01 01 xx, exactly the value found in the cookie slot in the dump. -
Symbolized stack from the dump (with the published
node.pdbfor v24.15.0):__report_gsfailure @ .../vcstartup/src/gs/gs_report.c:220 uv__tcp_try_connect @ deps/uv/src/win/tcp.c uv_tcp_connect @ deps/uv/src/uv-common.c:411 node::MakeLibuvRequestCallback<uv_connect_t,...> @ src/req_wrap-inl.h:126 node::TCPWrap::Connect @ src/tcp_wrap.cc:469 ... v8 FunctionCallback ... -
Fixed upstream in libuv by initializing the struct — libuv/libuv#5107 (
os_info.dwOSVersionInfoSize = sizeof(os_info); os_info.szCSDVersion[0] = L'\0';), cherry-picked into Node via nodejs/node#62561. It is present from Node v24.16.0 onward. I verifieddeps/uv/src/win/tcp.cper tag:Node libuv struct initialized kimi ships it v24.15.0 1.51.0 no yes (2.5.2 … 2.6.3) v24.20.0 / v24.21.0 / v24.22.0 1.52.1 yes no v26.13.1 1.52.1 yes no (Node v26.0.0 is also unfixed; the fix landed in 26.5.0. v22.x is latent-but-unobservable because its MSVC frame has a gap before the cookie.)
-
Because the vulnerable probe runs on every
uv_tcp_connect, the rate scales with how many connections the process makes — which is why long-runningkimi websessions with remote UI clients die and short ones usually do not.
Suggested fix: bump .nvmrc to a Node that carries the fix (v24.16.0+, e.g. the latest 24.x LTS line) so the native SEA build embeds a fixed libuv. package.json has engines.node >= 24.15.0, so this needs no other change.
User-side workaround until then: run from source with Node >= 24.16.0 (pnpm dev:server / node --import tsx ./src/main.ts web ...), which is unfixed at 24.15.0 and clean at 24.21.0.
Upstream references:
- libuv/libuv#5394 — deterministic reproducer + per-version crash rates (open)
- libuv/libuv#5107 — the fix (merged)
- nodejs/node#62561 — cherry-pick into Node (v24.16.0)
- Ngôn ngữ chính
- TypeScript
- Star
- 8.3k
- Fork
- 1.4k
- Merge trung bình
- 12 giờ 6 phút
- Pull request đã merge (30 ngày)
- 596
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của MoonshotAI/kimi-code
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
MoonshotAI/kimi-code#5539 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] Kimi RC workspace folder picker does not display symbolic link directoriesCó thể đã có người làm @markankamaransheogarat-sys đã nhận 2 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
MoonshotAI/kimi-code#5296 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
MoonshotAI/kimi-code#5256 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
MoonshotAI/kimi-code#5062 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
MoonshotAI/kimi-code#5025 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của MoonshotAI/kimi-code
Issue tương tự
-
Add Alice&BotĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
slavakurilyak/awesome-ai-agents#1048 ·
-
bot:ai-assisted component:faucet github_actions security status:untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
midnightntwrk/midnight-faucet-api#215 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[功能] 手机端命令执行显示 AI 动作描述Đang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
NanmiCoder/cc-haha#2034 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
mobile prio:low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
digitalfabrik/entitlementcard#3324 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày