Skip to content

Since opencode 1.0.116 no longer able to run binary as it crashes with bun seg fault #4970

Closed

Description

@kalvenschraut

Question

1.0.115 I can run just fine, it only crashes if starting in a code repo on my machine see
oven-sh/bun#25276
where I reported the bug in bun, not sure what change would have caused this?
v1.0.115...v1.0.116

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Dec 2, 2025
  2. github-actions commented on Dec 2, 2025

    @github-actions
    Contributor

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

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

  3. DGJK2301 commented on Dec 2, 2025

    @DGJK2301

    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.

  4. self-assigned this
    on Dec 2, 2025
  5. rekram1-node commented on Dec 2, 2025

    @rekram1-node
    Contributor

    hm idk what change in 116 wouldve caused it assuming same issue for any release after that for you too?

  6. kalvenschraut commented on Dec 2, 2025

    @kalvenschraut
    Author

    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

  7. kalvenschraut commented on Dec 3, 2025

    @kalvenschraut
    Author

    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 99d7ff4 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

  8. kalvenschraut commented on Dec 3, 2025

    @kalvenschraut
    Author

    Looking at 99d7ff4#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

  9. kalvenschraut commented on Dec 3, 2025

    @kalvenschraut
    Author

    oven-sh/bun#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

  10. added
    bugSomething isn't working
    and removed
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Dec 3, 2025
  11. rekram1-node commented on Dec 3, 2025

    @rekram1-node
    Contributor

    Wow nice find

  12. LiefLife commented on Dec 7, 2025

    @LiefLife

    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...

  13. kalvenschraut commented on Dec 8, 2025

    @kalvenschraut
    Author

    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.

  14. rekram1-node commented on Dec 8, 2025

    @rekram1-node
    Contributor

    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

  15. rekram1-node commented on Dec 8, 2025

    @rekram1-node
    Contributor

    I think this should fix it:
    4dcda3d

  16. kalvenschraut commented on Dec 8, 2025

    @kalvenschraut
    Author

    Seems to, I pulled dev and ran build for opencode and the musl binary works with no other changes from me. Thanks!

  17. rekram1-node commented on Dec 8, 2025

    @rekram1-node
    Contributor

    sweet

  18. rekram1-node commented on Dec 9, 2025

    @rekram1-node
    Contributor

    Should release tonight

  19. rekram1-node commented on Dec 9, 2025

    @rekram1-node
    Contributor

    released in 1.0.137

  20. kalvenschraut commented on Dec 9, 2025

    @kalvenschraut
    Author

    Thanks, confirmed that version is working for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions