claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Bun crashes leads to Claude Code crashing

Open Richard-Starrtec opened this issue 1 year ago • 15 comments

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Bun is erroring that then leads to CC crashing. Happened multiple times over the last couple of days and just using CC "normally"

What Should Happen?

Should not be crashing

Error Messages/Logs

<img width="1916" height="918" alt="Image" src="https://github.com/user-attachments/assets/75feba78-7f12-45d7-987b-2aad8a0d7264" />

<img width="1920" height="570" alt="Image" src="https://github.com/user-attachments/assets/3ce85455-c694-4891-bc67-d443abf5305d" />

<img width="1918" height="488" alt="Image" src="https://github.com/user-attachments/assets/b6203adf-8c20-4c12-bbb9-52d2cb56c2ed" />

<img width="1912" height="590" alt="Image" src="https://github.com/user-attachments/assets/1cb7af32-fd4b-4cb4-9547-727d991d878a" />

Steps to Reproduce

I'm just using CC normally and not doing anything in particular

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.0.20

Claude Code Version

2.0.20

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Warp

Additional Information

No response

Richard-Starrtec avatar Oct 21 '25 03:10 Richard-Starrtec

I have the same problem. It looks like it’s a Bun bug. The log output essentially confirms this.

PS C:\Users\[MASKED_CURRENT_DIRECTORY]> claude
============================================================
Bun v1.2.23 (cf136713) Windows x64 (baseline)
Windows v.win11_dt
CPU: sse42 avx avx2 avx512
Args: "C:\Users\[MASKED_USER_NAME]\.local\bin\claude.exe"
Features: Bun.stderr(2) Bun.stdin(2) Bun.stdout(2) dotenv(2) jsc spawn standalone_executable
Builtins: "bun:main" "node:assert" "node:async_hooks" "node:buffer" "node:child_process" "node:constants" "node:crypto" "node:domain" "node:events" "node:fs" "node:fs/promises" "node:http" "node:https" "node:module" "node:net" "node:os" "node:path" "node:path/win32" "node:perf_hooks" "node:process" "node:querystring" "node:stream" "node:string_decoder" "node:timers/promises" "node:tls" "node:tty" "node:url" "node:util" "node:zlib" "node:worker_threads" "undici" "ws" "node-fetch" "node:inspector" "node:http2"
Elapsed: 657ms | User: 609ms | Sys: 156ms
RSS: 0.31GB | Peak: 0.31GB | Commit: 0.40GB | Faults: 77281 | Machine: 16.83GB

panic(main thread): Unexpected error
ENOTCONN: Transport endpoint is not connected (open())
oh no: Bun has crashed. This indicates a bug in Bun, not your code.

kimitaka avatar Oct 21 '25 05:10 kimitaka

three more times today and below is from the last one

Image

Richard-Starrtec avatar Oct 24 '25 06:10 Richard-Starrtec

And again!!

Is this just a way for me to burn more tokens as I have to do the task again!!

● Read(D:\Development\IndyDevDan\TAC\tac-8\tac8_app3__out_loop_multi_agent_task_board.claude\commands\plan.md) ⎿  Read 112 lines ⎿  Running PostToolUse hook…

∴ Thought for 1s (ctrl+o to show thinking)

· Symbioting… (esc to interrupt)

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

  ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── git:feature/SP-284-Vii | D:\Development\starrpos | ctx:run /context Thinking on (tab to toggle) ============================================================ Bun v1.3.0 (b0a6feca) Windows x64 (baseline) Windows v.win11_dt CPU: sse42 avx avx2 Args: "C:\Users\RichardMoore.local\bin\claude.exe" Features: Bun.stderr(2) Bun.stdin(2) Bun.stdout(2) fetch(146) jsc spawn(209) standalone_executable Builtins: "bun:main" "node:assert" "node:async_hooks" "node:buffer" "node:child_process" "node:constants" "node:crypto" "node:domain" "node:events" "node:fs" "node:fs/promises" "node:http" "node:https" "node:module" "node:net" "node:os" "node:path" "node:path/win32" "node:perf_hooks" "node:process" "node:querystring" "node:stream" "node:string_decoder" "node:timers/promises" "node:tls" "node:tty" "node:url" "node:util" "node:zlib" "node:worker_threads" "undici" "ws" "node-fetch" "node:inspector" "node:http2" "node:diagnostics_channel" Elapsed: 53937ms | User: 11890ms | Sys: 4703ms RSS: 0.47GB | Peak: 0.62GB | Commit: 0.58GB | Faults: 580295 | Machine: 34.19GB

panic(main thread): Segmentation fault at address 0xFFFFFFFFFFFFFFFF 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.0/e_1b0a6fecAz/7v//Bg6y+zB6jx+zByo95IwjlnG2pwisByuxvFmwZqhJoq1p3DCYKERNEL32.DLLut0LCSntdll.dll4t0EA2DD

Richard-Starrtec avatar Oct 24 '25 06:10 Richard-Starrtec

FYI, Rather then use Warp as my terminal I've been trying the Windows native one for a few hours and so far no errors

:)

Richard-Starrtec avatar Oct 24 '25 07:10 Richard-Starrtec

Image

Bun v1.3.2 (b131639c) Linux x64 (baseline) Linux Kernel v6.17.0 | glibc v2.42 CPU: sse42 popcnt avx avx2 Args: "claude" Features: Bun.stderr(2) Bun.stdin(2) Bun.stdout(2) fetch(78) jsc spawn(20) standalone_executable workers_spawned(9) workers_terminated(9) Builtins: "bun:main" "node:assert" "node:async_hooks" "node:buffer" "node:child_process" "node:constants" "node:crypto" "node:domain" "node:events" "node:fs" "node:fs/promises" "node:http" "node:https" "node:module" "node:net" "node:os" "node:path" "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:inspector" "node:http2" "node:diagnostics_channel" Elapsed: 7415ms | User: 6562ms | Sys: 2171ms RSS: 0.84GB | Peak: 1.25GB | Commit: 0.84GB | Faults: 0 | Machine: 0.18TB

panic(main thread): Segmentation fault at address 0xE8 oh no: Bun has crashed. This indicates a bug in Bun, not your code.

SaptaDey avatar Dec 03 '25 01:12 SaptaDey

i seem to be experiencing a similar issue, but running in a container on Linux, Claude Code v2.0.65, with Haiku 4.5.

Image

at any rate, it's a Bun segfault, quite some time (and tokens!) into the session. bummer.

============================================================
Bun v1.3.4 (5eb2145b) Linux x64 (baseline)
Linux Kernel v4.15.0 | glibc v2.39
CPU: sse42 popcnt avx avx2
Args: "claude"
Features: Bun.stderr(2) Bun.stdin(2) Bun.stdout(2) fetch(16) jsc spawn(52) standalone_executable process_dlopen 
Builtins: "bun:main" "node:assert" "node:async_hooks" "node:buffer" "node:child_process" "node:constants" "node:crypto" "node:domain" "node:events" "node:fs" "node:fs/promises" "node:http" "node:https" "node:module" "node:net" "node:os" "node:path" "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:inspector" "node:http2" 
Elapsed: 1322896ms | User: 157016ms | Sys: 56321ms
RSS: 34.20MB | Peak: 0.47GB | Commit: 34.20MB | Faults: 2 | Machine: 16.67GB

panic: Segmentation fault at address 0x0
oh no: Bun has crashed. This indicates a bug in Bun, not your code.

should i open a separate ticket for a Bun segfault on Linux as this one says platform:windows?

P.S. hopefully we can expect a blazing fast resolution, now that Bun folks have joined Anthropic, and all? 😉

lev-lb avatar Dec 14 '25 03:12 lev-lb

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] avatar Jan 13 '26 10:01 github-actions[bot]

I am still facing this issue.

Naveen90Git avatar Feb 05 '26 22:02 Naveen90Git

Bun v1.3.5 (1e86cebd) macOS Silicon
macOS v15.7
CPU: fp aes crc32 atomics
Args: "claude" "--continue"
Features: Bun.stderr(2) Bun.stdin(2) Bun.stdout(2) abort_signal(4) fetch(10) jsc spawn(21) 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: 94060ms | User: 19085ms | Sys: 1753ms
RSS: 0.38GB | Peak: 0.51GB | Commit: 1.00GB | Faults: 72 | Machine: 17.18GB

panic(main thread): Bus error at address 0x20202020200ABABB
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/M_11e86cebmgEuhogC__A4giwgkgB2r9qhgB

copy202 avatar Feb 06 '26 01:02 copy202

Bun v1.3.10 (1423d3c8) Windows x64 (baseline)
Windows v.win11_dt
CPU: sse42 avx avx2
Args: "C:\Users\cso-c\.local\bin\claude.exe"
Features: Bun.stderr(2) Bun.stdin(2) Bun.stdout(2) abort_signal(27) fetch(86) jsc spawn(100) standalone_executable process_dlopen(3) yaml_parse(232)
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: 996262ms | User: 35562ms | Sys: 15375ms
RSS: 1.31GB | Peak: 1.49GB | Commit: 1.88GB | Faults: 1963656 | Machine: 68.39GB

panic(main thread): Segmentation fault at address 0xFFFFFFFFFFFFFFFF
oh no: Bun has crashed. This indicates a bug in Bun, not your code.

Christian-Oleson avatar Feb 19 '26 03:02 Christian-Oleson

how to fix it ? looks that I have this issue since I switched to subscription mode

Palkers76 avatar Feb 21 '26 17:02 Palkers76

it's annoying , FIX it

Palkers76 avatar Feb 21 '26 18:02 Palkers76

Still Unresolved — This Was One of the First Reports

This issue was filed months ago. The Bun crash problem on Windows has only expanded since — now 20+ separate issues, 90+ unique affected users.

v2.1.53 shipped 4 targeted crash fixes (WASM, ARM64, spawn panic, corrupted value). They helped with specific crash modes but the core N-API race condition in Bun v1.3.10 is untouched. Crashes continue on v2.1.55.

Root cause analysis with 27 memory dumps: #21875. Full timeline (26+ repros, 4 computer lockups): #21576.

ThatDragonOverThere avatar Feb 25 '26 18:02 ThatDragonOverThere

Closing for now — inactive for too long. Please open a new issue if this is still relevant.

github-actions[bot] avatar Mar 26 '26 10:03 github-actions[bot]

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

github-actions[bot] avatar Apr 03 '26 14:04 github-actions[bot]