Analyzers
Talk to fellow users of Intel Analyzer tools (Intel VTune™ Profiler, Intel Advisor)
5019 Discussions

VTune hotspots analysis fails for Python 3.11 when importing NumPY

nickw1
Beginner
439 Views

Operating System: Rocky Linux 8.7

VTune version: Intel(R) VTune(TM) Profiler 2024.0.0 (build 626834) Command Line Tool

 

I am trying to run a VTune analysis of a C++ application which uses the Boost python interface and it crashes importing the NumPY module:

+++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++ Signal Handler Invoked +++++++
+++++++ Signal : SIGSEGV +++++++
+++++++ Meaning: Invalid memory reference +++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++

+++ Stack Trace:
+++
+++ [0x7ffff650e926]
+++ [0x7ffff64fa42d]
+++ [0x7ffff650d60e]
+++ [0x7ffff650ee60]
+++ [0x7ffff6ced9d8]
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: _PyCode_Validate()+0x113
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: PyCode_NewWithPosOnlyArgs()+0x209
+++ [0x7ffff65b7db1]
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x2f5334
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x1ed826
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: PyObject_Call()+0x98
+++ /thirdparty/linux64/python/lib/python3.11/site-packages/numpy/random/mtrand.cpython-311-x86_64-linux-gnu.so: ()+0xd201
+++ /thirdparty/linux64/python/lib/python3.11/site-packages/numpy/random/mtrand.cpython-311-x86_64-linux-gnu.so: ()+0xe0df
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: PyModule_ExecDef()+0x6f
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x29d489
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x1f2ae1
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: _PyEval_EvalFrameDefault()+0x7e54
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: _PyFunction_Vectorcall()+0x191
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x1f3316
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: PyObject_CallMethodObjArgs()+0x102
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x125bfa
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: _PyEval_EvalFrameDefault()+0x58be
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x291f29
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: PyEval_EvalCode()+0x9a
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x2aa26e
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x1ed826
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: _PyEval_EvalFrameDefault()+0x7e54
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: _PyFunction_Vectorcall()+0x191
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x1f3316
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: PyObject_CallMethodObjArgs()+0x102
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x125bfa
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x23426b
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x1ed826
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: _PyEval_EvalFrameDefault()+0x7e54
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: _PyFunction_Vectorcall()+0x191
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x1f3316
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: PyObject_CallMethodObjArgs()+0x102
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x1267ba
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: _PyEval_EvalFrameDefault()+0x58be
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x291f29
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: PyEval_EvalCode()+0x9a
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x2aa26e
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x1ed826
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: _PyEval_EvalFrameDefault()+0x7e54
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: _PyFunction_Vectorcall()+0x191
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x1f3316
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: PyObject_CallMethodObjArgs()+0x102
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x125bfa
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x23426b
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x1ed826
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: _PyEval_EvalFrameDefault()+0x7e54
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: _PyFunction_Vectorcall()+0x191
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x1f3316
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: PyObject_CallMethodObjArgs()+0x102
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x1267ba
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: _PyEval_EvalFrameDefault()+0x58be
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x291f29
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: PyEval_EvalCode()+0x9a
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x2aa26e
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x1ed826
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: _PyEval_EvalFrameDefault()+0x7e54
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: _PyFunction_Vectorcall()+0x191
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x1f3316
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: PyObject_CallMethodObjArgs()+0x102
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x125bfa
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x23426b
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x1ed826
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: _PyEval_EvalFrameDefault()+0x7e54
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: _PyFunction_Vectorcall()+0x191
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x1f3316
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: PyObject_CallMethodObjArgs()+0x102
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x125bfa
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x23426b
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x1ed826
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: _PyEval_EvalFrameDefault()+0x7e54
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: _PyFunction_Vectorcall()+0x191
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x1f3316
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: PyObject_CallMethodObjArgs()+0x102
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x125bfa
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x23426b
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: ()+0x1ed826
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: PyObject_CallFunction()+0x12d
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: PyImport_Import()+0x190
+++ /thirdparty/linux64/python/lib/libpython3.11.so.1.0: PyImport_ImportModule()+0x18
+++ /thirdparty/linux64/lib/libboost_numpy311.so.1.84.0: boost::python::numpy::initialize(bool)+0x1c

 

It works for python 3.10 & 3.12 and only fails for Python 3.11. Unfortunately I cannot update the version of python used in the application due to depenency issues.

 

I tested with different versions of NumPY and they all failed.

 

I replicated a similar issue using Anaconda. Steps to reproduce:

mkdir -p ~/miniconda3
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
~/miniconda3/bin/conda init bash
source ~/.bashrc
conda activate
conda install -y python==3.11 numpy
echo 'import numpy;print("OK")' > numpy-test.py
python numpy-test.py # OK
vtune -collect hotspots python numpy-test.py # FAILS

 

 

 

 

0 Kudos
2 Replies
yuzhang3_intel
Moderator
397 Views

Thanks for reporting the issue.  Let us investigate and give an update then.

0 Kudos
clevels
Moderator
65 Views

Thank you for your patience. We were able to reproduce this issue and concluded this will need deeper investigation from the development team. I have provided them the reproducer will provide an update as soon as they review.


0 Kudos
Reply