Skip to content

Matrix multiply with blis+numpy from conda-forge crashes #937

Description

@cbu-hw

In a Python codebase, I encountered mysterious crashes deep within matplotlib when I switch my BLAS to blis, and traced them back to a suspiciously simple numpy.dot multiplication of two identity matrices crashing the interpreter. MWE using Python via miniforge on

  • Windows 11 with Powershell (edited - I mistakenly wrote "10" before)
  • Python 3.13
  • blis 2.0
  • numpy 2.5.1
> conda create -n blis-bug python=3.13 "libblas=*=*_blis" numpy
Channels:
 - conda-forge
Platform: win-64
Collecting package metadata (repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: C:\Users\myuser\AppData\Local\miniforge3\envs\blis-bug

  added / updated specs:
    - libblas[build=*_blis]
    - numpy
    - python=3.13


The following NEW packages will be INSTALLED:

  blis               conda-forge/win-64::blis-2.0-pthreads_h02eceb6_4
  bzip2              conda-forge/win-64::bzip2-1.0.8-h0ad9c76_9
  ca-certificates    conda-forge/noarch::ca-certificates-2026.6.17-h4c7d964_0
  libblas            conda-forge/win-64::libblas-3.11.0-8_h281ba03_blis
  libcblas           conda-forge/win-64::libcblas-3.11.0-8_h8e9ec6c_blis
  libexpat           conda-forge/win-64::libexpat-2.8.1-hac47afa_1
  libffi             conda-forge/win-64::libffi-3.5.2-h3d046cb_0
  liblapack          conda-forge/win-64::liblapack-3.11.0-8_h018ca30_netlib
  liblzma            conda-forge/win-64::liblzma-5.8.3-hfd05255_0
  libmpdec           conda-forge/win-64::libmpdec-4.0.0-hfd05255_1
  libsqlite          conda-forge/win-64::libsqlite-3.53.3-hf5d6505_0
  libzlib            conda-forge/win-64::libzlib-1.3.2-hfd05255_2
  numpy              conda-forge/win-64::numpy-2.5.1-py313ha8dc839_0
  openssl            conda-forge/win-64::openssl-3.6.3-hf411b9b_0
  pip                conda-forge/noarch::pip-26.1.2-pyh145f28c_0
  python             conda-forge/win-64::python-3.13.14-h09917c8_100_cp313
  python_abi         conda-forge/noarch::python_abi-3.13-8_cp313
  tk                 conda-forge/win-64::tk-8.6.13-h6ed50ae_3
  tzdata             conda-forge/noarch::tzdata-2025c-hc9c84f9_1
  ucrt               conda-forge/win-64::ucrt-10.0.26100.0-h57928b3_0
  vc                 conda-forge/win-64::vc-14.5-h1b7c187_39
  vc14_runtime       conda-forge/win-64::vc14_runtime-14.51.36231-h1b9f54f_39
  vcomp14            conda-forge/win-64::vcomp14-14.51.36231-h1b9f54f_39


Proceed ([y]/n)?


Downloading and Extracting Packages:

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate blis-bug
#
# To deactivate an active environment, use
#
#     $ conda deactivate

WARNING conda.conda_pypi.main:notify_externally_managed_future(209):
  This environment has pip installed. A future conda release will
  protect conda environments from accidental 'pip install' usage.
  Try the beta to install PyPI packages natively with conda:
    conda config --set solver rattler
    conda config --append channels conda-pypi
    conda install <package>
  More info: https://docs.conda.io/projects/conda/en/stable/new-features.html
  
> conda activate blis-bug
> python -c "import numpy as np;A = np.array([[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]]);B = np.array([[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]]);print(np.dot(A, B))"
> $LastExitCode
-1073741819
> python -c "import numpy as np; np._pytesttester._show_numpy_info()"
NumPy version 2.5.1
NumPy CPU features:  X86_V2 X86_V3*

Expected result observed with openblas:

> conda install "libblas=*=*_openblas"
...
    package                    |            build
    ---------------------------|-----------------
    libblas-3.11.0             |8_h0adab6e_openblas          66 KB  conda-forge
    libcblas-3.11.0            |8_h2a8eebe_openblas          67 KB  conda-forge
    liblapack-3.11.0           |8_hd232482_openblas          79 KB  conda-forge
    libopenblas-0.3.33         |pthreads_h877e47f_0         3.9 MB  conda-forge
    ------------------------------------------------------------
                                           Total:         4.1 MB

The following NEW packages will be INSTALLED:

  libopenblas        conda-forge/win-64::libopenblas-0.3.33-pthreads_h877e47f_0

The following packages will be REMOVED:

  blis-2.0-pthreads_h02eceb6_4

The following packages will be REVISED:

  libblas                            3.11.0-8_h281ba03_blis --> 3.11.0-8_h0adab6e_openblas
  libcblas                           3.11.0-8_h8e9ec6c_blis --> 3.11.0-8_h2a8eebe_openblas
  liblapack                        3.11.0-8_h018ca30_netlib --> 3.11.0-8_hd232482_openblas
...
> python -c "import numpy as np;A = np.array([[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]]);B = np.array([[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]]);print(np.dot(A, B))"
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

This is on a laptop with an Intel(R) Core(TM) Ultra 7 265U (2.10 GHz). I already did a memcheck and processor check to confirm that the hardware is ok.

Do you need any more information to analyze?
Can anybody reproduce? I feel kinda silly, as I would not expect such a simple repro to have slipped through testing cracks...hence the hardware check 😅

As this touches conda-forge, I hope it's ok to ping @h-vetinari as an FYI, too.

I'm seeing the same crash on Python 3.14 (3.13 was just closest to my original setup).

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