Skip to content

tui: Linux x64 segfault in bundled Bun 1.4.2 (FFI stack), OpenCode 2.0.22 #53214

Closed as not planned

Description

@orenaksakal

Description

OpenCode's TUI crashed during an active session on 2026-10-04 with Segmentation fault at address 0x0 in the bundled Bun runtime. The shell reported segmentation fault (core dumped) opencode.

The last visible assistant message said it would check whether the World Bank API was reachable. The actual request/tool invocation is not visible, so this is context, not a confirmed trigger.

After the crash, sequences such as 35;1;38M35;6;39M... appeared at the shell prompt, consistent with terminal mouse reporting remaining enabled. Expected behavior: the session continues without a native crash and terminal input is restored on exit.

OpenCode version

2.0.22, inferred from the crash arguments: --user-agent=opencode/latest/2.0.22/cli.

Operating System

Linux x64; crash header reports kernel 7.0.0 and glibc 2.43. CPU flags: sse42 popcnt avx avx2 avx512. Distribution and terminal emulator have not been confirmed.

Steps to reproduce

No minimal reproducer or repeatability established. This report is based on one captured crash during an interactive session, approximately 159 seconds after process start. Plugins and installation method are unknown.

Crash report

Original bun.report link

The reporter confirmed that a redacted crash report was sent to the Bun team and directed bundled-application crashes to the app developer.

Bun v1.4.2 (744846f84) Linux x64
Args: "opencode" "--smol" "--user-agent=opencode/latest/2.0.22/cli" "--use-system-ca" "--no-warnings" "--"
Elapsed: 159413ms | User: 11786ms | Sys: 1118ms
RSS: 0.22 GB | Peak: 0.25 GB | Commit: 5.71 GB | Faults: 50 | Machine: 0.13 TB

panic(main thread): Segmentation fault at address 0x0

The decoded report identifies Bun commit 744846f844374847c902b5e7fd59b4342a51ef99 and StandaloneExecutable. It shows 12 unresolved frames, then:

Mutex.cpp:0 — icudt78_dat
1 unknown/js code
FFICallHost.cpp:101 — ffiCall
FFICallHost.cpp:119 — operationFFICallSlowPath
1 unknown/js code
LowLevelInterpreter.cpp:0 — llint_op_call
LowLevelInterpreter.cpp:0 — llint_op_call
LowLevelInterpreter.cpp:0 — llint_op_call
LowLevelInterpreter.cpp:0 — llint_call_javascript

The partial FFI stack does not establish whether the fault is in Bun or a native dependency. Related Linux service-crash report: #50246; no matching stack/root cause has been established.

Activity

  1. github-actions commented on Oct 4, 2026

    @github-actions
    Contributor

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

  2. opencodejr commented on Oct 27, 2026

    @opencodejr
    Contributor

    Thanks for the detailed crash report and the decoded stack.

    The last frames are in Bun's FFI call path (ffiCall / operationFFICallSlowPath). In the TUI, that usually means a call into the native terminal renderer (OpenTUI). We can't tell what triggered it from a single crash, so a few more details would help:

    • Does it still happen on the latest release? Since 2.0.22, the bundled OpenTUI has been upgraded a few times and newer builds use a newer Bun. Please update and run opencode --version.
    • Has it happened again? If it has, please share the new bun.report link and anything that seems to correlate with it.
    • What were you doing at that moment? For example resizing the terminal or window, scrolling or clicking with the mouse, switching tabs or panes, or just waiting while a tool ran.
    • Environment: your distro, your terminal emulator (plus tmux/zellij if you use one), how you installed OpenCode, and any plugins or MCP servers you have enabled.
    • A core dump backtrace (coredumpctl info / coredumpctl gdb), if one was captured.

    The mouse-reporting sequences at the prompt come from the process being killed by the segfault: it never got the chance to restore the terminal. Running reset fixes the terminal afterwards.

    You can reply here with the details, or edit the issue. If you edit it, please also leave a comment saying you've updated it, so we know you're done.

    Related reports, ordered by likelihood (none is clearly the same crash):

  3. opencodejr commented on Oct 30, 2026

    @opencodejr
    Contributor

    I'm closing this for now as not planned because we haven't heard back. The crash happened once on 2.0.22 with no reproducer. The trace stops in Bun's FFI call path, but it doesn't show what triggered the crash, and without that we can't reproduce it or tell whether it's still there in current builds. Since 2.0.22, the bundled OpenTUI and Bun have both been updated.

    If it happens again, please reopen this issue or comment here with:

    • the output of opencode --version
    • the new bun.report link
    • what you were doing at the time (for example resizing the window, using the mouse, or waiting while a tool ran)
    • your distro, terminal emulator and install method, plus any plugins or MCP servers you use
    • a core dump backtrace, if you have one

    In the meantime, you can follow #54228 and #50246, which cover related Bun 1.4.2 segfaults on Linux. Thanks for the detailed report.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions