Bug#966175: libopenblas0-pthread: segfault in scipy tests: calls Haswell
Drew Parsons
dparsons at debian.org
Fri Jul 24 11:28:41 BST 2020
Package: libopenblas0-pthread
Version: 0.3.10+ds-1
Severity: normal
Two (or at least 2) tests in scipy are segfaulting specifically with
libopenblas0-pthread. If I configure alternatives to set
libblas.so.3-x86_64-linux-gnu and liblapack.so.3-x86_64-linux-gnu to
generic reference blas then the tests pass.
The libblas.so segfault occurs with both scipy 1.4.1-2 (unstable) and
1.5.2-1 (experimental). The liblapack.so segfault occurs with scipy
1.5.2-1 but passes in 1.4.1-2
The segfaults can be reproduced manually (with python3-scipy installed
and blas/lapack configured to libopenblas0-pthread):
python3 -m pytest /usr/lib/python3/dist-packages/scipy/cluster/tests/test_vq.py -k "krandinit" -v
python3 -m pytest /usr/lib/python3/dist-packages/scipy/linalg/tests/test_decomp.py -v
(the second test here is the one that fails with scipy 1.5.2-1 in
test_orth_memory_efficiency, passes with 1.4.1-2. It also passes when
run on its own with -k "test_orth_memory_efficiency")
gdb backtraces show libopenblas0-pthread is inculpated:
$ gdb python3
> run -m pytest /usr/lib/python3/dist-packages/scipy/cluster/tests/test_vq.py -k "krandinit" -v
../../../../../../usr/lib/python3/dist-packages/scipy/cluster/tests/test_vq.py::TestKMean::test_krandinit
Thread 2 "python3" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff4b6a700 (LWP 1589273)]
0x00007ffff5c8d284 in dgemm_oncopy_HASWELL () from /lib/x86_64-linux-gnu/libblas.so.3
(gdb) bt
#0 0x00007ffff5c8d284 in dgemm_oncopy_HASWELL () from /lib/x86_64-linux-gnu/libblas.so.3
#1 0x00007ffff4d2a7c5 in ?? () from /lib/x86_64-linux-gnu/libblas.so.3
#2 0x00007ffff4e3098d in ?? () from /lib/x86_64-linux-gnu/libblas.so.3
#3 0x00007ffff7f62ea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
#4 0x00007ffff7cf7daf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
$ gdb python3
> run -m pytest /usr/lib/python3/dist-packages/scipy/linalg/tests/test_decomp.py -v
...
../../../../../../usr/lib/python3/dist-packages/scipy/linalg/tests/test_decomp.py::TestOverwrite::test_svd PASSED [ 92%]
../../../../../../usr/lib/python3/dist-packages/scipy/linalg/tests/test_decomp.py::TestOverwrite::test_svdvals PASSED [ 92%]
../../../../../../usr/lib/python3/dist-packages/scipy/linalg/tests/test_decomp.py::test_orth_memory_efficiency
Thread 9 "python3" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffe0e10700 (LWP 1589405)]
0x00007fffe27cc284 in dgemm_oncopy_HASWELL () from /lib/x86_64-linux-gnu/liblapack.so.3
(gdb) bt
#0 0x00007fffe27cc284 in dgemm_oncopy_HASWELL () from /lib/x86_64-linux-gnu/liblapack.so.3
#1 0x00007fffe18aeb62 in ?? () from /lib/x86_64-linux-gnu/liblapack.so.3
#2 0x00007fffe1943c4d in ?? () from /lib/x86_64-linux-gnu/liblapack.so.3
#3 0x00007ffff7f62ea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
#4 0x00007ffff7cf7daf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
In both cases the segfault happens at dgemm_oncopy_HASWELL. Probably
worth mentioned I'm not using a haswell system:
$ cat /proc/cpuinfo | grep 'model name' | uniq
model name : Intel(R) Core(TM) i5-8365U CPU @ 1.60GHz
So looks like the bug is that libopenblas0-pthread is invoking haswell
code on non-haswell systems. cpu.userbenchmark.com tells me that
i5-8365U is Whiskey Lake not Haswell
For completeness I tested other BLAS:
openblas-openmp: FAIL (calls dgemm_oncopy_HASWELL)
openblas-serial: PASS
blis-pthread: PASS
blis-openmp: PASS
atlas: PASS
-- System Information:
Debian Release: bullseye/sid
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 5.7.0-1-amd64 (SMP w/8 CPU threads)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8), LANGUAGE=en_AU:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages libopenblas0-pthread depends on:
ii libc6 2.31-2
ii libgfortran5 10.1.0-6
libopenblas0-pthread recommends no packages.
libopenblas0-pthread suggests no packages.
-- no debconf information
More information about the debian-science-maintainers
mailing list