Core Dump Occurs When TensorOperations APIs Are Called in x86_64, and the Stack Information Indicates libffi.so Error
Symptom
A core dump occurs when TensorOperations APIs are called on a device using the x86_64 architecture. However, the stack information indicates that the last execution is in libffi.so.
Cause Analysis
libstreammanager.so is linked in the user program, and libffi of a later version in the software package is preferentially loaded during running. Some TensorOperations APIs call the CAPI of Python during execution. However, Python installation in the environment comes with the libffi of an earlier version. This version conflicts with a different libffi version on an x86_64-based device, causing a core dump.
Solution
- Check the Python version used in the current environment and run the following command in the lib directory.
find /path/to/python -name "_ctypes.cpython*so"
- Run the ldd command to check the path of libffi.so that the found SO file depends on.
ldd /path/to/_ctypes.cpython*so
- Run the following command to load the libffi dynamic library that Python depends on.
export LD_PRELOAD=/path/to/libffi.so
Parent topic: Dependency Conflict-related FAQs