<?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 Thank you for bringing this in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-LAPACK-subroutine-ZHEEVR-input-array-quot-isuppz/m-p/1150818#M27129</link>
    <description>&lt;P&gt;Thank you for bringing this to our attention, and for the detailed reproducers!&amp;nbsp; We will take a look into this and let you know the results.&lt;/P&gt;</description>
    <pubDate>Mon, 06 Apr 2020 23:53:26 GMT</pubDate>
    <dc:creator>Sarah_K_Intel</dc:creator>
    <dc:date>2020-04-06T23:53:26Z</dc:date>
    <item>
      <title>Problem with LAPACK subroutine ZHEEVR, input array "isuppz" accessed despite documentation saying otherwise</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-LAPACK-subroutine-ZHEEVR-input-array-quot-isuppz/m-p/1150816#M27127</link>
      <description>Hello,

I think I have run into an inconsistency between the documented behaviour of LAPACK subroutine ZHEEVR and the observed behaviour.

According to the documentation here:

&lt;A href="https://software.intel.com/en-us/mkl-developer-reference-fortran-heevr" target="_blank"&gt;https://software.intel.com/en-us/mkl-developer-reference-fortran-heevr&lt;/A&gt;

the input array "isuppz" is "&lt;R&gt;eferenced only if eigenvectors are needed (jobz = 'V') and all eigenvalues are needed."

However, it appears that the array is accessed even if

1. the "jobz" parameter is 'N' (that is, only the eigenvalues are requested, while the eigenvectors are not); or
2. the "jobz" parameter is 'V', and only a proper subset of eigenvalue/vectors is requested, as specified by the "il" and "iu" parameters.

The uploaded files "demos1.f" and "demos2.f" demonstrate these problems respectively. In each demo, the subroutine zheevr() is called on the 6x6 identity matrix. Before the call, the input "isuppz" array is filled with an integer pattern. If the implementation matches the documentation, these initial values should not change upon return from zheevr(). But here, the output shows that the isuppz array did get overwritten by zheevr().

That is, the expected output, for both demo programmes, should be:

 m:           3
 isuppz:
      111111      222222      333333      444444      555555      666666      777777      888888      999999      101010      101101      102102

but the actual output was:

 m:           3
 isuppz:
           0           0           0           0           0           0      777777      888888      999999      101010      101101      102102

This means that the array may get overwritten when it is not expected to be. In the case when the caller expects isuppz to be not referenced, and therefore passes a small array (maybe to save memory space), the call to zheevr may cause a memory error or buffer overflow.

I wish to bring this observation to the attention of the Intel staff here. Thanks!

Zoë

- Operating system and version
-- macOS 10.15.3

- Library version
-- MKL 2020.0 (distributed with miniconda)

- Compiler version
-- gfortran 9.3.0

- Steps to reproduce the error
-- The Fortran77 code (attached) was compiled and linked with "-lmkl_rt"&lt;/R&gt;</description>
      <pubDate>Sun, 29 Mar 2020 13:09:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-LAPACK-subroutine-ZHEEVR-input-array-quot-isuppz/m-p/1150816#M27127</guid>
      <dc:creator>Zoë</dc:creator>
      <dc:date>2020-03-29T13:09:00Z</dc:date>
    </item>
    <item>
      <title>Hi MKL team,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-LAPACK-subroutine-ZHEEVR-input-array-quot-isuppz/m-p/1150817#M27128</link>
      <description>&lt;P&gt;Hi MKL team,&lt;/P&gt;&lt;P&gt;If I am not mistaken this originated from an issue, &lt;A href="https://github.com/scipy/scipy/issues/11709" target="_blank"&gt;https://github.com/scipy/scipy/issues/11709&lt;/A&gt;, we have on SciPy wrappers. In our codebase we wrapped ?heevr in a way such that when jobz parameter is not "V" we return an empty isuppz array after following the LAPACK reference contract. We also tested this in various platforms using OpenBLAS. After having confirmed test cases we merged into our codebase. But as above, a number of users immediately started getting hit by this behavior.&lt;/P&gt;&lt;P&gt;As far as I could dig in, this relates to how ?stemr interacts with isuppz array depending on the parameters supplied. However as demonstrated above isuppz is referenced regardless. Could you please advice us how we should proceed?&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;ilhan&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2020 11:58:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-LAPACK-subroutine-ZHEEVR-input-array-quot-isuppz/m-p/1150817#M27128</guid>
      <dc:creator>Polat__Ilhan</dc:creator>
      <dc:date>2020-04-06T11:58:47Z</dc:date>
    </item>
    <item>
      <title>Thank you for bringing this</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-LAPACK-subroutine-ZHEEVR-input-array-quot-isuppz/m-p/1150818#M27129</link>
      <description>&lt;P&gt;Thank you for bringing this to our attention, and for the detailed reproducers!&amp;nbsp; We will take a look into this and let you know the results.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2020 23:53:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-LAPACK-subroutine-ZHEEVR-input-array-quot-isuppz/m-p/1150818#M27129</guid>
      <dc:creator>Sarah_K_Intel</dc:creator>
      <dc:date>2020-04-06T23:53:26Z</dc:date>
    </item>
    <item>
      <title>Hi there,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-LAPACK-subroutine-ZHEEVR-input-array-quot-isuppz/m-p/1150819#M27130</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I'd like to kindly ping this issue just in case it fell down between the todo list cracks.&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2020 15:24:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-LAPACK-subroutine-ZHEEVR-input-array-quot-isuppz/m-p/1150819#M27130</guid>
      <dc:creator>Polat__Ilhan</dc:creator>
      <dc:date>2020-04-28T15:24:47Z</dc:date>
    </item>
    <item>
      <title>Ilhan,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-LAPACK-subroutine-ZHEEVR-input-array-quot-isuppz/m-p/1150820#M27131</link>
      <description>&lt;P&gt;Ilhan,&lt;/P&gt;&lt;P&gt;Yes, we investigated and root-caused the issue.&lt;/P&gt;&lt;P&gt;The fix of the issue is planning to be released the next update of mkl 2020 ( update 2). We will keep you informed of the status of this case.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 04:38:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-LAPACK-subroutine-ZHEEVR-input-array-quot-isuppz/m-p/1150820#M27131</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2020-04-29T04:38:22Z</dc:date>
    </item>
    <item>
      <title>and plus one more thing,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-LAPACK-subroutine-ZHEEVR-input-array-quot-isuppz/m-p/1150821#M27132</link>
      <description>&lt;P&gt;and plus one more thing, which probably will be useful -&amp;nbsp; as a workaround the problem, you may try to use ILP64 API instead of lp64.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 04:41:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-LAPACK-subroutine-ZHEEVR-input-array-quot-isuppz/m-p/1150821#M27132</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2020-04-29T04:41:10Z</dc:date>
    </item>
    <item>
      <title>Thank you Gennady F.</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-LAPACK-subroutine-ZHEEVR-input-array-quot-isuppz/m-p/1150822#M27133</link>
      <description>&lt;P&gt;Thank you Gennady F.&lt;/P&gt;&lt;P&gt;Do you mind elaborating what the problem was or how long isuppz array we should allocate to be on the safe side?&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2020 19:53:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-LAPACK-subroutine-ZHEEVR-input-array-quot-isuppz/m-p/1150822#M27133</guid>
      <dc:creator>Polat__Ilhan</dc:creator>
      <dc:date>2020-05-06T19:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: and plus one more thing,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-LAPACK-subroutine-ZHEEVR-input-array-quot-isuppz/m-p/1197137#M29841</link>
      <description>&lt;P&gt;the fix of the issue available in MKL 2020 update 2 which has been released and available for download.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2020 05:18:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-LAPACK-subroutine-ZHEEVR-input-array-quot-isuppz/m-p/1197137#M29841</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2020-08-04T05:18:08Z</dc:date>
    </item>
  </channel>
</rss>

