Skip to content

"Illegal instruction" coredump running a Fedora VM on macOS #6011

Description

@billti

I logged this issue at scipy/scipy#26098 and it was suggested to open an issue here.

Copying details below, but basically looks like the Linux aarch64 build doesn't handle running on Apple Silicon where the SVE instructions may not be available. (Not sure if this would apply to builds like Windows also which may run inside a VM on Apple CPUs).

Copied details

I'm using Parallels (v27.0.1) to run an aarch64 Fedora VM (Fedora 44 - uname -r reports "7.1.13-200.fc44.aarch64") on macOS. On loading scipy (version 1.18.1) I hit

Program terminated with signal SIGILL, Illegal instruction.
#0  0x0000ffff79c5d908 in init_parameter ()
   from /home/billti/demo/.venv/lib64/python3.14/site-packages/scipy/linalg/../../scipy.libs/libscipy_openblas-b7e2810b.so
[Current thread is 1 (Thread 0xffffa82af020 (LWP 15454))]

(gdb) x/i $pc
=> 0xffff79c5d908 <init_parameter+12>:	index	z2.s, #0, w8

Some back and forth with ChatGPT resulted in a brief description of:

On AArch64 Linux with HWCAP_SME present and HWCAP_SVE absent, SciPy’s bundled OpenBLAS 0.3.31.dev DYNAMIC_ARCH build selects Core: armv9sme. ARMV9SME is documented as requiring SVE+SME. Initialization executes index z2.s, #0, w8, an SVE instruction, causing SIGILL.

I would now separate responsibility this way:

  • Fedora/Linux: looks correct. It exposes SME and no SVE.
  • Parallels: may still influence CPU identification, but nothing you’ve shown so far proves it is advertising an invalid userspace capability.
  • SciPy’s OpenBLAS wheel: does not include VORTEXM4.
  • OpenBLAS runtime dispatch: appears to choose ARMV9SME despite SVE being absent, even though OpenBLAS itself defines that target as requiring SVE+SME. That is the clearest proximate bug.

Setting OPENBLAS_CORETYPE=ARMV8 avoids the crash, so it does appear to be a CPU features selection issue.

Running lscpu reports the Flags as below, which appears correct for Apple Silcon.

Flags:                   fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma 
                             lrcpc dcpop sha3 asimddp sha512 asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp flagm2
                              frint bf16 bti afp sme smei16i64 smef64f64 smei8i32 smef16f32 smeb16f32 smef32f32 ebf16 s
                             me2 sme2p1 smei16i32 smebi32i32 smeb16b16 smef16f16

Reproducing Code Example

$ OPENBLAS_VERBOSE=2 python -c 'import scipy.linalg'

Error message

Falling back to generic ARMV8 core
Core: armv8
Core: armv9sme
Illegal instruction        (core dumped) OPENBLAS_VERBOSE=2 python -c 'import scipy.linalg'

SciPy/NumPy/Python version and system information

>>> import sys, scipy, numpy; print(scipy.__version__, numpy.__version__, sys.version_info); scipy.show_config()
1.18.1 2.3.5 sys.version_info(major=3, minor=14, micro=7, releaselevel='final', serial=0)
/home/billti/demo/.venv/lib64/python3.14/site-packages/scipy/__config__.py:167: UserWarning: Install `pyyaml` for better output
  warnings.warn("Install `pyyaml` for better output", stacklevel=1)
{
  "Compilers": {
    "c": {
      "name": "gcc",
      "linker": "ld.bfd",
      "version": "14.2.1",
      "commands": "cc"
    },
    "cython": {
      "name": "cython",
      "linker": "cython",
      "version": "3.2.9",
      "commands": "cython"
    },
    "c++": {
      "name": "gcc",
      "linker": "ld.bfd",
      "version": "14.2.1",
      "commands": "c++"
    },
    "fortran": {
      "name": "gcc",
      "linker": "ld.bfd",
      "version": "14.2.1",
      "commands": "gfortran"
    },
    "pythran": {
      "version": "0.19.0",
      "include directory": "../../../tmp/build-env-tnd5ov1o/lib/python3.14/site-packages/pythran"
    }
  },
  "Machine Information": {
    "host": {
      "cpu": "aarch64",
      "family": "aarch64",
      "endian": "little",
      "system": "linux"
    },
    "build": {
      "cpu": "aarch64",
      "family": "aarch64",
      "endian": "little",
      "system": "linux"
    },
    "cross-compiled": false
  },
  "Build Dependencies": {
    "blas": {
      "name": "scipy-openblas",
      "found": true,
      "version": "0.3.31.dev",
      "detection method": "pkgconfig",
      "include directory": "/opt/_internal/cpython-3.14.6/lib/python3.14/site-packages/scipy_openblas32/include",
      "lib directory": "/opt/_internal/cpython-3.14.6/lib/python3.14/site-packages/scipy_openblas32/lib",
      "openblas configuration": "OpenBLAS 0.3.31.dev DYNAMIC_ARCH NO_AFFINITY neoversev2 MAX_THREADS=64",
      "pc file directory": "/project/.openblas",
      "has ilp64": false,
      "cython blas ilp64": false
    },
    "lapack": {
      "name": "scipy-openblas",
      "found": true,
      "version": "0.3.31.dev",
      "detection method": "pkgconfig",
      "include directory": "/opt/_internal/cpython-3.14.6/lib/python3.14/site-packages/scipy_openblas32/include",
      "lib directory": "/opt/_internal/cpython-3.14.6/lib/python3.14/site-packages/scipy_openblas32/lib",
      "openblas configuration": "OpenBLAS 0.3.31.dev DYNAMIC_ARCH NO_AFFINITY neoversev2 MAX_THREADS=64",
      "pc file directory": "/project/.openblas",
      "has ilp64": false
    },
    "pybind11": {
      "name": "pybind11",
      "version": "3.0.4",
      "detection method": "config-tool",
      "include directory": "unknown"
    }
  },
  "Python Information": {
    "path": "/tmp/build-env-tnd5ov1o/bin/python",
    "version": "3.14"
  }
}

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions