Skip to content

[BUG] Illegal instruction crash on CPUs without AVX after 2.1.112 (native binary regression) #50384

Closed as not planned

Description

@mauroencinas

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Starting from version 2.1.113, the CLI crashes immediately with "Illegal instruction".

Version 2.1.112 works correctly in the same environment.

This regression appears to coincide with the change to spawning a native binary instead of running bundled JavaScript.

The issue is likely caused by the native binary requiring CPU instructions (e.g. AVX/AVX2) that are not available on older CPUs.

What Should Happen?

The CLI should start normally.

If the system CPU does not support required instructions, the CLI should:

  • either provide a compatible baseline binary (no AVX requirement), or
  • gracefully fall back to a compatible implementation instead of crashing.

Error Messages/Logs

Illegal instruction

Steps to Reproduce

  1. Install latest version:
    npm install -g @anthropic-ai/claude-code@2.1.113

  2. Run:
    claude --version

  3. Observe crash:
    Illegal instruction

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.112

Claude Code Version

2.1.113

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

VS Code integrated terminal

Additional Information

CPU:
AMD A4-3310MX APU (older CPU without AVX/AVX2 support)

Relevant CPU flags:
sse, sse2, sse4a (NO avx / avx2)

Environment:

  • Running inside Docker container
  • Node.js v24.13.0
  • npm 11.6.2

Key observation:
Version 2.1.112 works correctly, but 2.1.113+ crashes immediately.

This strongly suggests the newly introduced native binary is compiled with CPU instructions not supported on older hardware.

Suggested fix:

  • Provide a baseline x86_64 build without AVX requirements, or
  • Detect CPU capabilities at runtime and provide a fallback

