Skip to content

OpenCode v1.18.4 crashes with Bun libpas heap assertion and illegal instruction error on Windows #38721

Closed as not planned

Description

@Yijun-Linda

Description

Summary

When running OpenCode v1.18.4 on Windows 11, Open Code crashes with a Bun panic triggered by libpas heap assertion failure and illegal instruction exceptions. The crash consistently occurs during workflows that generate long AI output JSON strings with multiple workers enabled. Massive memory usage spikes and extreme page faults precede every crash.

This appears to be a runtime-level bug in the embedded Windows standalone Bun build rather than a user configuration or project code issue.

Environment

OS: Windows 11 x64
OpenCode version with crash: 1.18.4
Launch method: Run opencode.exe via VS Code terminal
Global standalone Bun installed separately: No
Embedded Bun version from crash log: Bun v1.3.14 (0d9b296a)
Architecture: windows x64 baseline / windows x86_64_baseline [StandaloneExecutable]
Runtime mode: standalone_executable
CPU Features: sse42, avx, avx2 supported

Crash Output Snippet

Bun v1.3.14 (0d9b296a) Windows x64 (baseline)
CPU:sse42 avx avx2
Args: "C:\Users\DELL\.bun\..\node_modules\opencode-ai\bin\opencode.exe" "--user-agent=opencode/1.18.4" "--use-system-ca" "---"
panic(thread 26236): Illegal instruction at address0x7FF62B5CA852
oh no:Bun has crashed.This indicates a bug inBun, not your code.

Crash stack trace root cause: pas_assertion_failed_inline inside libpas bmalloc heap allocator
Key resource metrics before crash:
RSS: 7.59GB | Peak memory:10.22GB
Virtual memory commit: 27.20GB
Total page faults: over 1.2 billion
Long runtime elapsed before crash: ~5.7 hours
Workers spawned: 2

What I was doing

I launched OpenCode inside a local project through the VS Code terminal.

The crash reproduces reliably under heavy AI workflows with the following characteristics:

  • Multiple parallel sub-agent enabled
  • Large AI model outputs requiring construction of extremely long JSON strings
  • Frequent string buffer resizing and JSON serialization via StringBuilder
  • Long continuous runtime

The crash is an abrupt native process kill, and no regular application-level errors show up in OpenCode logs before the Bun panic. Standard model API errors like timeouts or quota limits appear separately in logs and do not trigger this fatal heap crash on their own.

Plugins

Oh my Openagent v4.19.1

OpenCode version

v1.18.4

Steps to reproduce

No response

Screenshot and/or share link

Image

Operating System

Windows 11 x64

Terminal

VS Code terminal

Activity

  1. shiping430 commented on Aug 19, 2026

    @shiping430

    Same crash here, still reproducible on the latest stable v1.18.18 (npm global install, Windows 10):

    • Bun v1.3.14 (0d9b296a) Windows x64 (baseline)
    • CPU: sse42 avx avx2
    • panic(thread 3156): Illegal instruction at address 0x7FF76701A852
    • Crashed ~15 min into a long-running TUI session (Elapsed: 886414ms), RSS 2.75GB / Peak 4.23GB, ~11M page faults
    • The Bun crash report is dumped straight into the TUI and appears as garbled text over the interface

    Crash report link: https://bun.report/1.3.14/ea18d9b296m/GugogDk18u+CogkvtDq1+koDg9lz+Ciumz+C+6g+uC6m771B6m67uC8747uCurp

    This matches the libpas/bmalloc heap assertion failure signature from the original report. The bundled Bun 1.3.14 is unchanged in 1.18.18. Any ETA on bumping the embedded Bun runtime on Windows?

  2. 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