Skip to content

BUG: on OpenBSD/i386 numpy segfaults while running tests (1.20rc1 to 1.22.0 crash / 1.19.5 is the last known working version) #20799

Open
@didickman

Description

@didickman

Describe the issue:

Starting with numpy 1.20rc1 and also happening in every release through 1.22.0, the tests cause a segfault on OpenBSD/i386. I've tested this with both python 3.8 and python 3.9. numpy 1.19.5 appears to allow the test suite to run.

The backtrace from gdb shows "solve_diophantine" may be where it's crashing?

In case helpful to know, on OpenBSD, netlib Blas is used.

Reproduce the code example:

$ egdb python3
GNU gdb (GDB) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "i386-unknown-openbsd7.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from python3...
(No debugging symbols found in python3)
(gdb) run
Starting program: /usr/local/bin/python3
Python 3.8.12 (default, Jan 11 2022, 03:22:43)
[Clang 13.0.0 ] on openbsd7
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> numpy.test(verbose=2)
NumPy version 1.20.0rc1
NumPy relaxed strides checking option: True
NumPy CPU features: SSE SSE2 SSE3* SSSE3* SSE41* POPCNT* SSE42* AVX? F16C* FMA3? AVX2? AVX512F? AVX512CD? AVX512_KNL? AVX512_KNM? AVX512_SKX? AVX512_CLX? AVX512_CNL? AVX512_ICL?
===================================================================================================== test session starts ======================================================================================================
platform openbsd7 -- Python 3.8.12, pytest-6.2.5, py-1.8.2, pluggy-1.0.0
rootdir: /home/didickman/numpy, configfile: pytest.ini
plugins: hypothesis-6.35.0
collecting 11938 items / 4 errors / 11934 selected
Program received signal SIGSEGV, Segmentation fault.
0x0aba548b in solve_diophantine () from /usr/local/lib/python3.8/site-packages/numpy/core/_multiarray_umath.cpython-38.so
(gdb) bt
#0  0x0aba548b in solve_diophantine () from /usr/local/lib/python3.8/site-packages/numpy/core/_multiarray_umath.cpython-38.so
#1  0x0aba681b in solve_may_share_memory () from /usr/local/lib/python3.8/site-packages/numpy/core/_multiarray_umath.cpython-38.so
#2  0x0ab7c8bf in PyUFunc_GenericFunction_int () from /usr/local/lib/python3.8/site-packages/numpy/core/_multiarray_umath.cpython-38.so
#3  0x0ab7d001 in ufunc_generic_call () from /usr/local/lib/python3.8/site-packages/numpy/core/_multiarray_umath.cpython-38.so
#4  0x08c40e6f in _PyObject_MakeTpCall () from /usr/local/lib/libpython3.8.so.0.0
#5  0x08c42e04 in object_vacall () from /usr/local/lib/libpython3.8.so.0.0
#6  0x08c42f71 in PyObject_CallFunctionObjArgs () from /usr/local/lib/libpython3.8.so.0.0
#7  0x0aa02e31 in PyArray_GenericInplaceBinaryFunction () from /usr/local/lib/python3.8/site-packages/numpy/core/_multiarray_umath.cpython-38.so
#8  0x08c2a072 in PyNumber_InPlaceMultiply () from /usr/local/lib/libpython3.8.so.0.0
#9  0x08cffd87 in _PyEval_EvalFrameDefault () from /usr/local/lib/libpython3.8.so.0.0
#10 0x08d0875e in _PyEval_EvalCodeWithName () from /usr/local/lib/libpython3.8.so.0.0
#11 0x08c4193a in _PyFunction_Vectorcall () from /usr/local/lib/libpython3.8.so.0.0
#12 0x08c411be in PyVectorcall_Call () from /usr/local/lib/libpython3.8.so.0.0
#13 0x08c412ac in PyObject_Call () from /usr/local/lib/libpython3.8.so.0.0
#14 0x0a93935c in array_implement_array_function () from /usr/local/lib/python3.8/site-packages/numpy/core/_multiarray_umath.cpython-38.so
#15 0x08c41481 in cfunction_call_varargs () from /usr/local/lib/libpython3.8.so.0.0
#16 0x08c41f8a in PyCFunction_Call () from /usr/local/lib/libpython3.8.so.0.0
#17 0x08c40e6f in _PyObject_MakeTpCall () from /usr/local/lib/libpython3.8.so.0.0
#18 0x08d07b86 in call_function () from /usr/local/lib/libpython3.8.so.0.0
#19 0x08d04965 in _PyEval_EvalFrameDefault () from /usr/local/lib/libpython3.8.so.0.0
#20 0x08d0875e in _PyEval_EvalCodeWithName () from /usr/local/lib/libpython3.8.so.0.0
#21 0x08c4193a in _PyFunction_Vectorcall () from /usr/local/lib/libpython3.8.so.0.0
#22 0x08d07b44 in call_function () from /usr/local/lib/libpython3.8.so.0.0
<snipped by @seberg>

Error message:

Program received signal SIGSEGV, Segmentation fault.

NumPy/Python version information:

1.20.0rc1 3.8.12 (default, Jan 11 2022, 03:22:43)
[Clang 13.0.0 ]

Metadata

Metadata

Assignees

Labels

00 - Bugcomponent: SIMDIssues in SIMD (fast instruction sets) code or machinery

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions