opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Bun has crashed

Open sunnywuco opened this issue 10 months ago • 40 comments

Description

     ┃  ============================================================

Bun v1.3.5 (1e86cebd) Windows x64 (baseline) Windows v.win10_cu ┃ Build Big Pickle OpenCode Zen CPU: sse42 avx avx2 avx512 ╹▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ Args: "C:\Users\otiswu\AppData\Local\nvm\v20.10.0\node_modules\opencode-ai\node_modules\opencode-windows-x64\bin\opencode.exe" "--user-agent=opencode/1.1.19" "--use-system-ca " "--" Features: Bun.stderr(4) Bun.stdin(4) Bun.stdout(4) fetch(3) jsc shell(2) spawn(7) standalone_executable workers_spawned Builtins: "bun:ffi" "bun:main" "node:assert" "node:async_hooks" "node:buffer" "node:child_process" "node:console" "node:crypto" "node:events" "node:fs" "node:fs/promises" "node:http" "node:https" "node:module" "node:net" "node:os" "node:path" "node:process" "node:querystring" "node:readline" "node:stream" "node:string_decoder" "node:timers" "node:timers/promises" "node:tls" "node:tty" "node:url" "node:util" "undici" "node:v8" "node:dgram" Elapsed: 10626ms | User: 4593ms | Sys: 1625ms RSS: 0.77GB | Peak: 0.77GB | Commit: 0.91GB | Faults: 228926 | Machine: 25.77GB

panic(thread 25644): Segmentation fault at address 0x23544190000 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: ~ 1.1.19 https://bun.report/1.3.5/ea11e86cebmQz/3/9/DCYKERNEL32.DLL8jvFCoBMozartBreathCore.dll01hzCCoBMozartBreathCore.dll41t0CCoBMozartBreathCore.dlly730CCoBMozartBreathCore.dll6/g0CCqBMozartBreathBolo2.dll4jlICqBMozartBreathBolo2.dllmiuMCoBMozartBreathCore.dlluz/kECoBMozartBreathCore.dll8+xlEo6z2uBi4zrD+n1of2hhgf__0shkwCA2qjBgggkjkC

Plugins

No response

OpenCode version

1.1.19

Steps to reproduce

No response

Screenshot and/or share link

Image

Operating System

Windows10

Terminal

Windows Terminal

sunnywuco avatar Jan 16 '26 02:01 sunnywuco

This issue might be a duplicate of existing issues. Please check:

  • #7318: TypeScript LSP crashes with Bun segmentation fault on Windows 11 - Similar segmentation fault crash on Windows
  • #3267: auto update causes: Bun segmentation fault (Windows) - Same segmentation fault error type
  • #5901: Bun crash in the middle of a response - Similar Bun crash during operation on Windows

Feel free to ignore if none of these address your specific case.

github-actions[bot] avatar Jan 16 '26 02:01 github-actions[bot]

The same problem occurs in Arch Linux. Opencode was installed from the AUR https://aur.archlinux.org/packages/opencode-bin.

Bun v1.3.5 (1e86cebd) Linux x64 (baseline)
Linux Kernel v6.18.5 | glibc v2.42
CPU: sse42 popcnt avx avx2
Args: "opencode" "--user-agent=opencode/1.1.23" "--use-system-ca " "--"
Features: Bun.stderr(4) Bun.stdin(4) Bun.stdout(4) abort_signal(2) dotenv fetch(6) jsc shell(22) spawn(13) standalone_executable tsconfig(2) workers_spawned napi_module_register process_dlopen 
Builtins: "bun:ffi" "bun:main" "node:assert" "node:async_hooks" "node:buffer" "node:child_process" "node:console" "node:crypto" "node:dns" "node:events" "node:fs" "node:fs/promises" "node:http" "node:https" "node:module" "node:net" "node:os" "node:path" "node:process" "node:querystring" "node:readline" "node:stream" "node:string_decoder" "node:timers" "node:timers/promises" "node:tls" "node:tty" "node:url" "node:util" "undici" "node:v8" "node:http2" "node:diagnostics_channel" "node:dgram" 
Elapsed: 152370ms | User: 5835ms | Sys: 2905ms
RSS: 5.29GB | Peak: 2.43GB | Commit: 5.29GB | Faults: 803 | Machine: 50.27GB

