Repository navigation
Description
Description
OpenCode (Bun standalone, v1.17.13) crashes with a Segmentation fault in Bun (v1.3.14) on Linux ARM64 when started from an interactive SSH session (Termius from iPhone). Running the same binary locally on the same machine works fine.
The crash happens ~2s into startup during full TUI initialization (not with --version or --help).
Full error:
Bun v1.3.14 (0d9b296a) Linux arm64
Linux Kernel v6.1.0 | glibc v2.36
CPU: neon fp aes crc32 atomics
Args: "opencode" "--user-agent=opencode/1.17.13" "--use-system-ca" "--"
Features: Bun.stderr(4) Bun.stdin(4) Bun.stdout(4) fetch(2) jsc standalone_executable workers_spawned napi_module_register process_dlopen
Builtins: "bun:ffi" "bun:main" "bun:sqlite" "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:stream/consumers" "node:stream/promises" "node:string_decoder" "node:timers/promises" "node:tty" "node:url" "node:util" "node:zlib" "ws" "node:v8" "node:http2" "node:diagnostics_channel" "node:dgram"
Elapsed: 1923ms | User: 1825ms | Sys: 71ms
RSS: 121.70MB | Peak: 0.78GB | Commit: 121.70MB | Faults: 0 | Machine: 4.12GB
panic(main thread): Segmentation fault at address 0x10003394817FC
oh no: Bun has crashed. This indicates a bug in Bun, not your code.
To send a redacted crash report to Buns team,
please file a GitHub issue using the link below:
https://bun.report/1.3.14/La10d9b296kwGugogCmw2wqE27Duu/gD__um9zoCum9zoCum9zoCum9zoCum9zoCum9zoCum9zoCms6poC2707mF+so7mFu3s2rF+k6x6D__ms6poCA2mggE4/rgp5B
Plugins
None
OpenCode version
1.17.13
Steps to reproduce
- SSH from Termius for iOS into an ARM64 Linux machine via Tailscale
- Run
opencode - Observe segfault after ~2s
Not affected: running locally on the same machine, running --version or --help
Screenshot and/or share link
N/A
Stack & versions
| Component | Detail |
|---|---|
| Client | iPhone (Termius for iOS) |
| VPN | Tailscale v1.98.8 |
| Host machine | Mac Mini M4, macOS Tahoe 26.5.2 |
| VM | Lima VM |
| VM OS | Debian 12 (bookworm), Kernel 6.1.0-49-cloud-arm64, ARM64 (aarch64) |
| Terminal type | Ghostty via Termius (TERM=xterm-ghostty) |
| OpenCode | v1.17.13 (Bun standalone) |
| Bun (embedded) | v1.3.14 |
Terminal
Termius for iOS (TERM=xterm-ghostty)
Workaround
Two things needed to fully fix this:
1. Fix Bun segfault — increase stack limit:
mv ~/.opencode/bin/opencode ~/.opencode/bin/opencode.bunCreate ~/.opencode/bin/opencode with:
#!/usr/bin/env bash
ulimit -s unlimited 2>/dev/null
exec ~/.opencode/bin/opencode.bun "$@"Make it executable:
chmod +x ~/.opencode/bin/opencode2. Fix missing xterm-ghostty terminfo (for Termius):
infocmp xterm-256color > /tmp/ghostty.tiEdit the second line of /tmp/ghostty.ti from:
xterm-256color|xterm with 256 colors,
to:
xterm-ghostty|xterm-256color|xterm with 256 colors,
Then compile and install:
tic -o ~/.terminfo /tmp/ghostty.tiOr alternatively, add this to your ~/.bashrc (or equivalent):
if [[ "$TERM" == "xterm-ghostty" ]]; then
export TERM=xterm-256color
fiRoot cause
The systemd default soft stack limit (DefaultLimitSTACKSoft=8388608 = 8MB) appears insufficient for Buns JSC JIT on ARM64 Linux (kernel 6.1). The crash only manifests in interactive SSH sessions — possibly due to different process attribute inheritance — and is resolved by ulimit -s unlimited.
Related issues
- Shell tool crashes with SIGTRAP on linux/arm64 (web-tree-sitter Parser.init in JSC) #34054 — Shell tool crashes with SIGTRAP on linux/arm64 (web-tree-sitter Parser.init in JSC). Same underlying Bun JSC tagged-pointer corruption on ARM64, though triggered differently. That issue documents the fault-address pattern (
0xEA8E00000012,0xE3C500000012) consistent with NaN-box corruption in JSC on aarch64, which matches the segfault here. - Bun 1.3.14 segfault (SIGILL) on Linux x86_64 #33890 — Bun 1.3.14 segfault (SIGILL) on Linux x86_64 (Bun GC thread ud2 panic). Same Bun runtime bug class, different architecture.
- Opencode segfaults in NixOS+WSL #26846 — Opencode segfaults in NixOS+WSL. Crash may share a similar root cause (process environment / stack limits differing from standard Linux sessions).
Activity
[-]Bun v1.3.14 segfault on Linux ARM64 (Debian 12, Kernel 6.1) when running via SSH (Termius iPhone)[/-][+][BUG] Bun v1.3.14 segfault on Linux ARM64 (Debian 12, Kernel 6.1) when running via SSH (Termius iPhone)[/+][-][BUG] Bun v1.3.14 segfault on Linux ARM64 (Debian 12, Kernel 6.1) when running via SSH (Termius iPhone)[/-][+][Bug] Bun v1.3.14 segfault on Linux ARM64 (Debian 12, Kernel 6.1) when running via SSH (Termius iPhone)[/+]IamKaleb21 commentedon Aug 10, 2026
Possibly the same root cause. I filed #41483 with a characterization of a startup crash that shows the same shape you describe — fine locally, crashes when launched from a phone terminal client.
In ~40 controlled runs the trigger turned out to be the terminal answering opencode's startup capability handshake partially: a terminal that answers nothing falls back cleanly, one that answers everything works, and an incomplete set crashes in
JSC::VM::drainMicrotaskswith a constantlibopentui.so + 0x1d061dframe.If you can still reproduce on your setup, a useful data point would be whether plain
mosh/sshwith a desktop client also crashes, or only the phone app — for me only the phone client does.github-actions commentedon Oct 10, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.