<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated on Sat, 26 May 2012 04:11:54 -0700 -->
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <atom:link href="http://software.intel.com/en-us/articles/intel-parallel-inspector-kb/type/errors-diagnostics/feed/" rel="self" type="application/rss+xml" />
    <title>Intel Software Network articles Feed</title>
    <link>http://software.intel.com/en-us/articles/intel-parallel-inspector-kb/type/errors-diagnostics/</link>
    <description></description>
    <language>en-us</language>
    <item>
      <title>Using the Microsoft* debug heap manager with memory error analysis of Intel® Parallel Inspector</title>
      <description><![CDATA[ <p>The Microsoft C runtime debug heap manager tracks/checks/reports a subset of the memory usage that memory error analysis of Intel Parallel Inspector tracks/checks/reports. </p>
<p>Using both of these technologies at the same time has the following implications...</p>
<ul>
<li>Binaries under analysis of Inspector may be interrupted by dialogue boxes 
<ul>
<li>Press the "ignore" button- execution will continue (recommended action) - note: you may have to press "ignore" multiple times - as by default this dialogue box will appear every so many instances for each unique error detected.</li>
<li>Do not press the "abort" button - as that will exit the application before Intel Parallel Inspector can give you a list of all memory errors, and Intel Parallel Inspector may report false positives as your application exited prematurely.</li>
<li>Do not press the “retry” button in the dialog box, else - the debugger will open and point you to assembly code that was "generated" as a result of running your application under the  Inspector analysis engine rather than the assembly of your application (not recommended)</li>
</ul>
</li>
<li>The same issue may be reported by both technologies.</li>
<li>Performance will suffer as both technologies are tracking and checking memory usage</li>
</ul>
<p>You may want to turn off the Debug Heap Manager provided by the Microsoft C runtime library.</p>
<p >There is only one way to "turn off" the debug heap manager... and that is:</p>
<ul >
<li>  Use the Release/Base version of the Microsoft C runtime library by compiling with either /MD or /MT</li>
</ul>
<p >In the ideal situation, it is recommended that you use /Od with memory error analysis in Intel Parallel Inspector with the /MD or /MT runtime library selections. By default a "debug" configuration in Visual Studio will select /MDd or /MTd settings rather than the /MD or /MT settings. You would need to check these settings for each project in your solution.  Note: It can be difficult to accomplish this on large projects - as it will be difficult to have the same runtime library used in your entire application (all dll(s), lib(s), etc).</p>
<p>Another way, to work around this problem - is to tell the "debug" version of the heap manager to disable heap checking and reporting (tracking still occurs with this method).  This can be done using the _CrtSetDbgFlag api.  An example follows showing a code snippet which turns these features off.</p>
<p >#include &lt;crtdbg.h&gt;</p>
<p >main() {</p>
<p >int oriDbgFlag, newDbgFlag;</p>
<p >oriDbgFlag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);</p>
<p >newDbgFlag &amp;= ~_CRTDBG_ALLOC_MEM_DF; //Turn this off (by default it is on)</p>
<p >newDbgFlag |= _CRTDBG_CHECK_ALWAYS_DF;  //Turn this on (by default it is off)</p>
<p >newDbgFlag &amp;= ~_CRTDBG_CHECK_CRT_DF;  //Not needed as this is default</p>
<p >newDbgFlag &amp;= ~_CRTDBG_DELAY_FREE_MEM_DF; //Not needed as this is default</p>
<p >newDbgFlag &amp;= ~_CRTDBG_LEAK_CHECK_DF; //Not needed as this is default</p>
<p >newDbgFlag = (newDbgFlag &amp; 0x0000FFFF) | _CRTDBG_CHECK_DEFAULT_DF; //Not needed as this is default</p>
<p >newDbgFlag = _CrtSetDbgFlag(newDbgFlag);</p>
<p >//...</p>
<p >For more information look for _CrtSetDbgFlag at MSDN.</p>
<p>Potential dialogue boxes/messages that the debug heap manager of the Microsoft C runtime library may produce, which can be suppressed using the techniques above (when under analysis of Intel Parallel Inspector):</p>
<p >Client hook allocation failure at file</p>
<p >Client hook allocation failure %hs line</p>
<p >Invalid allocation size:</p>
<p >Error: memory allocation: bad memory block type.</p>
<p >Client hook re-allocation failure at file %hs line.</p>
<p >Client hook re-allocation failure Or Error: memory allocation: bad memory block type.</p>
<p >Error: memory allocation: bad memory block type. The Block at 0x%p was allocated by aligned routines, use _aligned_realloc(). The Block at 0x%p was allocated by aligned routines, use _aligned_free()</p>
<p >Client hook free failure. HEAP CORRUPTION DETECTED: before %hs block (#%d) at 0x%p. CRT detected that the application wrote to memory before start of heap buffer.</p>
<p >HEAP CORRUPTION DETECTED: after %hs block (#%d) at 0x%p.</p>
<p >CRT detected that the application wrote to memory after end of heap buffer.</p>
<p >HEAP CORRUPTION DETECTED: after %hs block (#%d) at 0x%p.</p>
<p >CRT detected that the application wrote to memory after end of heap buffer.</p>
<p >_heapchk fails with _HEAPBADBEGIN.</p>
<p >_heapchk fails with _HEAPBADNODE.</p>
<p >_heapchk fails with _HEAPBADEND.</p>
<p >_heapchk fails with _HEAPBADPTR.</p>
<p >_heapchk fails with unknown return value!</p>
<p >HEAP CORRUPTION DETECTED: before %hs block (#%d) at 0x%p.</p>
<p >CRT detected that the application wrote to memory before start of heap buffer.</p>
<p >HEAP CORRUPTION DETECTED: before %hs block (#%d) at 0x%p.</p>
<p >CRT detected that the application wrote to memory before start of heap buffer.</p>
<p >HEAP CORRUPTION DETECTED: after %hs block (#%d) at 0x%p.</p>
<p >CRT detected that the application wrote to memory after end of heap buffer.</p>
<p >HEAP CORRUPTION DETECTED: after %hs block (#%d) at 0x%p.</p>
<p >CRT detected that the application wrote to memory after end of heap buffer.</p>
<p >HEAP CORRUPTION DETECTED: on top of Free block at 0x%p.</p>
<p >CRT detected that the application wrote to a heap buffer that was freed.</p>
<p >HEAP CORRUPTION DETECTED: on top of Free block at 0x%p.</p>
<p >CRT detected that the application wrote to a heap buffer that was freed.</p>
<p >%hs located at 0x%p is %Iu bytes long.</p>
<p >Bad memory block found at 0x%p.</p>
<p >Detected memory leaks!</p>
<p >Damage before 0x%p which was allocated by aligned routine</p> ]]></description>
      <link>http://software.intel.com/en-us/articles/using-the-microsoft-debug-heap-manager-with-memory-error-analysis-of-intel-parallel-inspector/</link>
      <pubDate>Thu, 06 May 2010 21:00:00 -0700</pubDate>
      <comments>http://software.intel.com/en-us/articles/using-the-microsoft-debug-heap-manager-with-memory-error-analysis-of-intel-parallel-inspector/#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/using-the-microsoft-debug-heap-manager-with-memory-error-analysis-of-intel-parallel-inspector/</guid>
      <category>Tools</category>
      <category>Intel® Parallel Inspector</category>
      <category>Intel® Parallel Inspector Knowledge Base</category>
      <category>Code &amp; Downloads</category>
    </item>
    <item>
      <title>How to troubleshoot if Microsoft* Visual Studio integration with Intel(R) Parallel Inspector does not work and the controls are not visible or exposed properly</title>
      <description><![CDATA[ <p><strong>Problem : </strong>You have successfully installed Intel(R) Parallel Amplifier (or any Intel(R) Parallel Studio tools) but the toolbar for Parallel Amplifier (or whatever Parallel Studio tool(s) you installed) does not appear in Visual Studio.<br /><br /><br /><strong>Environment : </strong>Microsoft* Visual Studio* versions that have installed Parallel Studio tools.<br /><br /><br /><strong>Root Cause :</strong> Tool bar is not visible, either because it is not enabled or it is obscured by other tool bars that are enabled.<br /><br /><br /><strong>Resolution : </strong>Here are some suggestions:<br />* Select the View-&gt;Toolbars menu to confirm that the menu option "Intel Parallel Amplifier" is available and checked. If not checked, you can select the toolbar option and the toolbar should become visible.<br />* It is possible that the Parallel Amplifier toolbar is installed and available but all the Visual Studio* toolbars are positioned such that the Parallel Amplifier toolbar is not prominently visible. In this case, consider dragging around some toolbars and reposition them to ensure that the Amplifier tool bar is more prominently visible. If there are toolbars that you do not use, you can deselect such toolbars to better use the toolbar space.<br />* Some non-English OSes may have issues. Please see this KB article for more information: <a title="http://software.intel.com/en-us/articles/installation-of-intel-parallel-amplifier-on-non-english-operating-systems/" href="http://software.intel.com/en-us/articles/installation-of-intel-parallel-amplifier-on-non-english-operating-systems/" target="_blank">http://software.intel.com/en-us/articles/installation-of-intel-parallel-amplifier-on-non-english-operating-systems/<br /></a>* If none of the suggestions above work, please post your question on the <a title="Parallel Studio forum" href="http://software.intel.com/en-us/forums/intel-parallel-studio/" target="_blank">Parallel Studio forum</a>. <br /><br />*Other names and brands may be claimed as the property of others.</p> ]]></description>
      <link>http://software.intel.com/en-us/articles/how-to-troubleshoot-if-microsoft-visual-studio-integration-does-not-work-and-the-controls-are-not-visible-or-exposed-properly/</link>
      <pubDate>Tue, 21 Apr 2009 00:00:00 -0700</pubDate>
      <comments>http://software.intel.com/en-us/articles/how-to-troubleshoot-if-microsoft-visual-studio-integration-does-not-work-and-the-controls-are-not-visible-or-exposed-properly/#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/how-to-troubleshoot-if-microsoft-visual-studio-integration-does-not-work-and-the-controls-are-not-visible-or-exposed-properly/</guid>
      <category>Parallel Programming</category>
      <category>Tools</category>
      <category>Intel® Parallel Amplifier Knowledge Base</category>
      <category>Intel® Parallel Composer Knowledge Base</category>
      <category>Intel® Parallel Inspector Knowledge Base</category>
    </item>
  </channel></rss>
