GeezerVison is showing github.com — [Bug] Segfault in onnxruntime_binding.node under OpenCode 2.3.2 (Windows x64, Bun 1.4.4) — reproducible, isolated to opencode-mem 2.43.0 · Issue #518 · tickernelz/opencode-mem
[Bug] Segfault in onnxruntime_binding.node under OpenCode 2.3.2 (Windows x64, Bun 1.4.4) — reproducible, isolated to opencode-mem 2.43.0 #518DescriptionEnvironment
- OS: Windows 10 22H2 (10.0.19045), x64
- OpenCode:
@opencode/cli 2.3.2 (standalone compiled binary, Bun 1.4.4)
- opencode-mem: 2.43.0 (installed in an isolated prefix)
- onnxruntime-node: 1.31.1 (pinned by the plugin)
- Other plugins loaded: 2 pure-JS plugins (no onnx/libsql users)
- Embedding: default local (
Xenova/nomic-embed-text-v1), storagePath on a clean isolated dir; .turso-migrated present and all 7 shard sidecars report status: complete
Summary
With opencode-mem 2.43.0 loaded, the opencode serve process (2.3.2) dies with a hard segfault in onnxruntime_binding.node. Two crashes observed: after ~98.7s and ~377.3s of uptime. Removing only opencode-mem from the plugin list makes the same workload stable (10+ minutes, no crash) — so the crash is isolated to this plugin's native dependency path.
Reproduction (isolated environment)
- Create an isolated XDG/HOME sandbox (
XDG_CONFIG_HOME, XDG_DATA_HOME, XDG_STATE_HOME, XDG_CACHE_HOME, USERPROFILE all point to a temp dir).
plugins = ["@dietrichgebert/[email protected]", "<opencode-mem-install-path>", "<local JS plugin>"] (the other two are pure JS).
opencode serve --hostname 127.0.0.1 --port 28899.
- Send any authenticated API request after the service is up, e.g.
GET /api/agent (HTTP Basic auth).
- The server segfaults (see output below). One run also crashed shortly after startup without external API calls.
Crash output (excerpt)
Bun v1.4.4 (38afee6c8) Windows x64
Windows v10.19045
...
Elapsed: 98745ms | User: 2515ms | Sys: 484ms
RSS: 0.35 GB | Peak: 0.38 GB | Commit: 0.65 GB | Faults: 133073
panic(main thread): Segmentation fault at address 0x0
oh no: Bun has crashed. This indicates a bug in Bun, not your code.
https://bun.report/1.4.4/wa138afee6mhmggIugooCCYMSVCP140.dllgo4ECwBonnxruntime_binding.node
...onnxruntime_binding.node... (repeated 5x in the crash report)
Isolation result
| Config |
Workload |
Result |
| with opencode-mem 2.43.0 |
serve + GET /api/agent |
segfault 2/2 |
| without opencode-mem |
identical workload |
stable (10+ min, no crash) |
Non-mem plugins were unchanged between runs. Memory operations themselves work correctly when the crash is not hit: writes produced MEMORY.md + entry files and cross-session recall returned the correct value.
Additional context
ActivityEyJunge1 commented on Nov 24, 2026 Fix PR: #521 — local ONNX on Windows runs in a Node/Bun subprocess; host SIGKILLs the worker on dispose and recovers after a worker crash. Workaround until merge: remote embeddingApiUrl + embeddingApiKey. EyJunge1 commented on Nov 24, 2026 Update on #521: local embeddings on Windows no longer require a separate Node/Bun install. If neither is on PATH, the plugin re-execs the OpenCode binary with `BUN_BE_BUN=1` so the worker runs in an isolated child using the host's embedded Bun runtime.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|