I'm experiencing a crash on exit after calling one of MKL VML functions (declared in mkl_vml_functions.h). I'm running on OS X.
The following flow leads to the crash:
Few more details:
I saw another report in this forum about similar crash under Linux (https://software.intel.com/en-us/node/629264), that was fixed in version 2016.2.
My guess is that my problem is also related to thread clean up.
Am I doing something wrong? or is it related to some MKL thread cleaning issue?
Please advise and let me know if I can supply further details.
Thanks a lot,
I built a custom dynamically linked shared MKL library, since I need to use only some MKL functions in my code.
Customized library is built with the following command:
libuni threading=sequential export=<function list file> name=libmkl_custom
dylib2 loads libmkl_custom.dylib on load-time. This is done through linking dylib2 with the following commands:
-L<libmkl_custom.dylib path> -Wl,-rpath,<libmkl_custom.dylib path> -lmkl_custom
Thanks for your response.
I’ve managed to create a smaller reproducer to this issue. Code is attached to this post.
I created a customized MKL dylib with the following command:
make libuni threading=sequential export=mkl_function_list name=libmkl_custom
(this command is taken from MKL Mac OS X user guide: https://registrationcenter.intel.com/irc_nas/2690/mkl_userguide_mac.pdf).
The attached XCode project is compiled to an application, and to a dylib (let's call it dylib1). dylib1 is linked to
the customized MKL dylib.
This is the application workflow:
1. Application opens a thread, and then calls 'pthread_join()' for this thread.
2. Thread dynamically loads dylib1 (with ‘dlopen()’), and calls its 'TestFunc()' function.
3. 'TestFunc()' function calls a vml function ('vsAdd()').
4. 'TestFunc()' returns, and 'dlclose()' is called for dylib1.
5. Thread returns, and application crashes in 'pthread_join()'.
Please note that removing the call to 'vsAdd()', eliminates the crash.
Moreover, not calling ‘dlclose()’ also eliminates the crash.
Bug was reproduced on OS 10.12.6, with MKL version 2018.0.1. Both executable and dylib were compiled with LLVM 9.0.
Please see readme.txt in attached zip for more details.
Thanks for the support,