anomalyco / anomalyco/opencode
Bun crashes (segfault/SIGTRAP) when several opencode instances launch concurrently (macOS arm64)
@rekram1-node is already working on this.
Since Jul 22, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
opencode: 1.18.4 · Bun (bundled): 1.3.14 · macOS: 26.4, Apple Silicon (arm64)
Launching ~6–8 opencode TUI instances near-simultaneously — each in its own pty, same project directory — reliably crashes several of them at startup:
panic(main thread): Segmentation fault at address 0x56ACCBFFC
oh no: Bun has crashed. This indicates a bug in Bun, not your code.
macOS DiagnosticReports for the same batch show EXC_BREAKPOINT (SIGTRAP) with unsymbolicated opencode.exe frames; happy to attach the .ips files.
One crash-report link (transcribed from the terminal — apologies if a character slipped):
https://bun.report/1.3.14/Ma10d9b296mwGugogC________urh5kDunr21Cusw11C+/y34C+qy34C+5sy6Cu657H__urh5kD27p5tC+xt2yCA2K4//y5qD
Repro / mitigation signal: spawning the instances within the same ~100 ms window triggers it; staggering launches by ~400 ms avoids it entirely — which smells like a startup race on shared state (opencode.db WAL? cache dir?). RSS at crash ~0.8–1.05 GB per instance.
Context: filed from Atelier, a multi-pane terminal app where users open many opencode panes at once; we've mitigated on our side with launch staggering, but sequential-only startup shouldn't be a requirement. More traces available on request.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.