Bun segfault crash after extended session
Resolved 💬 16 comments Opened Feb 2, 2026 by andrewcostello Closed Jun 13, 2026
Description
Claude Code crashes with a Bun segmentation fault after extended sessions (~18 minutes of usage).
Environment
- Claude Code version: 2.1.29
- Bun version (bundled): 1.3.5 (1e86cebd)
- OS: Linux x64 (Ubuntu, glibc v2.42)
- Kernel: 6.17.0
- CPU features: sse42 popcnt avx avx2
Crash Details
Bun v1.3.5 (1e86cebd) Linux x64 (baseline)
Linux Kernel v6.17.0 | glibc v2.42
CPU: sse42 popcnt avx avx2
Args: "claude" "--dangerously-skip-permissions"
Features: Bun.stderr(2) Bun.stdin(2) Bun.stdout(2) abort_signal(130) fetch(469) jsc spawn(188) standalone_executable process_dlopen
Builtins: "bun:main" "node:assert" "node:async_hooks" "node:buffer" "node:child_process" "node:constants" "node:crypto" "node:events" "node:fs" "node:fs/promises" "node:http" "node:https" "node:module" "node:net" "node:os" "node:path" "node:path/posix" "node:path/win32" "node:perf_hooks" "node:process" "node:querystring" "node:stream" "node:timers/promises" "node:tls" "node:tty" "node:url" "node:util" "node:zlib" "node:worker_threads" "undici" "ws" "node-fetch" "node:http2"
Elapsed: 1097622ms | User: 356186ms | Sys: 59734ms
RSS: 0.02ZB | Peak: 1.20GB | Commit: 0.02ZB | Faults: 0 | Machine: 0.13TB
panic(main thread): Segmentation fault at address 0x7508D628F148
oh no: Bun has crashed. This indicates a bug in Bun, not your code.
Bun Crash Report Link
Steps to Reproduce
- Run
claude --dangerously-skip-permissions - Use Claude Code for an extended session (~18+ minutes)
- Perform various operations (file reads, subagent spawns, etc.)
- Eventually crashes with segfault
Notes
- Peak memory was 1.20GB before crash
- The RSS reporting shows clearly incorrect values (0.02ZB) suggesting memory tracking issues
- This appears to be an upstream Bun bug, but reporting here since Bun is bundled with Claude Code
Possible Workaround
Restarting Claude Code sessions periodically before crashes occur.
16 Comments
Immediately after posting this I experienced the crash evoking Claude without --dangerously-skip-permissions
Same issue here — macOS (Apple Silicon)
Experiencing frequent crashes/disconnections on macOS Darwin 25.2.0 (arm64).
Environment
Investigation Summary
We spent significant time investigating this. Here's what we ruled out:
| Suspected Cause | Result |
|-----------------|--------|
|
--dangerously-skip-permissionsflag | ❌ Crashes with AND without it || Custom hooks (PreToolUse, PostToolUse, SessionStart) | ❌ Crashes with hooks completely removed |
| statusLine (custom command) | ❌ Crashes with statusLine completely removed |
| Bare minimum config (no hooks, no statusLine, no custom anything) | ❌ Still crashes |
Confirmed Separate Issue (tty race condition)
We did find and fix ONE crash trigger: writing escape sequences to tty during TUI rendering (e.g.,
printf '\e]0;title\a' > /dev/ttyfrom a background process). This causes 100% reproducible instant crash. But even after fixing this, random crashes continue.Crash Pattern
Conclusion
This appears to be an internal runtime issue (Bun segfault as described in this issue), not caused by any user configuration. The memory leak / RSS tracking bug mentioned here aligns with our observations.
Would appreciate any updates on this. 🙏
Is this related? Now let me check the pipeline to make sure the local classifier results will be accepted.
──────────────────────────────────────────────────────────────────
-- INSERT -- ⏵⏵ bypass permissions on (shift+tab to cycle) Context left until auto-compact: 2%
============================================================
Bun v1.3.5 (1e86cebd) Linux x64 (baseline)
Linux Kernel v6.17.10 | glibc v2.42
CPU: sse42 popcnt avx avx2
Args: "claude" "--continue" "--chrome" "--dangerously-skip-permissions"
Features: Bun.stderr(2) Bun.stdin(2) Bun.stdout(2) abort_signal(246) fetch(336) jsc spawn(339) standalone_executable process_dlopen
Builtins: "bun:main" "node:assert" "node:async_hooks" "node:buffer" "node:child_process" "node:constants" "node:crypto" "node:events" "node:fs" "node:fs/promises" "node:http" "node:https" "node:module" "node:net" "node:os" "node:path" "node:path/posix" "node:path/win32" "node:perf_hooks" "node:process" "node:querystring" "node:stream" "node:timers/promises" "node:tls" "node:tty" "node:url" "node:util" "node:zlib" "node:worker_threads" "undici" "ws" "node-fetch" "node:http2"
Elapsed: 1436015ms | User: 214656ms | Sys: 23567ms
RSS: 0.02ZB | Peak: 1.18GB | Commit: 0.02ZB | Faults: 11 | Machine: 67.18GB
panic(main thread): Segmentation fault at address 0x78310B677E20
oh no: Bun has crashed. This indicates a bug in Bun, not your code.
To send a redacted crash report to Bun's team,
please file a GitHub issue using the link below:
https://bun.report/1.3.5/B_11e86cebmgEuhogCk0iruE+syP______________0rsk/Dqli3jFstpglEyjgy/CA2ij8Bgi/9sL
fish: Job 1, 'claude --continue --chrome --da…' terminated by signal SIGILL (Illegal instruction)
Update: Bun Issue Filed
I've filed this crash upstream to the Bun repository: https://github.com/oven-sh/bun/issues/26984
New Data Point: macOS Silicon (Feb 2026)
Adding another confirmed case to the pattern:
0.02ZB✓ (same as all other reports)0x30(null pointer dereference)Elapsed: 215683236ms(~2494 days)Pattern Confirmation
This is 100% consistent with the pattern documented here:
0.02ZBThe Bun team now has visibility via issue #26984. This is clearly an upstream runtime bug in Bun's standalone executable implementation.
Only a 10m run...
✻ Nesting… (10m 17s · ↓ 16.5k tokens · thinking)
============================================================
Bun Canary v1.3.9-canary.62 (6d2fefba) Windows x64 (baseline)
Windows v.win11_dt
CPU: sse42 avx avx2 avx512
Args: "claude" "--dangerously-skip-permissions"
Features: Bun.stderr(2) Bun.stdin(2) Bun.stdout(2) abort_signal(127) fetch(481) jsc spawn(367) standalone_executable process_dlopen yaml_parse(92)
Builtins: "bun:main" "node:assert" "node:async_hooks" "node:buffer" "node:child_process" "node:constants" "node:crypto" "node:events" "node:fs" "node:fs/promises" "node:http" "node:https" "node:module" "node:net" "node:os" "node:path" "node:path/posix" "node:path/win32" "node:perf_hooks" "node:process" "node:stream" "node:timers/promises" "node:tls" "node:tty" "node:url" "node:util" "node:zlib" "node:worker_threads" "undici" "ws" "node:http2"
Elapsed: 6479382ms | User: 102500ms | Sys: 20093ms
RSS: 0.95GB | Peak: 1.51GB | Commit: 1.53GB | Faults: 2536281 | Machine: 0.21TB
panic(main thread): Segmentation fault at address 0xFFFFFFFFFFFFFFFF
oh no: Bun has crashed. This indicates a bug in Bun, not your code.
Same issue on WSL2 + i9-13900K, Claude Code 2.1.45 (Bun 1.3.10-canary.63)
dmesgreveals these are invalid opcode traps, not random segfaults — same instruction pointer every time:Environment:
• Claude Code 2.1.45 (native install)
• Bun v1.3.10-canary.63 (bundled)
• WSL2, Ubuntu 24.04, Kernel 6.6.87.2-microsoft-standard-WSL2
• CPU: Intel i9-13900K (flags: sse42 popcnt avx avx2, no avx512)
• RAM: 32GB, plenty free at time of crash
Reproduction: Happens on extended sessions and when resuming with (or without) --resume. Crashes are 100% reproducible over time — not sporadic.
Reproduces on Claude Code 2.1.50 (Bun v1.3.10) — Linux x64, ~3.4h session
Environment:
Crash output:
Bun crash report: https://bun.report/1.3.10/B_11423d3cmgkgEuhogC4oi5wE+ypRslpuiEslpuiEslpuiEslpuiEslpuiE____________m8q7hEA24//B3l9rj/B
Notable:
RSS: 0.02ZBis clearly a garbage value (should be ~1GB), consistent with memory corruption after a long run. Session ran for ~3.4 hours before crashing. Same--dangerously-skip-permissionsflag as other reports.Also seeing this on v2.1.50 with the bundled Bun v1.3.10.
I only started a session and then stepped away for about 20 minutes. I hadn't even run any commands yet, but the session had already crashed when I got back. Seems like it's hitting this even when idle.
Bun crash report:
https://bun.report/1.3.10/B_11423d3cmgEugogC4oi5wE+1vRslpuiEslpuiEslpuiEslpuiEslpuiEslpuiE____________A24//B36q/1zB
Cross-Platform Damage Escalation (Feb 24, 2026)
Linking this cross-platform Bun segfault tracker to the Windows-specific damage report:
On Windows (#21576), the Bun crash has escalated far beyond segfaults:
.claude.json) corrupted by mid-write truncationRoot cause confirmed by @balandari on #21875: N-API race condition (double-free). 27 memory dumps analyzed. Upstream filed at oven-sh/bun#26984.
For macOS/Linux users here: Are you seeing orphaned processes after crashes? On Windows they accumulate silently and eventually brick the machine.
high-priority+oncalllabels on #21875. Zero Anthropic comments anywhere. v2.1.52 shipped today with a VS Code fix.Windows Data Point: 4 Full System Lockups from Bun Crashes
Cross-posting from #21576: 26+ Bun crashes in 30 days on Windows, 4 requiring hard reboot (entire system frozen). Crash address 0x18 (null pointer deref), orphaned Bun processes exhaust system resources. Damage includes config file corruption, DNS corruption, and lost data.
v2.1.53's 4 Windows crash fixes did not address the root cause (N-API race condition in Bun v1.3.10). Root cause analysis with 27 memory dumps on #21875 — still zero staff response after 30+ days with high-priority + oncall labels.
Another data point — same segfault on macOS Silicon after a ~14-hour session.
Bun crash report: https://bun.report/1.3.10/M_1d885ce7mgkgE+hogD_uiu3uB25r2Tmp9mRmqxid+9vtnB20w8Cu1z8C2mk+C__u78++Cu/l1qCu1j1qC+2qxqCm8p+uCuv8/B__u78++CA2qmggEonggN
Same
0.02ZBCommit value as OP. Session involved normal interactive usage (tool calls, file reads/writes, shell commands) over an extended period.New data point: Bun v1.3.11, Windows x64, ~4-day session, non-main-thread crash
Confirms this bug persists in Bun v1.3.11 (latest bundled version, newer than any previous report in this thread).
Environment
Crash Details
Bun crash report: https://bun.report/1.3.11/e_1a2743b6mgkgE+hogCgs2hyCmj2hyCm/0hyCs6xhyCwsho3BimhoGikx1do++sf0y5wMmvw9U8839Uotqx1B8ll11Biw2n4Bqixj4B68uj4Bu754W4glvRCYKERNEL32.DLLut0LCSntdll.dll4oijBA2k+BgggkgyD
Notable differences from prior reports
| Detail | This crash | Most prior reports |
|--------|-----------|-------------------|
| Bun version | v1.3.11 (latest) | v1.3.5 – v1.3.10 |
| Crash thread | thread 41212 (worker) | main thread |
| Session duration | ~343,011s (~3.97 days) | Minutes to hours |
| Commit memory | 7.95GB (on 16.86GB machine) | Usually < 2GB |
| Page faults | 7,862,636 | Varies |
| RSS corruption | No (0.62GB looks valid) | Common (
0.02ZB) |Analysis
0.02ZBvalues seen in many other reports), suggesting a different corruption path.Cross-ref: Windows-specific root cause analysis in #21875.
Still hitting this on the latest standalone release.
Environment:
Crash output:
Crash report: https://bun.report/1.3.11/B_16f0a17cmgggEuhogC4ovilF+oxGg0tw4FutmgyEk6nz2E03p0nDk9q5iE0ns10E__2i1hvE2i1hvE2i1hvE2i1hvE_2i1hvE_2i1hvE2i1hvE_A2AAIllegal
Session ran ~40 minutes before crashing. RSS reached 1.06GB (peak was only 0.49GB, so the growth happened late).
Environment
VPS: Debian, Linux x64
CPU: sse42 popcnt avx avx2
RAM: 12 GB
Claude Code: 2.1.96 (native installer)
Bun: 1.3.11
What happened
Claude Code ran for ~3.5 hours, Bun had a memory leak (RSS reported as 0.02ZB)
Bun crashed with Segmentation fault, saturating all system resources (fork: Resource temporarily unavailable)
After VPS reboot, the native binary crashes immediately with "Illegal instruction"
Reinstalling via install.sh also fails with "Out of memory"
Bun 1.3.11 installed separately works fine (bun --version responds)
Workaround: npm install works
Crash log
Bun v1.3.11 (6f0a17c3) Linux x64 (baseline)
panic(main thread): Illegal instruction at address 0x48363A4
Expected behavior
Native installer should recover/reinstall cleanly after a Bun crash.
New data point: macOS Apple Silicon + tmux multi-worker session (May 2026)
Scenario: Claude Code orchestrator pane dispatching tasks to 6 worker panes via
tmux send-keys. After ~3 minutes of parallel processing, Claude Code crashed with a Bun segfault.Error:
Crash report:
https://bun.report/1.3.14/M_1d298914mgkgkEuhooC_mhu5yC2lu3yC+2t3yCurs3yCu2826C+jvx5C__________A2AohBEnvironment:
Notes:
Closing for now — inactive for too long. Please open a new issue if this is still relevant.