panic(main thread): Segmentation fault at address 0x7F75140202A7
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/Ba11e86cebmyGzu3/9/Dk0iruE+syP4lrhBin4gB26vc4nthB__y9us/Dy9us/Dy9us/Dy9us/D_y9us/D8mms/D_y9us/D_0rsk/Dqli3jFA2q3/BuqhogU

andrey-pavlenko avatar Jan 16 '26 05:01 andrey-pavlenko

I encountered the same error in multiple versions. It still exists in the latest version (1.1.36). There is information that upgrading the bun to 1.3.6 can solve it.

Bun v1.3.5 (1e86cebd) Windows x64 (baseline)
Windows v.win10_rs5 Z.AI Coding Plan /E:\project\oh-my-opencode:dev Args: "C:\Users\aiguo\AppData\Roaming\npm\node_modules\opencode-ai\node_modules\opencode-windows-x64\bin\opencode.exe" "--user-agent=opencode/1.1.36" "--use-system-ca " "--"▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
Features: Bun.stderr(4) Bun.stdin(4) Bun.stdout(4) abort_signal(2) bunfig fetch(303) jsc no_avx2 no_avx shell(698) spawn(385) standalone_executable transpiler_cache(4) tsconfig(4) workers_spawned(2) napi_module_register process_dlopen ode 1.1.36 Builtins: "bun:ffi" "bun:main" "node:assert" "node:async_hooks" "node:buffer" "node:child_process" "node:console" "node:constants" "node:crypto" "node:dns" "node:events" "node:fs" "node:fs/promises" "node:http" "node:https" "node:module" "node:net" "node:os" "node:path" "node:process" "node:querystring" "node:readline" "node:readline/promises" "node:stream" "node:string_decoder" "node:timers" "node:timers/promises" "node:tls" "node:tty" "node:url" "node:util" "node:worker_threads" "undici" "node:v8" "node:http2" "node:diagnostics_channel" "node:dgram" Elapsed: 1529861ms | User: 17468ms | Sys: 6421ms RSS: 1.26GB | Peak: 1.26GB | Commit: 1.63GB | Faults: 632771 | Machine: 34.19GB

CPU lacks AVX support. Please consider upgrading to a newer CPU. panic(thread 41960): Segmentation fault at address 0x4A2B21E0160 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/ea11e86cebmzGz63/9f_+wlwekhlwe4/i3nB06twzB063vzB6ivtzBsputzB8l35uB80tiwB+itiwBuisiwB0vm3nB89/7qBy8/8e___A2kqChq/n8tC

n-pll avatar Jan 26 '26 06:01 n-pll

Same on macos too with opencode v1.1.42

Bun v1.3.5 (1e86cebd) macOS Silicon
macOS v26.1
CPU: fp aes crc32 atomics
Args: "opencode" "--user-agent=opencode/1.1.42" "--use-system-ca " "--"
Features: Bun.stderr(4) Bun.stdin(4) Bun.stdout(4) abort_signal(2) fetch(17) jsc shell(14) spawn(13) standalone_executable transpiler_cache(4) tsconfig workers_spawned napi_module_register(2) process_dlopen(3) exited
Builtins: "bun:ffi" "bun:main" "node:assert" "node:async_hooks" "node:buffer" "node:child_process" "node:console" "node:crypto" "node:dns" "node:events" "node:fs" "node:fs/promises" "node:http" "node:https" "node:module" "node:net" "node:os" "node:path" "node:process" "node:querystring" "node:readline" "node:stream" "node:string_decoder" "node:timers" "node:timers/promises" "node:tls" "node:tty" "node:url" "node:util" "undici" "node:v8" "node:http2" "node:diagnostics_channel" "node:dgram"
Elapsed: 78715ms | User: 2047ms | Sys: 385ms
RSS: 0.38GB | Peak: 0.69GB | Commit: 0.63GB | Faults: 952 | Machine: 38.65GB

panic(main thread): A C++ exception occurred
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:

erskingardner avatar Jan 29 '26 16:01 erskingardner

panic(thread 38780): Segmentation fault at address 0x0 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/ea11e86cebmzGz+3/9/DA2AA

win10, win terminal

mykola-dev avatar Feb 03 '26 08:02 mykola-dev

I also encountered the same problem. Even though I used bun 1.3.8, I still couldn't solve it.

ouchihao avatar Feb 06 '26 07:02 ouchihao

Same here

============================================================ Bun v1.3.5 (1e86cebd) Windows x64 Windows v.win11_dt CPU: sse42 avx avx2 Args: "C:\Users\Hp\AppData\Roaming\npm\node_modules\opencode-ai\node_modules\opencode-windows-x64\bin\opencode.exe" Elapsed: 3ms | User: 15ms | Sys: 0ms RSS: 17.41MB | Peak: 17.41MB | Commit: 55.55MB | Faults: 4412

panic(main thread): Segmentation fault at address 0x7FF71BFD7B97 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/w_11e86cebAAoj7xFuvbgjMopvizDCYKERNEL32.DLLut0LCSntdll.dll4gijBA2u//Bu591/b

natanim-kemal avatar Feb 06 '26 21:02 natanim-kemal

I also encountered the same problem. Even though I used bun 1.3.8, I still couldn't solve it.

zhenbiao-l avatar Feb 09 '26 11:02 zhenbiao-l

Image I also encountered the same problem.Even though I used bun 1.3.9, I still disappear 1.3.8.

WangNingkai avatar Feb 11 '26 06:02 WangNingkai

I encountered the same problem.

diiyw avatar Feb 11 '26 07:02 diiyw

Adding one more voice to the chorus

ramarivera avatar Feb 12 '26 00:02 ramarivera

+rep

H3artdown avatar Feb 12 '26 18:02 H3artdown

me too

kr1json avatar Feb 15 '26 12:02 kr1json

me too

Image

qiqingzhixin avatar Feb 17 '26 15:02 qiqingzhixin

nothing worked for me so i tried installing with bun, and it only works when i use .bun\bin\opencode.exe in terminal instead of opencode. At this stage the terminal command "opencode" still triggers segmentation fault bun crash.

Didnt work: bun upgrade/ bun upgrade canary /bun install Even bun test triggers segmentation fault

Worked for me: npm uninstall -g opencode-ai

Non technical person here so I dont know why and what happened, but it worked for me so, perhaps it could help. I was afraid it might delete all the files/configs but it didnt, and its working now.

zheng2zero avatar Feb 19 '26 08:02 zheng2zero

Image OpenCode version 1.2.10 It was fine until I needed to do actual work.

trungnhm1998 avatar Feb 22 '26 16:02 trungnhm1998

I use nvm to install nodejs, can fix this problem

Skypow2012 avatar Mar 10 '26 07:03 Skypow2012

Image opencode version : 1.2.24 platform : MAC OS 15.6 terminal : iTerm2 3.6.9

yan11xiang avatar Mar 12 '26 10:03 yan11xiang

I’ve found the root cause of this issue!

It seems to be triggered by the presence of a .env file in the directory where opencode is executed.

Here is what I discovered:

If the .env file is empty (0kb), it works fine.

If the .env file has any content, the issue occurs.

As a workaround, check if there is an existing .env file in your current working directory and try removing or emptying it.

kskyj avatar Mar 19 '26 01:03 kskyj

I’ve found the root cause of this issue!

It seems to be triggered by the presence of a .env file in the directory where opencode is executed.

Here is what I discovered:

If the .env file is empty (0kb), it works fine.

If the .env file has any content, the issue occurs.

As a workaround, check if there is an existing .env file in your current working directory and try removing or emptying it.

same error, but my workspace no .env file.

zealotCE avatar Mar 25 '26 01:03 zealotCE