auto update causes: Bun segmentation fault (Windows)
Description
Hi, Opencode suggested to restart since an update can be installed. So exited my current sessions with v0.15.7 and tried to restart Opencode. Now I receive this error:
============================================================ Bun v1.3.0 (b0a6feca) Windows x64 (baseline) Windows v.win11_dt CPU: sse42 avx avx2 Args: "C:\Program Files\nodejs\node_modules\opencode-ai\node_modules\opencode-windows-x64\bin\opencode.exe" Elapsed: 1ms | User: 0ms | Sys: 0ms RSS: 17.37MB | Peak: 17.37MB | Commit: 58.06MB | Faults: 4405
panic(main thread): Segmentation fault at address 0x7FF71F0A739E 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_1b0a6fecAA+ykuFmwZqhJoq1p3DCYKERNEL32.DLLut0LCSntdll.dll4zijBA2u//B855phf
I checked my globally installed npm packages and saw that indeed Opencode had been updated to v0.15.8
Steps to reproduce
Have v0.15.7 installed and open. Wait for Opencode to suggest a restart for update. Exit Opencode and re-open.
Screenshot and/or share link
No response
Operating System
Windows 11
Terminal
PowerShell 7
This issue might be a duplicate of existing issues. Please check:
- #750: Bun keep crashing when run Opencode on Windows (Bash) - Similar Bun segmentation fault crashes on Windows platform
- #3002: Package manager failed to install the right version of opencode CLI for Windows - Related Windows installation/startup issues after updates
Feel free to ignore if none of these address your specific case.
@HansuHessu does it still break if you delete opencode and reinstall?
@rekram1-node after reinstalling its starts. Seems to be an issue with this "auto update" feature I experienced.
hmm okay, cc @itsrainingmani
Bug Report: Segmentation Fault on Bun v1.3.0
Description Bun crashes with a segmentation fault (address 0x783C21E1E220) immediately upon startup. The crash appears to occur during the initialization phase. What happened:
Bun terminated with "Segmentation fault at address 0x783C21E1E220" The process crashed before executing any user code No specific error message about what caused the crash
Bun version: v1.3.0 (b0a6faca) OS: Linux x64 (baseline) Kernel: Linux v6.12.56 glibc: v2.42 CPU: sse42 popent avx avx2 avx512
### **When** it happens:
The crash occurs immediately when running Bun, during the startup/initialization phase.
### **Error Output**
panic(main thread): Segmentation fault at address 0x783C21E1E220 oh no: Bun has crashed. This indicates a bug in Bun, not your code.
### **System Information**
- **RAM**: 1.016B
- **Peak Memory**: 0.27GB
- **Commit**: 1.016B
- **Faults**: 0
- **Machine**: 41.756B
### **How to Reproduce**
1. Install Bun v1.3.0
2. Run any Bun command (even `bun --version`)
3. Observe segmentation fault
### **Expected Behavior**
Bun should start normally without crashing.
### **Actual Behavior**
Bun crashes with a segmentation fault before executing any code.
### **Additional Context**
- The crash report shows multiple Node.js compatibility modules being loaded
- Error occurs at memory address: `0x783C21E1E220`
- Elapsed time before crash: 6298ms
- User: 1436ms | Sys: 301ms
### **Possible Related Information**
The crash log shows various Node.js built-in modules being loaded:
- `node:assert`, `node:async_hooks`, `node:buffer`, `node:child_process`, `node:console`, `node:crypto`, `node:events`, `node:fs`, `node:http`, `node:https`, `node:module`, `node:net`, `node:os`, `node:path`, `node:process`, `node:readline`, `node:stream`, `node:string_decoder`, `node:timers`, `node:timers/promises`, `node:tls`, `node:tty`, `node:url`, `node:util`, `undici`
yikes, idk if it matters but howd u install?
I am experiencing the exact same error. I am also using Windows Terminal, and while I'm not sure if it's related, I've noticed that it works perfectly fine when I type the command manually. However, this error seems to occur specifically when I execute the prompt after pasting it in.
@negu63 what version are u on
@negu63 what version are u on
I am using opencode v1.0.12 and have selected GitHub Copilot. I'm not entirely sure, but it seems that when I paste a very long text (like an error message), it gets split into multiple chat messages. This appears to trigger many inputs simultaneously, which I believe is causing an error.
I have gotten a couple random Bun segfaults, but according to the error message its not our fault but bun's?
If that's what the error is then yes but that's still annoying, hopefully they address those. I guess anytime you get them you can create issues to bun repo I think it includes a link or something to do so
Yup, they seem to ask for a repro in the issue template, which is hard to find a consistent setup. Will see if I can at some point
There's a large number of segfault issues on windows on bun's tracker. Seems like it could be quite the bug(s) to find :D
yikes
DISTRIB_ID=Ubuntu DISTRIB_RELEASE=24.04 DISTRIB_CODENAME=noble DISTRIB_DESCRIPTION="Ubuntu 24.04.3 LTS" PRETTY_NAME="Ubuntu 24.04.3 LTS" NAME="Ubuntu" VERSION_ID="24.04" VERSION="24.04.3 LTS (Noble Numbat)"
Linux 6.14.0-36-generic
When editing prompt with arrows: Rendering opencode useless :(
=======================================s and will be running in cluster where it has Bun v1.3.3 (274e01c7) Linux x64 (baseline) Linux Kernel v6.14.0 | glibc v2.39laude Opus 4.1 (latest) CPU: sse42 popcnt avx avx2▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ Args: "opencode" "--user-agent=opencode/1.0.105" "--" tab switch agent ctrl+p commands Features: Bun.stderr(4) Bun.stdin(4) Bun.stdout(4) fetch(16) http_server jsc shell(2) spawn(4) 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:readline" "node:stream" "node:string_decoder" "node:timers" "node:timers/promises" "node:tls" "node:tty" "node:url" "node:util" "undici" Elapsed: 5580ms | User: 2093ms | Sys: 502ms RSS: 1.04GB | Peak: 0.31GB | Commit: 1.04GB | Faults: 0 | Machine: 33.30GB
panic(main thread): Segmentation fault at address 0x7FFD00000001 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: opencode v1.0.105 ~/lkw/devops-release-manager/scripts https://bun.report/1.3.3/Ba1274e01ciIz/33+/Bk7liuE+ypRA26//BC
Illegal instruction (core dumped)
same problem