Skip to content

Crash: EXC_BREAKPOINT in ONNX Runtime 1.21.0 via Bun N-API on Apple Silicon #26132

Closed as duplicate

Description

@shiyan-salt

Crash Report

OpenCode crashes with EXC_BREAKPOINT (SIGTRAP) approximately 90 seconds after launch. The crash originates from a worker thread interacting with ONNX Runtime 1.21.0 through Bun's N-API bridge.

Environment

Item Value
OS macOS 26.3 (25D125)
CPU ARM64 — Apple Silicon (MacBookPro18,3)
Runtime Bun (JSC-based, confirmed by __BUN VM region)
ONNX Runtime 1.21.0 (libonnxruntime.1.21.0.dylib)
Install path /opt/homebrew/*/opencode (Homebrew)

Crash Details

  • Exception: EXC_BREAKPOINT / Signal SIGTRAP
  • Exception codes: 0x0000000000000001, 0x0000000102fb7ee4
  • Faulting thread: 8 (named "Worker")
  • Process uptime at crash: ~92 s (launched 14:25:38, crashed 14:27:10)

Loaded Native Modules

Module Base Size
onnxruntime_binding.node 0x104900000 147456
libonnxruntime.1.21.0.dylib 0x153F80000 ~20 MB
sharp-darwin-arm64.node 0x1049E4000 180224
libvips-cpp.8.17.3.dylib 0x15228C000 ~14 MB

Hypothesis

The crash address 0x0000000102fb7ee4 falls within the main .opencode binary image (base 0x100E58000, size ~60 MB), suggesting the SIGTRAP fires inside Bun's own code — likely its N-API / NAPI bridge layer — while servicing a call from onnxruntime_binding.node.

Known friction points:

  • Bun's N-API implementation has documented gaps vs. Node.js, particularly around threadsafe functions, reference counting, and error propagation from native modules.
  • ONNX Runtime 1.21.0 uses background inference threads that call back into JS via N-API threadsafe functions — a path that has historically been fragile under Bun.

Raw Crash Report

Full .ips header (JSON)
{
  "app_name": "opencode",
  "timestamp": "2026-05-07 14:27:11.00 +0800",
  "platform": 1,
  "bug_type": "309",
  "os_version": "macOS 26.3 (25D125)",
  "incident_id": "6748F44C-334D-434E-9D32-2EE19B21B5B6"
}
Exception & termination
{
  "exception": {
    "codes": "0x0000000000000001, 0x0000000102fb7ee4",
    "rawCodes": [1, 4345003748],
    "type": "EXC_BREAKPOINT",
    "signal": "SIGTRAP"
  },
  "termination": {
    "flags": 0,
    "code": 5,
    "namespace": "SIGNAL",
    "indicator": "Trace/BPT trap: 5",
    "byProc": "exc handler",
    "byPid": 21780
  }
}
VM Summary (excerpt)
JS JIT generated code            512.0M        3
JS VM Gigacage                     1.5G        6
JS VM Gigacage (reserved)         54.5G        3
WebKit Malloc                     13.0G       51
__BUN                             39.5M        1

Activity

  1. github-actions commented on May 7, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • The issue does not use one of the required issue templates (Bug Report, Feature Request, or Question). Please re-submit using the Bug Report template, which requires a proper Description field and steps to reproduce.
    • The OS version listed (macOS 26.3) appears incorrect — the current macOS release line is 15.x (Sequoia). Please verify and correct your environment information.
    • The report reads as AI-generated (highly structured tables, polished hypothesis section). We require authentic, user-written descriptions of what you actually experienced.

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


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

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

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

Metadata

Metadata

Assignees

Labels

needs:complianceThis means the issue will auto-close after 2 hours.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions