Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
6977 Discussions

BUG: mkl_serv_print() calls kernel32!SetDllDirectoryA for no good reason

michaelkonecny
New Contributor I
799 Views

When pardiso is run with msglvl = 1, for some reason it calls SetDllDirectoryA() from kernel32 and this changes the way DLLs are loaded for the rest of the process execution.

This caused a failing unit test in our company, which took me no less than two and a half weeks time to find the cause of.

call_stack.png

I created a public repo here: https://bitbucket.org/konecnymichael/pardiso-setdlldirectory-bug which can be used to reproduce this strange behaviour.

This can be done by simply setting a breakpoint to kernel32!SetDllDirectoryA and running the program in the pardiso-setdlldirectory-bug project.

 

In a different project, I was able to find out SetDllDirectory was being called from MKL's mkl_serv_print() function.

 

This happens on both oneAPI toolkit versions 2021.3.0 and 2021.4.0 (currently latest).

This behaviour is very annoying because:

  • it is unexpected
  • it started happening after an update from Intel 19.0
  • it broke delay loading of a library which was called later in a program, which took me two weeks to debug
  • it seems unnecessary

I consider this to be a bug as this call doesn't seem to have been present in the previous versions of MKL and doesn't seem necessary.

I would appreciate if Intel could do either of:

  • remove the SetDllDirectory call
  • at least reset the DLL loading mode to previous settings as not to mess up the behaviour of the process which calls it

Can someone from Intel please have a look at this and get back to me?
It would be great if other people didn't have to go through the two-week debugging frenzy that I did.

P.S.: Your editor in this forum is broken. I don't seem to be able to add more than one image. Please refer to the git repo's readme for a complete description of the problem including pictures.

Labels (1)
0 Kudos
1 Solution
Ruqiu_C_Intel
Moderator
552 Views

Thank you for reaching us. This issue will be available in oneMKL 2022.2. Let's closing this thread now. If you require additional assistance from Intel, please start a new thread. Any further interaction in this thread will be considered community only. 


View solution in original post

0 Kudos
2 Replies
ShanmukhS_Intel
Moderator
747 Views

Hi,


Thanks for reaching out to us.


We are able to reproduce this issue at our end. We are working on this issue internally. We will get back to you soon.


Best Regards,

Shanmukh.SS


0 Kudos
Ruqiu_C_Intel
Moderator
553 Views

Thank you for reaching us. This issue will be available in oneMKL 2022.2. Let's closing this thread now. If you require additional assistance from Intel, please start a new thread. Any further interaction in this thread will be considered community only. 


0 Kudos
Reply