Skip to content

opencode crashes on aarch64+64k systems (64KB page size) #12474

Closed

Description

@surak

Issue Description

opencode crashes immediately with Aborted (core dumped) on systems using 64KB page sizes (aarch64+64k). This affects modern ARM systems, including NVIDIA Grace Hopper nodes and other HPC ARM clusters.

Steps to Reproduce

  1. Try to run opencode on a system with aarch64+64k kernel (64KB page size)
  2. Command: opencode --version
  3. Result: Aborted (core dumped)

System Information

Affected System:

  • Kernel: Linux jpbl-s03-02 5.14.0-611.16.1.el9_7.aarch64+64k
  • Page size: 65536 (64KB)
  • CPU: ARM Neoverse-V2 (NVIDIA Grace architecture)
  • Architecture: aarch64

strace output shows the crash:

mmap(0x3840a000000, 1073741824, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x3840a000000
--- SIGABRT {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=3669902, si_uid=8351} ---
+++ killed by SIGABRT (core dumped) +++

The binary tries to map memory with 4KB-aligned expectations but fails on a 64K page system.

Root Cause

The opencode binary is compiled assuming 4KB page granularity, which is the standard on most systems. However, modern ARM HPC systems (like NVIDIA Grace CPUs) use 64KB page sizes (aarch64+64k) for better TLB efficiency on memory-intensive workloads.

When the memory allocator (likely Rust's allocator or jemalloc) tries to perform operations based on 4KB page assumptions, they fail silently or crash on systems where the kernel reports different page alignment.

Why This Matters

This issue is critical for NVIDIA Grace Hopper nodes and all new ARM HPC systems:

  1. NVIDIA Grace Hopper: All Grace and Grace Hopper systems from NVIDIA use aarch64+64k kernels. This means opencode cannot run on any of these systems.

  2. Modern ARM HPC: Many ARM-based supercomputers (like the Jülich JUPITER cluster where this was discovered) are adopting 64KB pages for:

    • Better TLB efficiency on large-memory workloads
    • Reduced overhead for massive datasets
    • Improved performance for AI/ML workloads
  3. Future-proofing: As more ARM HPC hardware comes online, this class of architecture will become common in scientific computing and AI research.

  4. Binary compatibility: Even if a distribution provides standard aarch64 versions, HPC clusters often use custom kernels with 64K pages for performance.

Expected Behavior

opencode should run on aarch64+64k systems without crashing.

Possible Solutions

  1. Multi-arch builds: Provide a separate linux-aarch64-64k build alongside standard linux-aarch64
  2. Runtime detection: The application could detect page size at startup and adapt accordingly
  3. Source builds: Ensure the build process can be done on 64K page systems successfully

Affected Platforms

  • NVIDIA Grace CPU systems (all current and future)
  • NVIDIA Grace Hopper (Grace + H100) systems
  • ARM Neoverse-V2 based HPC clusters with 64KB page kernels
  • Any system running aarch64+64k Linux kernel

Additional Notes

  • The application loads all system libraries correctly (glibc 2.34, no missing dependencies)
  • Standard Linux tools run fine on this system
  • This is purely a page-size compatibility issue

Activity

  1. github-actions commented on Feb 6, 2026

    @github-actions
    Contributor

    This issue might be related to other binary compatibility/platform-specific crashes. Please check:

    The aarch64+64k page size issue appears to be unique to modern ARM HPC systems (NVIDIA Grace/Grace Hopper). If you're encountering this on those systems, the solutions mentioned (multi-arch builds, runtime detection, or source builds) may be worth exploring.

  2. ndevenish commented on Feb 26, 2026

    @ndevenish

    That github-actions suggestion seems to be a completely different issue. Also running into this.

  3. surak commented on Feb 27, 2026

    @surak
    Author

    That github-actions suggestion seems to be a completely different issue. Also running into this.

    Could you please link to one failed run?

  4. ndevenish commented on Feb 27, 2026

    @ndevenish

    I don't think it gets far enough for that?

    % opencode  --help
    zsh: abort (core dumped)  opencode --help
    % uname -a
    Linux bl24i-sc-gh-01 6.8.0-85-generic-64k #85-Ubuntu SMP PREEMPT_DYNAMIC Thu Sep 18 16:52:51 UTC 2025 aarch64 aarch64 aarch64 GNU/Linux
    

    However, suspect barrier to entry is a bit higher than hoped

    % bun install
    bun install v1.3.10 (30e609e0)
      ⚙️  tree-sitter-bash... error: install script from "tree-sitter-bash" terminated by SIGABRT (Abort)
    zsh: abort (core dumped)  bun install
    % bun install
    bun install v1.3.10 (30e609e0)
    
    $ husky
    error: prepare script from "opencode" terminated by SIGABRT (Abort)
    zsh: abort (core dumped)  bun install
    

    FWIW Claude Code also doesn't install. It seems this GH200 is not destined for this style of development.

  5. notpaulmartin commented on Mar 2, 2026

    @notpaulmartin

    I have the same issue trying to run opencode on a GH200 node.
    It appears to be an issue specifically with bun and aarch64 + 64k pages. Claude Code via node (npm install -g @anthropic-ai/claude-code) works fine

  6. VictorLee438 commented on Apr 28, 2026

    @VictorLee438

    Can this be resolved by recompiling the project with the latest Bun?

  7. surak commented on May 12, 2026

    @surak
    Author

    Fixed on latest release

  8. jiqimao0001 commented on May 24, 2026

    @jiqimao0001
    ## Verification: ARM64 + 64KB page crash is fixed in v1.15.10+
    
    I've verified the fix chain for this issue. Here's the complete analysis:
    
    ### Root Cause Chain

    opencode SIGABRT → Bun runtime → JSC (JavaScriptCore) hardcoded 16KB page assumptions → mmap alignment failure on 64KB page kernels

    
    ### Fix Timeline
    - **Bun v1.3.12** (PR [#28345](https://github.com/oven-sh/bun/pull/28345)): Patched JSC to support 64KB page size
    - **opencode v1.15.10**: Ships ARM64 binaries compiled with **Bun v1.3.14** (includes the fix)
    
    ### Verification
    The `[email protected]` package contains a binary compiled with Bun v1.3.14:
    
    

    $ strings package/bin/opencode | grep "1.3.14"
    https://github.com/oven-sh/bun/releases/download/bun-v1.3.14/bun-linux-aarch64.zip
    1.3.14+0d9b296af

    
    This confirms the embedded Bun runtime includes the 64KB page size fix from PR #28345.
    
    ### Available ARM64 Packages
    The following ARM64 packages are now published on npm:
    - `opencode-linux-arm64` (glibc)
    - `opencode-linux-arm64-musl` (Alpine/musl)
    
    ### Installation on 64KB Page Systems
    Users on aarch64 + 64KB page kernels (e.g., NVIDIA Grace Hopper, AWS Graviton with 64k kernel, Ubuntu 24.04 `linux-arm64-64k`) should:
    
    ```bash
    npm install -g opencode-ai@latest
    # or
    npx opencode-ai@latest
    

    The postinstall script will automatically detect arm64 architecture and download the correct binary.

    For Users Still Experiencing Issues

    If you're still seeing crashes, please confirm:

    1. Your opencode version is ≥ 1.15.10 (opencode --version)
    2. You're using the native ARM64 binary, not x64 via emulation (file $(which opencode))
    3. Share your kernel version (uname -a) and the exact error output

    Thanks to the Bun team for the JSC patch (#28345) and the opencode team for shipping ARM64 builds.

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