Skip to content

[Bug] Bun v1.3.14 segfault on Linux ARM64 (Debian 12, Kernel 6.1) when running via SSH (Termius iPhone) #35384

Closed as not planned

Description

@joaomj

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

  1. SSH from Termius for iOS into an ARM64 Linux machine via Tailscale
  2. Run opencode
  3. 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.bun

Create ~/.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/opencode

2. Fix missing xterm-ghostty terminfo (for Termius):

infocmp xterm-256color > /tmp/ghostty.ti

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

Or alternatively, add this to your ~/.bashrc (or equivalent):

if [[ "$TERM" == "xterm-ghostty" ]]; then
  export TERM=xterm-256color
fi

Root 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

Activity

  1. changed the title [-]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)[/+] on Jul 5, 2026
  2. changed the title [-][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)[/+] on Jul 5, 2026
  3. IamKaleb21 commented on Aug 10, 2026

    @IamKaleb21

    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::drainMicrotasks with a constant libopentui.so + 0x1d061d frame.

    If you can still reproduce on your setup, a useful data point would be whether plain mosh/ssh with a desktop client also crashes, or only the phone app — for me only the phone client does.

  4. github-actions commented on Oct 10, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions