-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Description
What version of Bun is running?
1.3.10+30e609e08
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What steps can reproduce the bug?
Steps to Reproduce
- Windows 11 x64, Intel i9-14900HX, 32GB RAM
- Install Claude Code (native or npm — both affected)
- Run extended Claude Code sessions (30+ minutes) with moderate tool usage
- System BSODs — no user-mode crash dialog, straight to kernel panic
What is the expected behavior?
- Investigate how Bun's user-mode memory corruption propagates to kernel crashes — the N-API race conditions and GC corruption documented in [Windows] N-API vtable corruption causes segfault, TUI escape, and orphaned processes in Bun v1.3.10 #27471 and Repeated Bun v1.3.5 segfaults -- 78 crashes, root cause identified (Windows + WSL) anthropics/claude-code#21875 appear to be severe enough to corrupt kernel-visible structures
- Fix the underlying N-API async cleanup race condition — this has been identified since March 2025 (Worker Thread causes SEGFAULT after worker exit #18198) and confirmed across Bun 1.3.5 through 1.3.10
- Implement proper process cleanup on crash — orphaned Bun processes accumulating 1GB+ each contribute to system-wide instability
What do you see instead?
Bun crashes (via Claude Code) are escalating beyond application-level segfaults into full Windows kernel crashes (BSODs), forcing hard reboots. This goes beyond the documented Bun crash behaviour — the crashes are corrupting kernel-mode data structures and taking the entire OS down.
5 BSODs documented across 2 days (1-2 March 2026), all during or immediately after Claude Code sessions. WhoCrashed analysis attached below.
Environment
| Component | Value |
|---|---|
| OS | Windows 11, Build 26200 (x64) |
| CPU | Intel Core i9-14900HX (32 logical processors) |
| RAM | 32GB |
| Hardware | PCSpecialist Recoil VIII 17 (TongFang GM7IX8N) |
| Claude Code | Latest version at time of crashes |
| Bun | v1.3.10 (embedded in Claude Code) |
| Installation methods tested | Windows native install, npm install — both crash |
BSOD Crash Details
Crash 1 — Mon 02/03/2026 14:24:04
- Bugcheck:
0x139—KERNEL_SECURITY_CHECK_FAILURE - Parameters:
(0xA, 0x0, 0x0, 0xFFFFEF82EFE267F0) - Description: Kernel detected corruption of a critical data structure
- Dump:
C:\Windows\Minidump\030226-24468-01.dmp
Crash 2 — Sun 01/03/2026 17:52:09
- Bugcheck:
0x139—KERNEL_SECURITY_CHECK_FAILURE - Parameters:
(0xA, 0x0, 0x0, 0xFFFFE2809452E7F0) - Description: Kernel detected corruption of a critical data structure
- Dump:
C:\Windows\Minidump\030126-25015-01.dmp
Crash 3 — Sun 01/03/2026 17:44:09
- Bugcheck:
0x1E—KMODE_EXCEPTION_NOT_HANDLED - Parameters:
(0xFFFFFFFFC0000005, 0xFFFFF806910B30B0, 0x0, 0xFFFFFFFFFFFFFFFF) - Description: Kernel-mode program generated an unhandled exception
- Dump:
C:\Windows\Minidump\030126-24234-01.dmp
Crash 4 — Sun 01/03/2026 17:23:19
- Bugcheck:
0x1E—KMODE_EXCEPTION_NOT_HANDLED - Parameters:
(0xFFFFFFFFC0000005, 0xFFFFF806B904DF17, 0x0, 0xFFFFFFFFFFFFFFFF) - Dump:
C:\Windows\Minidump\030126-24812-01.dmp
Crash 5 — Sun 01/03/2026 17:16:08
- Bugcheck:
0x50—PAGE_FAULT_IN_NONPAGED_AREA - Parameters:
(0xFFFFF806CD582E50, 0x10, 0xFFFFF8064D582E50, 0x2) - Module:
Ntfs.sys(NT File System Driver) - Dump:
C:\Windows\Minidump\030126-23296-01.dmp
Note: Crashes 3, 4, and 5 occurred within a 36-minute window (17:16-17:52), suggesting cascade degradation consistent with the pattern documented in anthropics/claude-code#21875.
Why This Is a Bun Issue
WhoCrashed analysis found no offending third-party drivers. The bugcheck codes point to memory corruption, not driver bugs. The key observations:
- Crashes only occur during Claude Code sessions — the system is otherwise stable under heavy workloads (gaming, development, etc.)
- The 0x139 parameter 1 = 0xA indicates
LIST_ENTRYcorruption — consistent with heap corruption from a user-mode process propagating into kernel structures - The 0x1E with code 0xC0000005 (
ACCESS_VIOLATION) at kernel addresses suggests corrupted pointers being passed to kernel-mode code paths - The Ntfs.sys crash suggests Bun's I/O operations (heavy file reads/writes during Claude Code sessions) may be triggering file system corruption
- Both npm and native install methods crash identically — ruling out installation-specific causes
This is consistent with the root cause analysis in anthropics/claude-code#21875, which identified:
- N-API async cleanup race conditions (use-after-free)
- NaN-boxing value corruption in JSC GC
- Orphaned processes leaking 1GB+ each ([BUG] orphaned processes from subagents crashing computer anthropics/claude-code#18405)
When Bun's memory corruption is severe enough, it appears to corrupt structures that subsequently cause kernel-mode crashes — particularly through the file system path (Ntfs.sys).
Related Issues
Bun repo
- [Windows] N-API vtable corruption causes segfault, TUI escape, and orphaned processes in Bun v1.3.10 #27471 — N-API vtable corruption, segfaults, orphaned processes, full computer lockups (Bun v1.3.10)
- panic: switch on corrupt value in string.zig during long-running session on Windows #27099 —
switch on corrupt valueinstring.zigduring long sessions on Windows - panic(main thread): switch on corrupt value - Claude Code on Windows x64 #27138 —
switch on corrupt value, Claude Code on Windows x64 - Worker Thread causes SEGFAULT after worker exit #18198 — Worker thread cleanup use-after-free (known since March 2025)
Claude Code repo (downstream consumer)
- Repeated Bun v1.3.5 segfaults -- 78 crashes, root cause identified (Windows + WSL) anthropics/claude-code#21875 — 78 crashes, root cause identified (N-API race condition + NaN-boxing corruption), 27 memory dumps, WinDbg analysis
- [BUG] orphaned processes from subagents crashing computer anthropics/claude-code#18405 — Orphaned processes from subagents crashing computer
- [BUG] Repeated Bun panic "switch on corrupt value" on Windows 11 x64 during long sessions (v2.1.50 / Bun 1.3.10) anthropics/claude-code#27847 —
switch on corrupt valuepersists on Bun 1.3.10
Severity
This is not just an application crash. Bun's memory corruption is causing operating system kernel crashes requiring hard reboots. This risks:
- Data loss from unsaved work across all applications
- File system corruption (the Ntfs.sys crash is a red flag)
- Potential hardware damage from repeated unclean shutdowns
- SSD wear from unexpected power loss events
030126-23296-01.dmp
030126-24234-01.dmp
030126-24812-01.dmp
030126-25015-01.dmp
030226-24468-01.dmp
Additional information
No response