Skip to content

[Bug]: Crash (SIGTRAP) in bundled sherpa-onnx/onnxruntime: BFCArena requests a single 2 GiB allocation, Chromium allocator shim traps and kills the whole app #7925

Closed

Description

@dogangok

Summary

Orca crashed with EXC_BREAKPOINT (SIGTRAP) on a Node worker thread running the bundled sherpa-onnx speech recognizer. ONNX Runtime's BFCArena attempted a single 2 GiB allocation (x19/x21 = 0x80000000) while growing its memory pool during inference. Chromium's allocator shim refuses single allocations that large and intentionally traps (brk 0), taking down the entire app, including all open worktrees and agent sessions.

Environment

  • Orca 1.4.128 (Electron 42.3.3)
  • macOS 27.0 (26A5378j), Mac16,5 (M4 Max, 128 GB)
  • libonnxruntime.1.23.2.dylib / sherpa-onnx-darwin-arm64 as shipped in Contents/Resources/node_modules
  • Process uptime ~17h at crash time

Crashed thread (Thread 50, WorkerThread)

libsystem_malloc  _malloc_zone_memalign + 300
libc++abi         operator new(unsigned long, std::align_val_t) + 80
libonnxruntime    onnxruntime::BFCArena::Extend(unsigned long) + 368
libonnxruntime    onnxruntime::BFCArena::AllocateRawInternal(...) + 528
libonnxruntime    onnxruntime::Tensor::Tensor(...) + 176
libonnxruntime    onnxruntime::ExecutionFrame::AllocateMLValueTensorSelfOwnBufferHelper(...)
libonnxruntime    ... ExecuteKernel / ExecuteThePlan / InferenceSession::Run
libsherpa-onnx    sherpa_onnx::OfflineTransducerNeMoModel::Impl::RunEncoder(...)
libsherpa-onnx    sherpa_onnx::OfflineRecognizerTransducerNeMoImpl::DecodeStreams(...)
sherpa-onnx.node  DecodeOfflineStreamWrapper(Napi::CallbackInfo const&)
Electron          napi_* -> node::worker::MessagePort::OnMessage -> uv_run (worker thread)

The frames above operator new resolve to bogus nearest-symbol names in the stripped Electron binary (ares_dns_rr_get_ttl + 3284868 etc.); they are Chromium's allocator shim / OOM crash handler executing an intentional brk 0 after rejecting the oversized request.

Register state at trap: x19 = x21 = 0x0000000080000000 (2 GiB request), esr = 0xf2000000 (Breakpoint) brk 0.

Analysis

  • The offline (batch) recognizer decodes the whole audio buffer in one call, so encoder tensor sizes scale with audio length. BFCArena grows by doubling, so a long enough capture doubles the arena past 2 GiB.
  • Chromium's allocator shim hard-caps single allocations; instead of returning nullptr it calls its immediate-crash path. One oversized tensor allocation on a worker thread therefore kills the whole app. The machine itself was under no memory pressure (128 GB).

Suggested fixes

  1. Chunk/stream audio into the offline recognizer (or use the streaming recognizer) so tensor sizes are bounded regardless of capture length.
  2. Cap BFCArena growth (OrtArenaCfg max_mem / arena_extend_strategy = kSameAsRequested) below Chromium's single-allocation limit.
  3. Run inference in a separate utility/child process so an ONNX OOM cannot take down the main app and every open workspace.

Full .ips crash report available on request (omitted here as it contains device identifiers).

Activity

  1. dogangok commented on Jul 9, 2026

    @dogangok
    Author

    Possibly related, from the same setup: in the Orca iOS app, the microphone button on the standard Apple keyboard is not usable. Tapping it dismisses dictation immediately, so Apple's built-in speech-to-text can never be used as input. That leaves Orca's bundled recognizer as the only voice path, which is the component that crashed above.

    If system dictation (iOS keyboard mic, and macOS dictation on desktop) worked as a plain text input, users would not need to depend on the in-app sherpa-onnx pipeline at all. Worth checking whether something in the input view (e.g. a custom text field re-grabbing first responder, or inputView/focus handling in the webview) is cancelling the keyboard dictation session.

  2. self-assigned this
    on Jul 9, 2026
  3. AmethystLiang commented on Jul 9, 2026

    @AmethystLiang
    Contributor

    will be in next release

  4. added theissue type on Jul 12, 2026
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

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions