Skip to content

OpenCode Native Runtime Crash: SIGILL / Invalid Opcode #27137

Closed as not planned
Closed as not planned

Description

@Lucky-H6

Description

Summary

OpenCode 1.14.48 intermittently crashes at the native runtime level with SIGILL / trap invalid opcode. The crash occurs inside the packaged .opencode ELF binary, not in JavaScript user code. Kernel logs show the same instruction pointer on repeated crashes, and disassembly shows the crashing instruction is ud2.

Environment

  • OpenCode package: opencode-ai@1.14.48
  • OpenCode CLI version: 1.14.48
  • Installation method: global npm package
  • Runtime launcher: /usr/bin/opencode Node wrapper launching packaged native binary
  • Native binary: /usr/lib/node_modules/opencode-ai/bin/.opencode
  • Node.js: v22.22.2
  • OS family: Linux x86_64, RHEL/Rocky 8 compatible
  • Kernel: 4.18.0-553.el8_10.x86_64
  • glibc: 2.28
  • CPU architecture: x86_64
  • CPU supports: avx2 and avx512*

There is no standalone bun executable installed on PATH; this appears to involve the Bun/native runtime packaged inside OpenCode.

What Happened

OpenCode crashed while running normally. The process was terminated by SIGILL.

coredumpctl recorded crashes for both the packaged native binary and the parent Node wrapper process. The Node process appears to receive the same signal because the wrapper forwards child process signals.

Example sanitized coredumpctl entries:

TIME                            PID     UID   GID SIG COREFILE EXE
<timestamp>                     <pid>   <uid> <gid> 4   none     /usr/lib/node_modules/opencode-ai/bin/.opencode
<timestamp>                     <pid>   <uid> <gid> 4   none     /usr/bin/node

Kernel Evidence

dmesg shows repeated invalid opcode traps inside .opencode at the same instruction pointer:

traps: HeapHelper[<pid>] trap invalid opcode ip:30a9a42 sp:<redacted> error:0 in .opencode[2b1e000+3790000]
traps: .opencode[<pid>] trap invalid opcode ip:30a9a42 sp:<redacted> error:0 in .opencode[2b1e000+3790000]

Disassembly Around Crash Address

Disassembling the packaged .opencode binary around the failing address shows the crash occurs at a ud2 instruction:

Disassembly of section .text:

00000000030a9a38 <napi_acquire_threadsafe_function-0x291878>:
 30a9a38: 48 89 de              mov    %rbx,%rsi
 30a9a3b: 31 d2                 xor    %edx,%edx
 30a9a3d: e8 8e 50 a7 ff        callq  2b1ead0 <napi_acquire_threadsafe_function-0x81c7e0>
 30a9a42: 0f 0b                 ud2
 30a9a44: cc                    int3
 30a9a45: cc                    int3
 30a9a46: cc                    int3
 30a9a47: cc                    int3

This suggests the process is intentionally trapping through an unreachable/assertion path or a native runtime abort path, rather than merely executing an unsupported AVX/SIMD instruction.

Additional Observations

  • /usr/bin/opencode is a JavaScript wrapper that resolves and launches the packaged native binary.
  • The selected packaged binary is an ELF x86-64 executable.
  • The OpenCode logs do not include a JavaScript stack trace for this crash, likely because the process is terminated directly by the kernel due to SIGILL.
  • The installed opencode-linux-x64 and opencode-linux-x64-baseline package binaries in this installation have the same SHA-256 checksum, so switching to the baseline package may not change the executable in this release.

Commands Used To Collect Evidence

opencode --version
node --version
npm list -g opencode-ai --depth=0
coredumpctl list --no-pager
dmesg --ctime
file /usr/lib/node_modules/opencode-ai/bin/.opencode
ldd /usr/lib/node_modules/opencode-ai/bin/.opencode
readelf -l /usr/lib/node_modules/opencode-ai/bin/.opencode
objdump -d --start-address=0x30a9a38 --stop-address=0x30a9a48 /usr/lib/node_modules/opencode-ai/bin/.opencode

Expected Behavior

OpenCode should not terminate with SIGILL during normal use. If an internal runtime assertion or unsupported path is reached, it should ideally emit a diagnostic message or recoverable error instead of silently crashing at the native runtime level.

Actual Behavior

OpenCode terminates with SIGILL, and the kernel records trap invalid opcode inside the packaged .opencode binary.

Privacy Notes

This report intentionally omits local usernames, hostnames, API keys, provider base URLs, session IDs, project paths, and prompt contents.

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

Rocky Linux 8

Terminal

Windows Terminal ssh to Rocky linux server

Activity

  1. github-actions commented on May 12, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • The Steps to reproduce field was left as _No response_ (template placeholder). Please describe the steps that lead to the crash so maintainers can investigate.
    • The issue appears to have been written or heavily structured by AI. We ask that you describe the problem in your own words. Detailed AI-generated reports with sanitized/redacted data make it harder to triage and reproduce.

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.


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

    If you believe this was flagged incorrectly, please let a maintainer know.

  2. github-actions commented on May 12, 2026

    @github-actions
    Contributor

    This issue has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

    Feel free to open a new issue that follows our issue templates.

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