How can I resolve a segmentation fault caused by a MATLB Engine API tbb.dll version mismatch?
10 views (last 30 days)
Show older comments
MathWorks Support Team
on 25 May 2023
Edited: MathWorks Support Team
on 9 Jan 2024
I am developing a C++ application, which connects and interfaces with MATLAB via the C++ Engine API. When calling "findMATLAB()" in the C++ code, a segmentation fault occurs.
Thread 1 received signal SIGSEGV, Segmentation fault.0x0000000000000000 in ?? ()(gdb)
I suspect that this may be due to a mismatch between my compiled version of "tbb.dll" and the MATLAB version. Can this be the cause of the crash?
Accepted Answer
MathWorks Support Team
on 13 Sep 2024
Edited: MathWorks Support Team
on 9 Jan 2024
The "tbb.dll" library is a threading library developed by Intel and shipped with MATLAB. A mismatch between the version of the "tbb.dll" library in your application and the one shipped with MATLAB could cause a segmentation fault.
When developing C++ applications that interface with MATLAB Engine and require functions from this library, it is recommended to use the version of "tbb.dll" that ships with MATLAB to avoid this library conflict.
To invoke the MATLAB version of "tbb.dll" during runtime, you will need to hide other versions of "tbb.dll", so only the MATLAB version is visible to the C++ application. Since the header files of "tbb.dll" are not shipped with MATLAB, you will need to get the corresponding header files from Intel for compilation. Be sure to download the relevant header files from Intel that correspond to the MATLAB version of "tbb.dll". Version information for "tbb.dll" can be found by the following command in Windows PowerShell:
get-command "<full path to tbb.dll>" | format-list
0 Comments
More Answers (0)
See Also
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!