Activity

  1. github-actions commented on Apr 18, 2026

    @github-actions

    Found 3 possible duplicate issues:

    1. [BUG] illegal hardware instruction, please compile without the AVX2 requirement #50190
    2. [BUG] Regression: ccd-cli v2.1.78 crashes with invalid opcode on non-AVX CPUs (same as fixed #19907) #37277
    3. Bundled Bun binary lacks AVX baseline support — crashes on non-AVX CPUs #33153

    This issue will be automatically closed as a duplicate in 3 days.

    • If your issue is a duplicate, please close it and 👍 the existing issue instead
    • To prevent auto-closure, add a comment or 👎 this comment

    🤖 Generated with Claude Code

  2. gcampaner commented on Apr 18, 2026

    @gcampaner

    Confirming the same regression on macOS Intel (Mac mini, x86_64) — not only Linux.

    Environment

    • Device: Mac mini (Intel, pre-AVX2)
    • OS: macOS (Darwin 22.6.0)
    • Node: v25.9.0
    • Shell: zsh
    • Install: npm install -g @anthropic-ai/claude-code

    Symptom

    $ claude
    zsh: illegal hardware instruction  claude
    

    No output, no stack trace — SIGILL immediately on launch.

    Versions tested

    Version Result
    2.1.111 Works
    2.1.112 Works (last known good)
    2.1.113 Crashes (illegal instruction)
    2.1.114 Crashes (illegal instruction)

    Root cause (matches this issue + #50190 + #33153)
    v2.1.113 switched to a native per-platform binary. That binary appears to be compiled with AVX/AVX2 as baseline, breaking older Intel Macs and any non-AVX x86_64 host. Since the native binary is bundled inside the npm package, there is no user-side workaround (swapping bun-baseline globally doesn't help — CC uses its own embedded binary, as documented in #33153).

    Workaround
    Pin to 2.1.112 and disable auto-updater:

    npm install -g @anthropic-ai/claude-code@2.1.112
    export DISABLE_AUTOUPDATER=1

    Request
    Please ship a baseline x86_64 native binary (no AVX requirement) or fall back to the bundled JS path when the host CPU lacks AVX2. The same class of regression was previously fixed after #19907 / #20019 — the fix just needs to survive the move to native binaries.

  3. neverbot commented on Apr 18, 2026

    @neverbot

    Confirming on Intel Core 2 Duo P7550 (MacBook Pro running NixOS). CPU flags include sse4_1 but lack sse4_2, popcnt and avx — below x86-64-v2.

    Bisection: 2.1.100/107/110/112 work, 2.1.113 and 2.1.114 crash with Illegal instruction (core dumped). Workaround confirmed: npm install -g @anthropic-ai/claude-code@2.1.112 + "autoUpdates": false in ~/.claude/settings.json.

    +1 for a baseline x86_64 build or JS fallback when AVX is missing.

  4. changed the title [-][BUG] Illegal instruction crash on CPUs without AVX after 2.1.111 (native binary regression)[/-] [+][BUG] Illegal instruction crash on CPUs without AVX after 2.1.112 (native binary regression)[/+] on Apr 18, 2026
  5. hibbes commented on Apr 19, 2026

    @hibbes

    For anyone who needs to stay on a current Claude Code version despite this regression, I posted a Node-only workaround over in #37065 — extracts the JS bundle from the .bun ELF section of @anthropic-ai/claude-code-linux-x64 and runs it under system Node, no Bun needed. Verified on Core 2 Duo P7350 (SSE4.1, no SSE4.2/POPCNT/AVX) with 2.1.114 — full TUI, MCP, skills, Glob/Grep. Not a replacement for an upstream fix (a CLAUDE_CODE_FORCE_NODE_FALLBACK=1 env in install.cjs + cli-wrapper.cjs would be the clean one-liner), but it unblocks users in the meantime.

  6. jhardin-accumula commented on Apr 22, 2026

    @jhardin-accumula

    @hibbes - does your workaround work with 2.1.117+? There was a serious problem regarding context handling in Opus 4.7 fixed in that release...

    among 2.1.117 bug fixes:

    "Opus 4.7's 1M context window was being wasted. Since Opus 4.7 shipped in 2.1.111, context calculations assumed a 200K window. This meant /context showed inflated usage percentages and autocompaction triggered roughly five times too early, effectively capping usable context at 200K. If you noticed Opus 4.7 sessions compacting much sooner than expected, this is the fix."

  7. hibbes commented on Apr 23, 2026

    @hibbes

    @jhardin-accumula Yes — confirmed working on 2.1.117. I'm running it on my Core 2 Duo P7350 right now (claude-node --version → 2.1.117 (Claude Code)), and the Opus 4.7 context-window fix is live (/context reports correctly, autocompact no longer fires at ~200K).

    For anyone re-running the extraction against 2.1.117, the bundle changed slightly vs. 2.1.116 and needs three small tweaks in the update script:

    1. IIFE header: now has whitespace between params (function(exports, require, module, …)) — replace fixed-string check with a regex allowing [[:space:]]*.
    2. Dep audit: new require subpaths (ajv/dist/runtime/…, fs/promises, path/posix, stream/consumers, timers/promises) get flagged as missing even though the root packages are declared. Reduce to the first path component (or @scope/name) before checking package.json; allow node-builtin subpaths via (/.*)?$.
    3. Bun audit: grep -oE only returns non-overlapping matches, so a second Bun.X inside the same guarded block was being missed. Rewrote in Python with per-occurrence ±200-char windowing; also catches typeof globalThis.Bun and Bun?.-optional chains.

    New guarded-via-typeof Bun call sites verified in 2.1.117 (all safe, no shim needed): Bun.gc, Bun.JSONL, Bun.stringWidth, Bun.which, Bun.embeddedFiles, Bun.hash, Bun.stripANSI, Bun.wrapAnsi, Bun.generateHeapSnapshot. The only ungarded Bun calls are still Bun.spawn / Bun.listen / Bun.Transpiler, all inside try/catch and never triggered in practice.

    Still believe the proper fix is upstream — a CLAUDE_CODE_FORCE_NODE_FALLBACK=1 env honored in install.cjs + cli-wrapper.cjs would kill the whole class of pre-AVX2 CPU regressions without bundling a second binary. But in the meantime: yes, current main works, and you get the Opus 4.7 context fix.

  8. github-actions commented on May 27, 2026

    @github-actions

    Closing for now — inactive for too long. Please open a new issue if this is still relevant.

  9. github-actions commented on Jul 24, 2026

    @github-actions

    This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

  10. locked as resolved and limited conversation to collaborators on Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions