<?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: Uninitialized variable missed? (Parallel Inspector) in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Uninitialized-variable-missed-Parallel-Inspector/m-p/743338#M1273</link>
    <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/128716"&gt;laurent lessieux - Toshiba Medical&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;Am I missing something when I found strange that the Intel Parallel Inspector is not reporting that one?&lt;BR /&gt;&lt;BR /&gt; class testClass&lt;BR /&gt; {&lt;BR /&gt; public:&lt;BR /&gt; testClass() {}&lt;BR /&gt;&lt;BR /&gt; int getVal() {&lt;BR /&gt; return val;&lt;BR /&gt; }&lt;BR /&gt; private:&lt;BR /&gt; int val;&lt;BR /&gt; };&lt;BR /&gt;&lt;BR /&gt; int a;&lt;BR /&gt; int b = a * 4; // uninitialized read of variable a (this one is reported)&lt;BR /&gt;&lt;BR /&gt; b = tc.getVal(); (but not this one).&lt;BR /&gt;&lt;BR /&gt;Obviously the memory hasn't been initialized to anything as far as I am aware, so I would expect it to raise some error here. &lt;BR /&gt;Someone (ok me in that test) created the constructor of the class but forgot to initialized the variable (or left it unitialized for some reasons. performance for example).&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;Laurent.&lt;BR /&gt;I am using the Intel Parallel Inspector Update 1, (build 63628) running a x64 debug test on XP64.&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV&gt;Hi&lt;SPAN style="border-collapse: collapse;"&gt;Laurent,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="border-collapse: collapse;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="border-collapse: collapse;"&gt;To me it looks like a bug. But let me talk to development team and clarify it.&lt;/SPAN&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 13 Oct 2009 08:29:29 GMT</pubDate>
    <dc:creator>Vladimir_T_Intel</dc:creator>
    <dc:date>2009-10-13T08:29:29Z</dc:date>
    <item>
      <title>Uninitialized variable missed? (Parallel Inspector)</title>
      <link>https://community.intel.com/t5/Software-Archive/Uninitialized-variable-missed-Parallel-Inspector/m-p/743337#M1272</link>
      <description>Am I missing something when I found strange that the Intel Parallel Inspector is not reporting that one?&lt;BR /&gt;&lt;BR /&gt; class testClass&lt;BR /&gt; {&lt;BR /&gt; public:&lt;BR /&gt; testClass() {}&lt;BR /&gt;&lt;BR /&gt; int getVal() {&lt;BR /&gt; return val;&lt;BR /&gt; }&lt;BR /&gt; private:&lt;BR /&gt; int val;&lt;BR /&gt; };&lt;BR /&gt;&lt;BR /&gt; int a;&lt;BR /&gt; int b = a * 4; // uninitialized read of variable a (this one is reported)&lt;BR /&gt;&lt;BR /&gt; b = tc.getVal(); (but not this one).&lt;BR /&gt;&lt;BR /&gt;Obviously the memory hasn't been initialized to anything as far as I am aware, so I would expect it to raise some error here. &lt;BR /&gt;Someone (ok me in that test) created the constructor of the class but forgot to initialized the variable (or left it unitialized for some reasons. performance for example).&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;Laurent.&lt;BR /&gt;I am using the Intel Parallel Inspector Update 1, (build 63628) running a x64 debug test on XP64.&lt;BR /&gt;</description>
      <pubDate>Tue, 13 Oct 2009 05:20:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Uninitialized-variable-missed-Parallel-Inspector/m-p/743337#M1272</guid>
      <dc:creator>LLess</dc:creator>
      <dc:date>2009-10-13T05:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: Uninitialized variable missed? (Parallel Inspector)</title>
      <link>https://community.intel.com/t5/Software-Archive/Uninitialized-variable-missed-Parallel-Inspector/m-p/743338#M1273</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/128716"&gt;laurent lessieux - Toshiba Medical&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;Am I missing something when I found strange that the Intel Parallel Inspector is not reporting that one?&lt;BR /&gt;&lt;BR /&gt; class testClass&lt;BR /&gt; {&lt;BR /&gt; public:&lt;BR /&gt; testClass() {}&lt;BR /&gt;&lt;BR /&gt; int getVal() {&lt;BR /&gt; return val;&lt;BR /&gt; }&lt;BR /&gt; private:&lt;BR /&gt; int val;&lt;BR /&gt; };&lt;BR /&gt;&lt;BR /&gt; int a;&lt;BR /&gt; int b = a * 4; // uninitialized read of variable a (this one is reported)&lt;BR /&gt;&lt;BR /&gt; b = tc.getVal(); (but not this one).&lt;BR /&gt;&lt;BR /&gt;Obviously the memory hasn't been initialized to anything as far as I am aware, so I would expect it to raise some error here. &lt;BR /&gt;Someone (ok me in that test) created the constructor of the class but forgot to initialized the variable (or left it unitialized for some reasons. performance for example).&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;Laurent.&lt;BR /&gt;I am using the Intel Parallel Inspector Update 1, (build 63628) running a x64 debug test on XP64.&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV&gt;Hi&lt;SPAN style="border-collapse: collapse;"&gt;Laurent,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="border-collapse: collapse;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="border-collapse: collapse;"&gt;To me it looks like a bug. But let me talk to development team and clarify it.&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 13 Oct 2009 08:29:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Uninitialized-variable-missed-Parallel-Inspector/m-p/743338#M1273</guid>
      <dc:creator>Vladimir_T_Intel</dc:creator>
      <dc:date>2009-10-13T08:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: Uninitialized variable missed? (Parallel Inspector)</title>
      <link>https://community.intel.com/t5/Software-Archive/Uninitialized-variable-missed-Parallel-Inspector/m-p/743339#M1274</link>
      <description>&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;
&lt;DIV&gt;Hi Laurent,&lt;/DIV&gt;
&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;
&lt;DIV&gt;Here is the explanation.&lt;/DIV&gt;
&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;
&lt;DIV&gt;First of all, I presume that tc object of the class testClass was created on stack.&lt;/DIV&gt;
&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;
&lt;DIV&gt;Compiled in debug mode:&lt;/DIV&gt;
&lt;DIV&gt;If debug build was built with stack checking turned on, this initializes the stack with a pattern that is checked by the code. Thus, Inspector will never see uninitialized stack memory, because it is initialized by the compiler.&lt;/DIV&gt;
&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;
&lt;DIV&gt;Compiled in release mode:&lt;/DIV&gt;
&lt;DIV&gt;If you step through with the debugger, it will show that main is empty. The compiler has optimized out the body because it does nothing.&lt;/DIV&gt;
&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;
&lt;DIV&gt;I slightly modified the sample adding printf("%d",b) in order to prevent compiler optimization of main. In this case Inspector would not report Uninitialized memory access anyway. The reason is the compiler optimization for the creating b variable. For very small numbers of locals, the compiler, when optimizing, will use "push &lt;REG&gt;" instructions to reserve space on the stack for local variables. This test is an example of that - the class is basically just an "int". The memory checker doesn't have enough context to recognize that the "push &lt;REG&gt;" onto the stack is not "really" writing a value to the stack. Memory checker sees this as initialization, and since this is the stack space used for "b", it doesn't report an Uninitialized memory read.&lt;/REG&gt;&lt;/REG&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;
&lt;DIV&gt;So, consider this a corner case. If you will face with the problem in the real app case, please let us know, maybe we should reconsider the approach.&lt;/DIV&gt;
&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;
&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 14 Oct 2009 16:49:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Uninitialized-variable-missed-Parallel-Inspector/m-p/743339#M1274</guid>
      <dc:creator>Vladimir_T_Intel</dc:creator>
      <dc:date>2009-10-14T16:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: Uninitialized variable missed? (Parallel Inspector)</title>
      <link>https://community.intel.com/t5/Software-Archive/Uninitialized-variable-missed-Parallel-Inspector/m-p/743340#M1275</link>
      <description>&lt;DIV style="margin: 0px; height: auto;"&gt;&lt;/DIV&gt;
Hi Vladimir,&lt;BR /&gt;&lt;BR /&gt;It all makes sense thanks.&lt;BR /&gt;&lt;BR /&gt;Indeed the tc object was created on the stack.&lt;BR /&gt;I have not tried in release yet so I guess the stack is indeed initialized.&lt;BR /&gt;I am looking for the flag to add to turn that off but no luck so far. I am using the Intel Compiler 10.1.29 to compile the test.&lt;BR /&gt;Any idea about which flag I should turn off?&lt;BR /&gt;I tried /GS- but it is still not finding the issue.&lt;BR /&gt;&lt;BR /&gt;Laurent&lt;BR /&gt;</description>
      <pubDate>Thu, 15 Oct 2009 00:26:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Uninitialized-variable-missed-Parallel-Inspector/m-p/743340#M1275</guid>
      <dc:creator>LLess</dc:creator>
      <dc:date>2009-10-15T00:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: Uninitialized variable missed? (Parallel Inspector)</title>
      <link>https://community.intel.com/t5/Software-Archive/Uninitialized-variable-missed-Parallel-Inspector/m-p/743341#M1276</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/128716"&gt;laurent lessieux - Toshiba Medical&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;Hi Vladimir,&lt;BR /&gt;&lt;BR /&gt;It all makes sense thanks.&lt;BR /&gt;&lt;BR /&gt;Indeed the tc object was created on the stack.&lt;BR /&gt;I have not tried in release yet so I guess the stack is indeed initialized.&lt;BR /&gt;I am looking for the flag to add to turn that off but no luck so far. I am using the Intel Compiler 10.1.29 to compile the test.&lt;BR /&gt;Any idea about which flag I should turn off?&lt;BR /&gt;I tried /GS- but it is still not finding the issue.&lt;BR /&gt;&lt;BR /&gt;Laurent&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Hi Laurent,&lt;BR /&gt;&lt;BR /&gt;Just switch off the basic runtime checks (RTC*). Inspector will report uninit read on mi4 level in this case.</description>
      <pubDate>Thu, 15 Oct 2009 12:08:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Uninitialized-variable-missed-Parallel-Inspector/m-p/743341#M1276</guid>
      <dc:creator>Vladimir_T_Intel</dc:creator>
      <dc:date>2009-10-15T12:08:06Z</dc:date>
    </item>
  </channel>
</rss>

