Skip to content

Windows: embedded Bun 1.3.14 predates oven-sh/bun#35083 — opencode.exe segfaults whenever nProtect GameGuard (Helldivers 2) is running #44513

Closed as not planned

Description

@nyecov

Description

opencode.exe dies with a Bun panic whenever nProtect GameGuard is running — i.e. any time Helldivers 2 (or another GameGuard title) is open. GameGuard's npggNT64.des injects into running processes and raises a first-chance access violation inside its own __try/__except. Bun's vectored exception handler claims that fault before SEH can run, and treats it as fatal. An otherwise-idle opencode session survives indefinitely, then dies seconds after the game launches.

The crash signature is documented upstream in oven-sh/bun#34055 — Segmentation fault at address 0x3C, with npggNT64.des / USER32.dll in the stack.

This is already fixed in Bun. oven-sh/bun#35083 ("let foreign first-chance AVs reach SEH via JSC unwind info") merged 2026-07-23; the VEH now only claims faults originating inside Bun's own image. It first shipped in Bun 1.4.0 (2026-08-20).

OpenCode hasn't picked it up:

  • package.json on main pins "packageManager": "bun@1.3.14" — 1.3.14 was released 2026-05-13, two months before the fix.
  • Byte-scanning the shipped opencode.exe from 1.18.21 (published 2026-08-21, a day after Bun 1.4.0) finds only Bun v1.3.14; no 1.4 string is present.

The reason this needs fixing here rather than by the user: bun upgrade updates the standalone bun binary, not the runtime compiled into opencode.exe. There is no user-side workaround short of running opencode from source under a newer Bun, or moving to WSL2. It needs a rebuild against Bun >= 1.4.0.

Upstream context on the distribution problem: oven-sh/bun#40241.

Plugins

None.

OpenCode version

1.18.21 (npm opencode-ai, windows-x64)

Steps to reproduce

  1. Start opencode on Windows and leave it idle at the prompt.
  2. Launch Helldivers 2 (or any nProtect GameGuard title).
  3. opencode exits with the Bun panic within seconds of GameGuard initialising.

Operating System

Windows 11 26100, x64

Terminal

Not terminal-specific — the fault is in the embedded runtime's exception handler, so it reproduces regardless of host terminal.

Activity

  1. github-actions commented on Aug 23, 2026

    @github-actions
    Contributor

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

    If the fix in oven-sh/bun#35083 (Bun 1.4.0) resolves the underlying exception-handler issue, it may address those reports as well. Cross-linking for maintainer visibility.

  2. nyecov commented on Aug 23, 2026

    @nyecov
    Author

    Tracing the build, the fix looks like a one-line change.

    .github/actions/setup-bun derives the toolchain version solely from package.json:

    V=$(node -p "require('./package.json').packageManager.split('@')[1]")
    url=https://github.com/oven-sh/bun/releases/download/bun-v${V}/bun-${OS}-x64-baseline.zip
    

    with bun-version-file: package.json for the non-baseline path. packages/opencode/script/build.ts then compiles via Bun.build({ compile: { target: "bun-windows-x64", ... } }), so the embedded runtime is whatever version of Bun runs the build.

    So bumping "packageManager": "bun@1.3.14" → "bun@1.4.0" should be sufficient to propagate the fix to every published target — no code change. bun-windows-x64.zip and bun-windows-x64-baseline.zip both exist on the bun-v1.4.0 release, so the baseline path resolves too. CONTRIBUTING already states "Requirements: Bun 1.3+", so 1.4.0 is within the supported range.

    Worth noting the beta and dev branches also still pin bun@1.3.14, so there's currently no channel where users can pick this up.

  3. cwx07426 commented on Oct 10, 2026

    @cwx07426

    Additional reproduction: Yan Kernel (same embedded Bun 1.3.14, same crash)

    This is not specific to opencode — any product built on this kernel reproduces it. Confirmed on Yan Agent / Yan Kernel (Windows desktop), which ships the same opencode.exe runtime.

    Evidence from this machine:

    • Kernel binary: %APPDATA%\yan-agent\YanData\opencode-runtime\bin\all-file-tools-v1-344eedb423ef3c4d\opencode.exe, ProductVersion = 1.3.14 (embedded Bun 1.3.14).
    • Crash log (YanData\yan-core\events.jsonl):
    • Trigger: while nProtect GameGuard is running (local GameMon.des / GameMon64.des active). The kernel dies at startup, in bursts; recovers as soon as the game exits.

    Same root cause as this issue: embedded Bun 1.3.14 predates oven-sh/bun#35083 (first shipped in Bun 1.4.0). The fix path is the same — bump the pinned bun@1.3.14 to >=1.4.0 and rebuild the compiled binary. Any downstream consumer embedding this kernel is affected, so it would help to note that in the fix.

    Environment: Windows 11 26100, x64; kernel opencode 1.18.11 / Bun 1.3.14.

  4. thdxr commented on Oct 11, 2026

    @thdxr
    Member

    Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

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