Crash calling numpys import_array() in C++-Api when python runs in separate thread->might relate on way python loads hashlib (openssl) library #96650
Labels
3.9
only security fixes
OS-mac
type-crash
A hard crash of the interpreter, possibly with a core dump
Crash report
I get an EXC_BAD_ACCESS Error when calling import_array() in an c++ program if Python runs in an different thread.
In detail I have written a module that uses Numpy. If I initialize Python in my main thread and import my module everything works fine. But if I initialize Python in an different thread and import the module in this thread, numpy crashes when calling import_array(). More precise the crash happens wenn PyImport_ImportModule("numpy.core._multiarray_umath") is called in _import_array() (_multiarray_api.h).
I'm using macOS Monterey 12.5.1 on an Apple Silicon (M1) processor. My Python version is 3.9.6 and the NumPy I'm using is 1.23.2. Python and Numpy are for ARM architecture. As compiler I'm using Clang 13.0.0. The issue can also be reproduced on Mac intel machines.
On Windows no problem occurs.
I posted this issue allready under numpy/numpy#21588. One user said that the error is probably caused by the way python loads the hashlib library, so it's more python than numpy. Therefore I post the error here now again
Error messages
Your environment
macOS Monterey 12.5.1 on an Apple Silicon (M1) processor
Python 3.9.6
NumPy 1.23.2.
The text was updated successfully, but these errors were encountered: