Skip to content

OpenCode 1.1.59 crashes immediately on chat (Bun AVX crash) #13282

Closed as not planned

Description

@ZimaBlueee

Description

Description

After upgrading to OpenCode 1.1.59, the application crashes immediately as soon as I start a conversation.

It was working normally before the upgrade. Now, whenever I send a message, OpenCode crashes instantly.

My CPU supports AVX and AVX2 (Xeon W-2123, Skylake architecture), but Bun reports "CPU lacks AVX support".

I installed Bun separately on the same machine:

bun --version
1.3.9

The standalone Bun installation works correctly and does NOT crash.

This suggests that the issue is specific to the Bun binary bundled with OpenCode 1.1.59, rather than my CPU or Windows environment.


Environment

OS:

  • Windows 10 Enterprise LTSC 1809
  • OS Build: 17763.2989
  • Installed: 2021/05/06

Node version:
v24.13.0

OpenCode version:
1.1.59 (installed via Scoop)


Crash Output


Bun v1.3.8 (b64edcb4) Windows x64

CPU lacks AVX support. Please consider upgrading to a newer CPU.

panic(thread 12254): Segmentation fault at address 0xA
oh no: Bun has crashed. This indicates a bug in Bun, not your code.

To send a redacted crash report to Bun's team,
please file a GitHub issue using the link below:

[https://bun.report/1.3.8/](https://bun.report/1.3.8/)...

Plugins

oh-my-opencode

OpenCode version

1.1.59 (installed via Scoop)

Steps to reproduce

No response

Screenshot and/or share link

Image

Operating System

Windows 10 Enterprise LTSC 1809

Terminal

wezterm

Activity

  1. github-actions commented on Feb 12, 2026

    @github-actions
    Contributor

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

    These issues all stem from the same root cause: OpenCode binaries are compiled with AVX/AVX2 instructions that aren't supported on older CPUs, causing immediate crashes. Your environment (Windows 10 LTSC with an older CPU architecture) is affected by the same bug.

  2. mm98 commented on Feb 12, 2026

    @mm98

    I have a similar challenge. Bun.exe uses all memory and my PC freeze completely. I sometime get "Out of memory" exception in OpenCode desktop. I tried to take a screenshot, but it is completely impossible - since my PC locks up completely.

  3. ZimaBlueee commented on Feb 12, 2026

    @ZimaBlueee
    Author

    Thanks — but this seems different.

    My issue is an immediate AVX crash, not high memory usage or system freeze.
    Standalone Bun works fine for me, so the problem appears specific to OpenCode’s bundled runtime.

  4. ZimaBlueee commented on Feb 12, 2026

    @ZimaBlueee
    Author

    Root Cause Identified

    I was able to reproduce the crash consistently.

    The issue is triggered when a custom tool imports bun inside a tool file.

    This version crashes immediately:

    import { tool } from "@opencode-ai/plugin"
    import path from "path"
    import { $ } from "bun"
    
    export default tool({
        description: "xxx",
        args: {
            table_name: tool.schema.string().describe("xxx"),
            category_name: tool.schema.string().optional().describe("xxx"),
        },
        async execute(args, context) {
            const { table_name, category_name } = args
            const script = path.join(context.directory, "tools/create-business-entity.js")
            
            const result = await $`node ${script} ${table_name} ${category_name ?? "xxx"}`.text()
    
            return result
        },
    })

    As soon as this tool exists in the tools directory, OpenCode 1.1.59 crashes on startup or when starting a conversation.


    Conclusion

    The crash appears to be triggered specifically by:

    import { $ } from "bun"
    

    inside a custom tool.

    Standalone Bun (v1.3.9) works fine on my system, so this seems related to how Bun is bundled or exposed within OpenCode 1.1.59.

    This is not a CPU limitation issue.

  5. luaNewer commented on Feb 12, 2026

    @luaNewer

    I met same problem as you today,same OS version,same Node version and same OpenCode version!

    My temp solution:

    1. set autoupdate to false in opencode.json;
    2. use baseline 1.1.59 opencodex.exe instead,replace it in none baseline folder.

    Btw,1.1.60 has the same problem,even include 1.1.60 baseline exe version!
    Waiting someone fix this...

  6. trollkarlen commented on Feb 12, 2026

    @trollkarlen

    It was introduced in version 1.1.52, version 1.1.51 works without SIGILL for non AVX machines.

    for a in $(seq 53 -1 50); do echo "installing"; yarn global add opencode-ai@1.1.$a; echo "testing"; timeout 5 opencode >/dev/null; RET=$?; if [[ $RET == 124 ]]; then echo "exit code $RET in version $a, it works ?"; break; else echo "failed $RET"; fi; done

    It also hides the exit code for SIGILL from the user and just exits without any output with exit code 0.

    So a double fault 🥇

  7. rekram1-node commented on Feb 12, 2026

    @rekram1-node
    Collaborator

    How many of you are running opencode raw and hit this issue?

    Like without custom plugins or tools

  8. Junxiao-Liao commented on Feb 16, 2026

    @Junxiao-Liao

    How many of you are running opencode raw and hit this issue?你们当中有多少人使用 opencode raw 版本并遇到过这个问题?

    Like without custom plugins or tools就像没有自定义插件或工具一样

    Raw version, 1.2.5 and 1.2.6 still (tried downloading via curl and npm)

    # opencode
    ============================================================
    Bun v1.3.9 (cf6cdbbb) Linux x64 (baseline)
    Linux Kernel v6.8.0 | glibc v2.39
    Args: "/root/.nvm/versions/node/v24.12.0/lib/node_modules/opencode-ai/node_modules/opencode-linux-x64-baseline/bin/opencode" "--user-agent=opencode/1.2.6" "--use-system-ca" "--"
    Features: jsc no_avx2 no_avx standalone_executable 
    Builtins: "bun:main" 
    Elapsed: 54365ms | User: 30229ms | Sys: 21599ms
    RSS: 15.96GB | Peak: 8.66GB | Commit: 15.96GB | Faults: 29 | Machine: 16.73GB
    
    CPU lacks AVX support. Please consider upgrading to a newer CPU.
    panic(main thread): Segmentation fault at address 0x2C8A8000000
    oh no: Bun has crashed. This indicates a bug in Bun, not your code.
    
    To send a redacted crash report to Bun's team,
    please file a GitHub issue using the link below:
    
  9. jcmrs commented on Feb 17, 2026

    @jcmrs

    This confirms the issue affects modern CPUs with full AVX2 support, not just older/limited hardware.

    Additional Data Point: i9-14900HX with AVX2 Still Crashes on Windows 11

    I'm experiencing the same crash on a modern, high-end CPU with full AVX2 support, confirming this is a Bun packaging bug rather than a CPU limitation.

    Environment

    CPU: Intel Core i9-14900HX

    • Architecture: Raptor Lake (2023)
    • AVX Support: Confirmed present (SSE4.2, AVX, AVX2 all detected)
    • Verification: wmic cpu get caption shows Intel64 Family 6 Model 183

    OS: Windows 11
    OpenCode Version: 1.2.6
    Installation Method: npm (npm install -g opencode-ai)
    Bun Version: 1.3.9 (cf6cdbbb)

    Crash Output

    ============================================================
    Bun v1.3.9 (cf6cdbbb) Windows x64
    Windows v.win11_dt
    CPU: sse42 avx avx2
    Args: "C:\Users\username\AppData\Roaming\npm\node_modules\opencode-ai\node_modules\opencode-windows-x64\bin\opencode.exe" "--version"
    Elapsed: 1ms | User: 0ms | Sys: 15ms
    RSS: 18.50MB | Peak: 18.50MB | Commit: 55.67MB | Faults: 4685
    
    panic(main thread): Segmentation fault at address 0x7FF7BF55795D
    oh no: Bun has crashed. This indicates a bug in Bun, not your code.
    

    Key Observations

    1. Bun correctly detects AVX support (CPU: sse42 avx avx2) but still crashes
    2. Both builds installed: The npm package correctly installed both opencode-windows-x64 and opencode-windows-x64-baseline in node_modules, but npm resolves to the non-baseline version by default
    3. Baseline version exists but not used: Despite the baseline build being available as an optional dependency, the package manager doesn't fallback to it

    Reproduction Steps

    # Install via npm
    npm install -g opencode-ai
    
    # Verify both builds present
    dir C:\Users\<USER>\AppData\Roaming\npm\node_modules\opencode-ai\node_modules | findstr opencode-windows
    
    # Outputs:
    # opencode-windows-x64              <- Used by default (crashes)
    # opencode-windows-x64-baseline     <- Available but not used
    
    # Any opencode command crashes
    opencode --version
    opencode --continue

    Suggested Fix

    The npm package should either:

    1. Detect CPU at install time and choose the appropriate build, OR
    2. Default to baseline on Windows since the non-baseline build appears broken on Bun 1.3.9, OR
    3. Add runtime fallback in the wrapper script to try baseline if main binary crashes

    Workaround

    None. Unable to use OpenCode.

    This confirms the issue affects modern CPUs with full AVX2 support, not just older/limited hardware.

  10. thdxr commented on Feb 17, 2026

    @thdxr
    Member

    ^ if you download bun 1.3.9 non-baseline does it also not work? we're trying to figure out if this is a bun problem or an us problem

  11. jcmrs commented on Feb 17, 2026

    @jcmrs

    ^ if you download bun 1.3.9 non-baseline does it also not work? we're trying to figure out if this is a bun problem or an us problem

    opencode-windows-x64-baseline <- Used (crashes)

    But: peculiarly.

    1. Instance: same error -> crash
    2. second instance (parallel): no error -> no crash.
  12. trollkarlen commented on Feb 28, 2026

    @trollkarlen

    Any update on this?
    And it's all platforms not just windows.

  13. jakubdyszkiewicz commented on Mar 5, 2026

    @jakubdyszkiewicz
    ❯❯❯ opencode --version
    ============================================================
    Bun v1.3.10 (30e609e0) Linux x64 (baseline)
    Linux Kernel v6.8.0 | glibc v2.39
    Args: "opencode" "--user-agent=opencode/1.2.17" "--use-system-ca" "--" "--version"
    Features: jsc no_avx2 no_avx standalone_executable
    Builtins: "bun:main"
    Elapsed: 22904ms | User: 19277ms | Sys: 3626ms
    RSS: 15.96GB | Peak: 8.69GB | Commit: 15.96GB | Faults: 0 | Machine: 16.77GB
    
    CPU lacks AVX support. Please consider upgrading to a newer CPU.
    panic(main thread): Segmentation fault at address 0x42FC8000000
    oh no: Bun has crashed. This indicates a bug in Bun, not your code.
    
    To send a redacted crash report to Bun's team,
    please file a GitHub issue using the link below:
    
     https://bun.report/1.3.10/Ba130e609eEggggigD40guyE+ypRgky19CmrtoqDk95mqD+l0m2DorzvnE6xt2sEw+towF_iznziEiznziEiznziEiznziEiznziEiznziEiznziEiznziEiznziEiznziEA2+iChgggg4B
    
    fish: Job 1, 'opencode --version' terminated by signal SIGILL (Illegal instruction)
    

    I hit the same issue on my Ubuntu VM spawned using libvirt. It's eating all the memory and then crashes.

    ❯❯❯ lscpu
    Architecture:             x86_64
      CPU op-mode(s):         32-bit, 64-bit
      Address sizes:          40 bits physical, 48 bits virtual
      Byte Order:             Little Endian
    CPU(s):                   14
      On-line CPU(s) list:    0-13
    Vendor ID:                AuthenticAMD
      BIOS Vendor ID:         QEMU
      Model name:             QEMU Virtual CPU version 2.5+
        BIOS Model name:      pc-q35-5.2  CPU @ 2.0GHz
        BIOS CPU family:      1
        CPU family:           6
        Model:                6
        Thread(s) per core:   1
        Core(s) per socket:   1
        Socket(s):            14
        Stepping:             3
        BogoMIPS:             7599.96
        Flags:                fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx lm nopl cpuid tsc_known_freq pni cx16 x2apic hypervisor lahf_lm svm 3dnowprefetch vmmcall
    Virtualization features:
      Virtualization:         AMD-V
      Hypervisor vendor:      KVM
      Virtualization type:    full
    Caches (sum of all):
      L1d:                    896 KiB (14 instances)
      L1i:                    896 KiB (14 instances)
      L2:                     7 MiB (14 instances)
      L3:                     224 MiB (14 instances)
    NUMA:
      NUMA node(s):           1
      NUMA node0 CPU(s):      0-13
    Vulnerabilities:
      Gather data sampling:   Not affected
      Itlb multihit:          Not affected
      L1tf:                   Not affected
      Mds:                    Not affected
      Meltdown:               Not affected
      Mmio stale data:        Not affected
      Reg file data sampling: Not affected
      Retbleed:               Not affected
      Spec rstack overflow:   Not affected
      Spec store bypass:      Vulnerable
      Spectre v1:             Mitigation; usercopy/swapgs barriers and __user pointer sanitization
      Spectre v2:             Mitigation; Retpolines; STIBP disabled; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected
      Srbds:                  Not affected
      Tsx async abort:        Not affected
      Vmscape:                Not affected
    
    ❯❯❯ lsb_release -a
    No LSB modules are available.
    Distributor ID:	Ubuntu
    Description:	Ubuntu 24.04.3 LTS
    Release:	24.04
    Codename:	noble
    

    I installed it via

    curl -fsSL https://opencode.ai/install | bash
    

    Downgrade to 1.1.51 solves the problem

    npm install -g opencode-ai@1.1.51
    

    I'm happy to test stuff if needed.

    edit: I found the solution. I had to add change my libvirt VM config to replace CPU settings with <cpu mode='host-passthrough'/>. Now it works

  14. kskyj commented on Mar 19, 2026

    @kskyj

    I’ve found the root cause of this issue!

    It seems to be triggered by the presence of a .env file in the directory where opencode is executed.

    Here is what I discovered:

    If the .env file is empty (0kb), it works fine.

    If the .env file has any content, the issue occurs.

    As a workaround, check if there is an existing .env file in your current working directory and try removing or emptying it.

  15. removed
    bugSomething isn't working
    perfIndicates a performance issue or need for optimization
    on May 3, 2026
  16. github-actions commented on Jul 3, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  17. glepretre commented on Jul 3, 2026

    @glepretre

    It is very useful to clutter up a GitHub repository by forcing the creation of new issues, even though the old ones were perfectly legitimate and unresolved. 😒

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