Sharp/libvips crashes with SIGILL on CPUs without AVX support (AMD Phenom II)

Resolved 💬 3 comments Opened Dec 21, 2025 by kvicala888 Closed Feb 14, 2026

Preflight Checklist

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

What's Wrong?

Claude Code crashes with SIGILL (Illegal Instruction) when trying to read/process images on CPUs that don't support AVX instructions.

The bundled Sharp library (@img/sharp-libvips-linux-x64) contains libvips compiled with AVX/AVX2/AVX-512 instructions. When Claude Code attempts to read any image file (PNG, JPEG, etc.), the process immediately crashes because the CPU cannot execute these instructions.

Technical analysis: The bundled libvips-cpp.so.42 contains 37,250 AVX instructions (ymm registers) and AVX-512 instructions (zmm registers). AMD Phenom II and all pre-2011 CPUs don't have AVX support.

What Should Happen?

Claude Code should either:

  1. Detect CPU capabilities at runtime and use appropriate code paths (with/without AVX)
  2. Provide a fallback binary without AVX for older CPUs
  3. Show a helpful error message instead of crashing with SIGILL
  4. Document AVX as a system requirement in the installation docs

Error Messages/Logs

Nedovolená instrukce (SIGILL) (core dumped [obraz paměti uložen])

# GDB backtrace shows crash in g_hash_table_lookup during libvips initialization:
Thread 1 "node" received signal SIGILL, Illegal instruction.
0x00007ffff5a4a4e0 in g_hash_table_lookup () from /lib/x86_64-linux-gnu/libglib-2.0.so.0

# objdump analysis of bundled libvips:
$ objdump -d libvips-cpp.so.42 | grep -c "ymm"
37250  # AVX instructions using 256-bit registers

$ objdump -d libvips-cpp.so.42 | grep -c "zmm"  
211    # AVX-512 instructions using 512-bit registers

Steps to Reproduce

  1. Install Claude Code on a system with a CPU without AVX support (any pre-2011 Intel/AMD processor, e.g., AMD Phenom II X6 1090T)
  2. Run claude
  3. Ask Claude to read any image file, e.g.: "look at this screenshot" or use the Read tool on a PNG/JPEG file
  4. Result: Immediate crash with SIGILL (Illegal Instruction)

Note: The crash happens during Sharp/libvips library initialization, before any actual image processing occurs.

Claude Model

Opus

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.0.75 (Claude Code)

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

Environment Details

  • CPU: AMD Phenom II X6 1090T (6 cores @ 3.2GHz, released 2010)
  • CPU Flags: SSE, SSE2, SSE3, SSE4a - NO AVX support
  • OS: Ubuntu 24.04 (Linux 6.14.0-37-generic)
  • Node.js: v20.19.6
  • Terminal: zsh

Workaround Found

I successfully fixed this by:

  1. Compiling libvips 8.18.0 from source with AVX disabled:
meson setup build --buildtype=release \
  -Dc_args="-mno-avx -mno-avx2 -mno-avx512f" \
  -Dcpp_args="-mno-avx -mno-avx2 -mno-avx512f"
ninja -C build
sudo ninja -C build install
  1. Using LD_PRELOAD to override bundled libvips:
echo "/usr/local/lib/x86_64-linux-gnu/libvips-cpp.so.42
/usr/local/lib/x86_64-linux-gnu/libvips.so.42" | sudo tee /etc/ld.so.preload

After this fix, Claude Code can read images without crashing.

Affected Hardware

Any CPU released before 2011 that lacks AVX support:

  • Intel: All Core 2, Nehalem, Westmere (i7-9xx, i5-7xx, etc.)
  • AMD: All Phenom, Phenom II, Athlon II, early FX series

Suggested Implementation

The Sharp/libvips bundled binaries could use runtime CPU detection (like glibc's IFUNC) to select appropriate code paths, or provide separate binaries for different CPU capabilities.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