Skip to content

Illegal hardware instruction on macOS Intel Ivy Bridge (SIGILL on BMI2/shlxq) #26877

Closed as not planned

Description

@linletian

Description

opencode crashes immediately on this machine with:
zsh: illegal hardware instruction opencode

I did some local debugging and the failure appears to be a CPU instruction-set incompatibility in the shipped macOS x64 binary.

Details:

  • Machine: Mac Pro 6,1 (Late 2013)
  • CPU: Intel Xeon E5-1680 v2 (Ivy Bridge)
  • OS: macOS 12.7.6
  • Binary path: ~/.opencode/bin/opencode
  • file ~/.opencode/bin/opencode reports a Mach-O x86_64 executable
  • opencode --version crashes with Illegal instruction: 4
  • macOS crash report shows SIGILL / EXC_BAD_INSTRUCTION
  • lldb stops on shlxq %rax, %rcx, %rdx, which is a BMI2 instruction
  • sysctl machdep.cpu.features machdep.cpu.leaf7_features shows AVX1.0, but no AVX2/BMI2 support on this CPU

This suggests the current macOS x64 build requires Haswell-era instructions (BMI2 and possibly AVX2), so it is not compatible with Ivy Bridge Xeons.

Possibly related to #8345, but I am filing this with the concrete low-level crash details from this machine.

Plugins

none

OpenCode version

Unable to retrieve, because the binary crashes before opencode --version can print anything.

The embedded Bun runtime strings in the binary include v1.3.13.

Steps to reproduce

  1. Use a Mac Pro 6,1 or another Intel Mac with an Ivy Bridge CPU lacking AVX2/BMI2.
  2. Install the latest OpenCode CLI so that the binary is placed at ~/.opencode/bin/opencode.
  3. Run opencode or opencode --version.
  4. Observe the immediate crash: zsh: illegal hardware instruction opencode.
  5. If launched under lldb, the process stops on shlxq %rax, %rcx, %rdx before startup completes.

Screenshot and/or share link

No response

Operating System

macOS 12.7.6 on Mac Pro 6,1 (Late 2013), Intel Xeon E5-1680 v2 / Ivy Bridge

Terminal

Terminal.app

Activity

  1. github-actions commented on May 11, 2026

    @github-actions
    Contributor

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

    If any of these cover your case, please consider closing this issue to avoid fragmentation.

  2. linletian commented on Jun 18, 2026

    @linletian
    Author

    Superseded by #32850 — same root cause, but the new issue adds the key finding that opencode-linux-x64-baseline works perfectly on the exact same CPU (VMware Ubuntu), proving this is a macOS-specific JIT issue rather than a fundamental CPU incompatibility.

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