<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re:BUG: mkl_serv_print() calls kernel32!SetDllDirectoryA for no good reason in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/BUG-mkl-serv-print-calls-kernel32-SetDllDirectoryA-for-no-good/m-p/1342094#M32399</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks for reaching out to us.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;We are able to reproduce this issue at our end. We are working on this issue internally. We will get back to you soon.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Shanmukh.SS&lt;/P&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 07 Dec 2021 12:28:16 GMT</pubDate>
    <dc:creator>ShanmukhS_Intel</dc:creator>
    <dc:date>2021-12-07T12:28:16Z</dc:date>
    <item>
      <title>BUG: mkl_serv_print() calls kernel32!SetDllDirectoryA for no good reason</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/BUG-mkl-serv-print-calls-kernel32-SetDllDirectoryA-for-no-good/m-p/1341723#M32392</link>
      <description>&lt;DIV class="rah-static rah-static--height-auto" style="height: auto; overflow: visible;" aria-hidden="false"&gt;
&lt;DIV&gt;
&lt;ARTICLE class="css-1q7i31j evb0awb0" data-qa="readme-container"&gt;
&lt;DIV&gt;
&lt;P&gt;When pardiso is run with &lt;CODE&gt;msglvl = 1&lt;/CODE&gt;, for some reason it calls SetDllDirectoryA() from kernel32 and this changes the way DLLs are loaded for the rest of the process execution.&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="call_stack.png" style="width: 503px;"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/24572i437BC8A852C9B506/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="call_stack.png" alt="call_stack.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I created a public repo here: &lt;A href="https://bitbucket.org/konecnymichael/pardiso-setdlldirectory-bug" target="_self"&gt;https://bitbucket.org/konecnymichael/pardiso-setdlldirectory-bug &lt;/A&gt;which can be used to reproduce this strange behaviour.&lt;/P&gt;
&lt;P&gt;This can be done by simply setting a breakpoint to &lt;CODE&gt;kernel32!SetDllDirectoryA&lt;/CODE&gt; and running the program in the pardiso-setdlldirectory-bug project.&lt;/P&gt;
&lt;DIV id="tinyMceEditormkonecny_1" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;In a different project, I was able to find out SetDllDirectory was being called from MKL's mkl_serv_print() function.&lt;/P&gt;
&lt;DIV id="tinyMceEditormkonecny_2" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;This happens on both oneAPI toolkit versions 2021.3.0 and 2021.4.0 (currently latest).&lt;/P&gt;
&lt;P&gt;This behaviour is very annoying because:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;it is unexpected&lt;/LI&gt;
&lt;LI&gt;it started happening after an update from Intel 19.0&lt;/LI&gt;
&lt;LI&gt;it broke &lt;A href="https://docs.microsoft.com/en-us/cpp/build/reference/linker-support-for-delay-loaded-dlls?view=msvc-170" target="_blank" rel="nofollow noopener" data-is-external-link="true"&gt;delay loading&lt;/A&gt; of a library which was called later in a program, which took me two weeks to debug&lt;/LI&gt;
&lt;LI&gt;it seems unnecessary&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;I would appreciate if Intel could do either of:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;remove the SetDllDirectory call&lt;/LI&gt;
&lt;LI&gt;at least reset the DLL loading mode to previous settings as not to mess up the behaviour of the process which calls it&lt;/LI&gt;
&lt;/UL&gt;
&lt;/DIV&gt;
&lt;/ARTICLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;Can someone from Intel please have a look at this and get back to me?&lt;BR /&gt;It would be great if other people didn't have to go through the two-week debugging frenzy that I did.&lt;BR /&gt;&lt;BR /&gt;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.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 11:47:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/BUG-mkl-serv-print-calls-kernel32-SetDllDirectoryA-for-no-good/m-p/1341723#M32392</guid>
      <dc:creator>michaelkonecny</dc:creator>
      <dc:date>2021-12-06T11:47:58Z</dc:date>
    </item>
    <item>
      <title>Re:BUG: mkl_serv_print() calls kernel32!SetDllDirectoryA for no good reason</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/BUG-mkl-serv-print-calls-kernel32-SetDllDirectoryA-for-no-good/m-p/1342094#M32399</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks for reaching out to us.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;We are able to reproduce this issue at our end. We are working on this issue internally. We will get back to you soon.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Shanmukh.SS&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 07 Dec 2021 12:28:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/BUG-mkl-serv-print-calls-kernel32-SetDllDirectoryA-for-no-good/m-p/1342094#M32399</guid>
      <dc:creator>ShanmukhS_Intel</dc:creator>
      <dc:date>2021-12-07T12:28:16Z</dc:date>
    </item>
    <item>
      <title>Re:BUG: mkl_serv_print() calls kernel32!SetDllDirectoryA for no good reason</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/BUG-mkl-serv-print-calls-kernel32-SetDllDirectoryA-for-no-good/m-p/1388546#M33207</link>
      <description>&lt;P&gt;Thank you for reaching us. This issue will be available in oneMKL 2022.2. Let's closing this thread now.&amp;nbsp;If you require additional assistance from Intel, please start a new thread.&amp;nbsp;Any further interaction in this thread will be considered community only.&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 30 May 2022 08:17:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/BUG-mkl-serv-print-calls-kernel32-SetDllDirectoryA-for-no-good/m-p/1388546#M33207</guid>
      <dc:creator>Ruqiu_C_Intel</dc:creator>
      <dc:date>2022-05-30T08:17:55Z</dc:date>
    </item>
  </channel>
</rss>

