#1142428 _multiarray_umath.cpython-314-x86_64-linux-gnu.so requires SSE4.1 (pinsrq) on amd64

Package:
python3-numpy
Source:
python3-numpy
Description:
Fast array facility to the Python 3 language
Submitter:
Jakob Haufe
Date:
2026-07-23 19:07:02 UTC
Severity:
normal
#1142428#5
Date:
2026-07-19 19:38:44 UTC
From:
To:
Found while trying to run binwalk on an AMD Athlon II X4 605e.

Reproducer
==========

$ python3.14 -c 'import numpy'
Illegal instruction        (core dumped) python3.14 -c 'import numpy'

$ python3.13 -c 'import numpy'
Illegal instruction        (core dumped) python3.13 -c 'import numpy'


dmesg
=====

[184905.408241] traps: python3.14[460732] trap invalid opcode ip:7f5053e2cf7f sp:7ffd9be970f0 error:0 in _multiarray_umath.cpython-314-x86_64-linux-gnu.so[2cf7f,7f5053e2a000+6f5000]
[184974.953226] traps: python3.13[460776] trap invalid opcode ip:7f8d88c2cf3f sp:7ffe523dd890 error:0 in _multiarray_umath.cpython-313-x86_64-linux-gnu.so[2cf3f,7f8d88c2a000+6f5000]


gdb for 3.14
============

#0  0x00007f5053e2cf7f in __static_initialization_and_destruction_0 () at ../../../numpy/_core/src/multiarray/unique.cpp:527

⚠️ warning: 527	../../../numpy/_core/src/multiarray/unique.cpp: No such file or directory
[Current thread is 1 (Thread 0x7f5054edf200 (LWP 460732))]
(gdb) disassemble
Dump of assembler code for function __static_initialization_and_destruction_0():
Address range 0x7f5053e2cf20 to 0x7f5053e2d66f:
[...]
=> 0x00007f5053e2cf7f <+95>:	pinsrq $0x1,0x878eee(%rip),%xmm0        # 0x7f50546a5e78


gdb for 3.13
============

#0  0x00007f8d88c2cf3f in __static_initialization_and_destruction_0 () at ../../../numpy/_core/src/multiarray/unique.cpp:527

⚠️ warning: 527	../../../numpy/_core/src/multiarray/unique.cpp: No such file or directory
[Current thread is 1 (Thread 0x7f8d89cce200 (LWP 460776))]
(gdb) disassemble
Dump of assembler code for function __static_initialization_and_destruction_0():
Address range 0x7f8d88c2cee0 to 0x7f8d88c2d62f:
[...]
=> 0x00007f8d88c2cf3f <+95>:	pinsrq $0x1,0x878f2e(%rip),%xmm0        # 0x7f8d894a5e78



lspcu
=====

Architecture:                x86_64
  CPU op-mode(s):            32-bit, 64-bit
  Address sizes:             48 bits physical, 48 bits virtual
  Byte Order:                Little Endian
CPU(s):                      4
  On-line CPU(s) list:       0-3
Vendor ID:                   AuthenticAMD
  Model name:                AMD Athlon(tm) II X4 605e Processor
    CPU family:              16
    Model:                   5
    Thread(s) per core:      1
    Core(s) per socket:      4
    Socket(s):               1
    Stepping:                2
    Microcode version:       0x10000db
    CPU(s) scaling MHz:      35%
    CPU max MHz:             2300,0000
    CPU min MHz:             800,0000
    BogoMIPS:                4620,56
    Flags:                   fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid pni monitor cx16 popcnt la
                             hf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt hw_pstate vmmcall npt lbrv svm_lock nrip_save
Virtualization features:
  Virtualization:            AMD-V
Caches (sum of all):
  L1d:                       256 KiB (4 instances)
  L1i:                       256 KiB (4 instances)
  L2:                        2 MiB (4 instances)
NUMA:
  NUMA node(s):              1
  NUMA node0 CPU(s):         0-3
Vulnerabilities:
  Gather data sampling:      Not affected
  Ghostwrite:                Not affected
  Indirect target selection: Not affected
  Itlb multihit:             Not affected
  L1tf:                      Not affected
  Mds:                       Not affected
  Meltdown:                  Not affected
  Mmio stale data:           Not affected
  Old microcode:             Not affected
  Reg file data sampling:    Not affected
  Retbleed:                  Not affected
  Spec rstack overflow:      Not affected
  Spec store bypass:         Not affected
  Spectre v1:                Mitigation; usercopy/swapgs barriers and __user pointer sanitization
  Spectre v2:                Mitigation; Retpolines; STIBP disabled; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected
  Srbds:                     Not affected
  Tsa:                       Not affected
  Tsx async abort:           Not affected
  Vmscape:                   Not affected

#1142428#10
Date:
2026-07-20 23:43:03 UTC
From:
To:
[snip]

pinsrq is an SSE4.1 instruction.  Debian amd64 is not supposed to require
those, so probably numpy needs to be told explicitly at compile time to
stick with SSE2.

#1142428#15
Date:
2026-07-20 23:43:03 UTC
From:
To:
[snip]

pinsrq is an SSE4.1 instruction.  Debian amd64 is not supposed to require
those, so probably numpy needs to be told explicitly at compile time to
stick with SSE2.

#1142428#20
Date:
2026-07-20 23:57:43 UTC
From:
To:
Building numpy on my machine I see:
#1142428#25
Date:
2026-07-20 23:57:43 UTC
From:
To:
Building numpy on my machine I see:
#1142428#30
Date:
2026-07-22 03:47:37 UTC
From:
To:
Control: severity -1 serious

This is a baseline violation for Debian purposes. Either numpy needs
to build without the new instructions, or it needs to add runtime
CPU feature detection.

Best,
Chris

#1142428#37
Date:
2026-07-22 08:45:37 UTC
From:
To:
Configuring npy_cpu_dispatch_config.h using configuration
Message:
CPU Optimization Options
  baseline:
    Requested : min
    Enabled   : X86_V2
  dispatch:
    Requested : max
    Enabled   : X86_V3 X86_V4 AVX512_ICL AVX512_SPR


So AIUI, it intends to do exactly that, but somehow fails.

Cheers,
sur5r

#1142428#40
Date:
2026-07-23 11:18:54 UTC
From:
To:
Hello,

Bug #1142428 in numpy reported by you has been fixed in the
Git repository and is awaiting an upload. You can see the commit
message below and you can check the diff of the fix at:

https://salsa.debian.org/python-team/packages/numpy/-/commit/60b5811359dd5e59eb187dd0705fedde493d45bd
------------------------------------------------------------------------
Make x86 CPU baseline policy compliant

Closes: #1142428
------------------------------------------------------------------------

(this message was generated automatically)
-- 
Greetings

https://bugs.debian.org/1142428

#1142428#47
Date:
2026-07-23 11:34:22 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
numpy, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1142428@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Timo Röhling <roehling@debian.org> (supplier of updated numpy package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Thu, 23 Jul 2026 12:19:41 +0200
Source: numpy
Architecture: source
Version: 1:2.4.6+ds-3
Distribution: unstable
Urgency: medium
Maintainer: Debian Python Team <team+python@tracker.debian.org>
Changed-By: Timo Röhling <roehling@debian.org>
Closes: 1142428
Changes:
 numpy (1:2.4.6+ds-3) unstable; urgency=medium
 .
   * Make x86 CPU baseline policy compliant (Closes: #1142428)
Checksums-Sha1:
 b7de5676fd5374896a523ce3f08abc398baa07b0 3634 numpy_2.4.6+ds-3.dsc
 d4d37df3182629dc6ec2c38f89fa4370951afa34 167304 numpy_2.4.6+ds-3.debian.tar.xz
Checksums-Sha256:
 10f419e63c565398f8aa2800f60f78b58710f3f4633d06fcc76d4a1628285a96 3634 numpy_2.4.6+ds-3.dsc
 220f43ffc9b40f54fd150a2a21acf7f98b3dc9c07dfa2f6a0cc90def1f6a18e0 167304 numpy_2.4.6+ds-3.debian.tar.xz
Files:
 ce9813e5aee142f1d0ddaffad9d5d413 3634 python optional numpy_2.4.6+ds-3.dsc
 ca7aef63d205c2e7a305d4f3799b51ac 167304 python optional numpy_2.4.6+ds-3.debian.tar.xz
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEmwPruYMA35fCsSO/zIxr3RQD9MoFAmph+IwACgkQzIxr3RQD
9MpKTxAAmY1MtXgzs0wx51N1Acnauhyx8ITrvGfw77yQwO5MjTgBcHHwXghgJESE
QPp825jRjuKhBBQ+XMmYu1/aQZFY4u8aKK0jh2RLwwrb6A+g3DvidopU1+WVPC3V
xj5IdiBKGIeHoM0UaM50bc9DlkfDzbykBuLswg1OfFfL7hmIeSw1YCLtNVi6H450
rRyaVwWMoxUnbG4LSkAxWVar23E1/PLPPLA7nCb0BKaNXCzHbSzqNDQHBeQmI127
pKsjuwOIdXhY7qafDYdQ3xBuZcEIgeFHUKihLhqPsreYt4VvOldSZ7/EczFh+s1y
k4w4jJ/vIo/FUu+q9UiKVRPJ05ojvbxcmYseHfXZrfWBF3SkiXw3nyFIT/Z0gQ62
RW2iY+dfSzeux8icHKsh+au2UNk+GQhn47KAslOjWAbAM+JlbqCyL0ljuFH1ALr9
p0w5/0RGJsvT2oN7kMWZJ4kCZ1DPgcoNB30uaiT1MiVLwAlLx12dxX36hRSPkq64
zXKyTOsiTicrm8z/9subcYnJ4ixbB4mNQrFjpkoATiGHaVvPAyBs+y562JxTZcW0
w6OlRa67g4RMDJfcGH78ppyVEH9VszflasjAcAdNOzVue3kgQi6GLOAK5YSljuJs
IblG1azN2sMxO2lpr2Z9VETTmVeWIChk3GJla+7xSpBVxPNceaQ=
=e75c
-----END PGP SIGNATURE-----

#1142428#52
Date:
2026-07-23 13:44:09 UTC
From:
To:
* Jakob Haufe <sur5r@debian.org> [260722 05:47]:
while it might support _V3 and _V4, the baseline is just wrong for
Debian's amd64.

Chris

#1142428#57
Date:
2026-07-23 18:30:30 UTC
From:
To:
min defaults to X86_V2 as of version 2.4.0, you have to change min to
none to get X86_V1 support as the baseline.  It will still use AVX and
such if available by runtime detection.

I couldn't figure out how to pass -Dcpu-baseline=none in debian/rules
(I have no idea how pybuild works), but editing the file that sets the
value to min and putting none appears to correctly build something that
should work on V1 systems.

#1142428#62
Date:
2026-07-23 18:31:20 UTC
From:
To:
It does have runtime detection, but the default minimum needs to be
reduced back to V1.