Since opencode 1.0.116 no longer able to run binary as it crashes with bun seg fault
Question
1.0.115 I can run just fine, it only crashes if starting in a code repo on my machine see https://github.com/oven-sh/bun/issues/25276 where I reported the bug in bun, not sure what change would have caused this? https://github.com/sst/opencode/compare/v1.0.115...v1.0.116
This issue might be a duplicate of existing issues. Please check:
- #3750: Bus error (core dumped) after restart - corrupted binary (similar crash behavior on Linux)
- #3876: Segfaults on musl box (segfault issues on different Linux systems)
- #4458: pnpm install causes crash (binary crash issues on aarch64 Linux)
- #1657: opencode crashes with Aborted (core dumped) on NVIDIA GH200 (ARM) (crash on startup)
Feel free to ignore if none of these address your specific case.
yes,I met the same problem on windows11. Bun v1.3.3 (274e01c7) Windows x64 (baseline) Windows v.win11_dt ┃ Build OpenAI GPT 5.1 Codex Max High (OAuth) CPU: sse42 avx avx2 avx512▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ Args: "C:\Users\DGJK\AppData\Roaming\npm\node_modules\opencode-ai\node_modules\opencode-windows-x64\bin\opencode.exe" "--user-agent=opencode/1.0.126" "--" Features: Bun.stderr(4) Bun.stdin(4) Bun.stdout(4) abort_signal(2) fetch(19) http_server jsc spawn(2) 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-fetch" Elapsed: 16794ms | User: 1406ms | Sys: 390ms RSS: 0.58GB | Peak: 0.63GB | Commit: 0.76GB | Faults: 185807 | Machine: 33.49GB
panic(main thread): Segmentation fault at address 0x3 oh no: Bun has crashed. This indicates a bug in Bun, not your code.
hm idk what change in 116 wouldve caused it assuming same issue for any release after that for you too?
yea I am not sure I guess I can try building specific commits locally to try narrow down the problem. I even got my IT to change from qemu emulated CPU to the host CPU which now shows as supporting avx and still seg faults at same spot
ran a bisect between the two versions since I confirmed I could build locally and get the seg fault on v1.0.116 and build locally and be just fine on v1.0.115 which found the commit https://github.com/sst/opencode/commit/99d7ff47c409a80a9c3b8217e8ca09383f4e70ac caused this issue for me. Which would also explain why I only saw this issue in my project repos, I just see notes on only using it if git is being used
Looking at https://github.com/sst/opencode/commit/99d7ff47c409a80a9c3b8217e8ca09383f4e70ac#diff-8e39fca798444d6dce95885b0653dd035daeff39b28b7703b933ec5d734a4616R27 , I wonder if this is a musl issue. Trying to use glibc binary instead
oh arch is coming back as arm64 which isnt good for my system its musl/x86. Manually adding https://www.npmjs.com/package/@parcel/watcher-linux-x64-musl as a dependency and requiring that instead statically works.
so @rekram1-node think since early 1.0.0 musl builds are supported need to have better detection for this parcel binary? ~~A little concerning that process.arch was off on my machine for some reason~~ I was mistaken on the arm thing it was just the build erroring due to me trying test things and not related
https://github.com/oven-sh/bun/pull/18138 so based on that people are using https://www.npmjs.com/package/detect-libc and then need to add all the parcel binary variants that opencode supports as dependencies
Wow nice find
I also encountered this problem when trying to use opencode, but I could only use opencode normally after rolling back to version v1.0.105...
any idea when this will be looked at? I can maybe take a stab at it with opencode itself 😄 . I am currently making it so it works on my system by just manually changing the file to always use musl parcel binary and running build locally.
I'm working on it rn, I think Tailwind had to solve this same issue so I don't think this should be too hard
I think this should fix it: https://github.com/sst/opencode/commit/4dcda3d53d0810daf81e37eb1bca1b8f42a367aa
Seems to, I pulled dev and ran build for opencode and the musl binary works with no other changes from me. Thanks!
sweet
Should release tonight
released in 1.0.137
Thanks, confirmed that version is working for me!