<?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: openmp/exception handling bug on Intel C++ in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/openmp-exception-handling-bug-on-Intel-C/m-p/876827#M3184</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/439616"&gt;marcusexoticmatter.com&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;
&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;I am using icpc (ICC) 11.1 on 64-bit Linux (Fedora 11) btw.&lt;BR /&gt;&lt;BR /&gt;And the problem still does occur with -O1..3 in another program that does the same thing :(&lt;BR /&gt;However, on the code I posted, please do compile with -O0 so that the bug occurs.&lt;BR /&gt;&lt;BR /&gt;thanks&lt;BR /&gt;Marcus&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Hi!&lt;BR /&gt;&lt;BR /&gt;I've tried your command line options and they make the program hang. I have played around with the options and found out that -O0 or -g3 has to be present to trigger the bug. If you remove both of them, the compiler creates a functional executable. Maybe this you can use this as a work-around for now until one of the compiler guys was able to take a closer look at the problem.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt; -michael&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 25 Nov 2009 17:54:36 GMT</pubDate>
    <dc:creator>Michael_K_Intel2</dc:creator>
    <dc:date>2009-11-25T17:54:36Z</dc:date>
    <item>
      <title>openmp/exception handling bug on Intel C++</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/openmp-exception-handling-bug-on-Intel-C/m-p/876823#M3180</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I have boiled down a complex "bug" into a very small program which fails to catch an exception when compiled by the Intel C++ compiler (v11), however it works fine on gcc (4.x). Note that on the Intel compiler, it doesn't crash, it just sits there forever. When I ran it through gdb I noticed it seemed to be going into an endless loop in the std::vector destructor (see the code below).&lt;BR /&gt;&lt;BR /&gt;What triggers this bug seems to be the inclusion of the OpenMP parallel directive. If I serialize the little loop by commenting out the #pragma omp parallel for, the exception is succesfully caught, even on the Intel compiler. So it seems to have something to do with the Intel compiler's OpenMP implementation, and how it plays with exceptions. It is a compiler bug, I think, since this code doesn't throw any exceptions inside the parallel region. Please see below:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#include &lt;STRING&gt;&lt;BR /&gt;#include &lt;VECTOR&gt;&lt;BR /&gt;#include &lt;IOSTREAM&gt;&lt;BR /&gt;&lt;BR /&gt;std::string&lt;BR /&gt;bad_func()&lt;BR /&gt;{&lt;BR /&gt; throw std::exception();&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;int&lt;BR /&gt;main(int argc, char* argv[])&lt;BR /&gt;{&lt;BR /&gt; try {&lt;BR /&gt; std::vector&lt;FLOAT&gt; v0;&lt;BR /&gt; std::vector&lt;FLOAT&gt; v1;&lt;BR /&gt; bad_func();&lt;BR /&gt;#pragma omp parallel for&lt;BR /&gt; for(unsigned int q=0; q&amp;lt;8; ++q) {&lt;BR /&gt; std::vector&lt;FLOAT&gt; u,v;&lt;BR /&gt; } &lt;BR /&gt; }&lt;BR /&gt; catch(std::exception&amp;amp; e) {&lt;BR /&gt; std::cerr &amp;lt;&amp;lt; e.what() &amp;lt;&amp;lt; std::endl;&lt;BR /&gt; }&lt;BR /&gt;}&lt;/FLOAT&gt;&lt;/FLOAT&gt;&lt;/FLOAT&gt;&lt;/IOSTREAM&gt;&lt;/VECTOR&gt;&lt;/STRING&gt;</description>
      <pubDate>Wed, 25 Nov 2009 14:58:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/openmp-exception-handling-bug-on-Intel-C/m-p/876823#M3180</guid>
      <dc:creator>marcusexoticmatter_c</dc:creator>
      <dc:date>2009-11-25T14:58:55Z</dc:date>
    </item>
    <item>
      <title>Re: openmp/exception handling bug on Intel C++</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/openmp-exception-handling-bug-on-Intel-C/m-p/876824#M3181</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/439616"&gt;marcusexoticmatter.com&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;Hello,&lt;BR /&gt;&lt;BR /&gt;I have boiled down a complex "bug" into a very small program which fails to catch an exception when compiled by the Intel C++ compiler (v11), however it works fine on gcc (4.x). Note that on the Intel compiler, it doesn't crash, it just sits there forever. When I ran it through gdb I noticed it seemed to be going into an endless loop in the std::vector destructor (see the code below).&lt;BR /&gt;&lt;BR /&gt;What triggers this bug seems to be the inclusion of the OpenMP parallel directive. If I serialize the little loop by commenting out the #pragma omp parallel for, the exception is succesfully caught, even on the Intel compiler. So it seems to have something to do with the Intel compiler's OpenMP implementation, and how it plays with exceptions. It is a compiler bug, I think, since this code doesn't throw any exceptions inside the parallel region. Please see below:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#include &lt;STRING&gt;&lt;BR /&gt;#include &lt;VECTOR&gt;&lt;BR /&gt;#include &lt;IOSTREAM&gt;&lt;BR /&gt;&lt;BR /&gt;std::string&lt;BR /&gt;bad_func()&lt;BR /&gt;{&lt;BR /&gt; throw std::exception();&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;int&lt;BR /&gt;main(int argc, char* argv[])&lt;BR /&gt;{&lt;BR /&gt; try {&lt;BR /&gt; std::vector&lt;FLOAT&gt; v0;&lt;BR /&gt; std::vector&lt;FLOAT&gt; v1;&lt;BR /&gt; bad_func();&lt;BR /&gt;#pragma omp parallel for&lt;BR /&gt; for(unsigned int q=0; q&amp;lt;8; ++q) {&lt;BR /&gt; std::vector&lt;FLOAT&gt; u,v;&lt;BR /&gt; } &lt;BR /&gt; }&lt;BR /&gt; catch(std::exception&amp;amp; e) {&lt;BR /&gt; std::cerr &amp;lt;&amp;lt; e.what() &amp;lt;&amp;lt; std::endl;&lt;BR /&gt; }&lt;BR /&gt;}&lt;/FLOAT&gt;&lt;/FLOAT&gt;&lt;/FLOAT&gt;&lt;/IOSTREAM&gt;&lt;/VECTOR&gt;&lt;/STRING&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Hi!&lt;BR /&gt;&lt;BR /&gt;I have tried the program both with GCC 4.3.2 and ICC 11.1 20090630 and it worked for both compilers. Can you be more specific, which version of ICC causes the problem. That would make it much easier to track down the problem.&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt; -michael&lt;BR /&gt;</description>
      <pubDate>Wed, 25 Nov 2009 15:49:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/openmp-exception-handling-bug-on-Intel-C/m-p/876824#M3181</guid>
      <dc:creator>Michael_K_Intel2</dc:creator>
      <dc:date>2009-11-25T15:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: openmp/exception handling bug on Intel C++</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/openmp-exception-handling-bug-on-Intel-C/m-p/876825#M3182</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/416135"&gt;Michael Klemm, Intel&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;
&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;Hi!&lt;BR /&gt;&lt;BR /&gt;I have tried the program both with GCC 4.3.2 and ICC 11.1 20090630 and it worked for both compilers. Can you be more specific, which version of ICC causes the problem. That would make it much easier to track down the problem.&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt; -michael&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Hi Michael,&lt;BR /&gt;Thanks for your post.&lt;BR /&gt;&lt;BR /&gt;This is the exact command-line invocation I am using for the intel C++ compiler (icpc) :&lt;BR /&gt;&lt;BR /&gt;$ icpc -fexceptions -Wall -fPIC -pipe -fno-common -g3 -O0 -openmp -openmp-report2 main.cc&lt;BR /&gt;&lt;BR /&gt;where 'main.cc' is a text file containing the code I posted.&lt;BR /&gt;&lt;BR /&gt;The resulting 'a.out' binary never returns, being stuck inside the ~vector destructor. HOWEVER: I just noticed the problem goes away if I specify -O1..3 instead of -O0. very bizarre!!!&lt;BR /&gt;</description>
      <pubDate>Wed, 25 Nov 2009 16:24:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/openmp-exception-handling-bug-on-Intel-C/m-p/876825#M3182</guid>
      <dc:creator>marcusexoticmatter_c</dc:creator>
      <dc:date>2009-11-25T16:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: openmp/exception handling bug on Intel C++</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/openmp-exception-handling-bug-on-Intel-C/m-p/876826#M3183</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/416135"&gt;Michael Klemm, Intel&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;
&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;Hi!&lt;BR /&gt;&lt;BR /&gt;I have tried the program both with GCC 4.3.2 and ICC 11.1 20090630 and it worked for both compilers. Can you be more specific, which version of ICC causes the problem. That would make it much easier to track down the problem.&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt; -michael&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;I am using icpc (ICC) 11.1 on 64-bit Linux (Fedora 11) btw.&lt;BR /&gt;&lt;BR /&gt;And the problem still does occur with -O1..3 in another program that does the same thing :(&lt;BR /&gt;However, on the code I posted, please do compile with -O0 so that the bug occurs.&lt;BR /&gt;&lt;BR /&gt;thanks&lt;BR /&gt;Marcus&lt;BR /&gt;</description>
      <pubDate>Wed, 25 Nov 2009 16:35:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/openmp-exception-handling-bug-on-Intel-C/m-p/876826#M3183</guid>
      <dc:creator>marcusexoticmatter_c</dc:creator>
      <dc:date>2009-11-25T16:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: openmp/exception handling bug on Intel C++</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/openmp-exception-handling-bug-on-Intel-C/m-p/876827#M3184</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/439616"&gt;marcusexoticmatter.com&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;
&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;I am using icpc (ICC) 11.1 on 64-bit Linux (Fedora 11) btw.&lt;BR /&gt;&lt;BR /&gt;And the problem still does occur with -O1..3 in another program that does the same thing :(&lt;BR /&gt;However, on the code I posted, please do compile with -O0 so that the bug occurs.&lt;BR /&gt;&lt;BR /&gt;thanks&lt;BR /&gt;Marcus&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Hi!&lt;BR /&gt;&lt;BR /&gt;I've tried your command line options and they make the program hang. I have played around with the options and found out that -O0 or -g3 has to be present to trigger the bug. If you remove both of them, the compiler creates a functional executable. Maybe this you can use this as a work-around for now until one of the compiler guys was able to take a closer look at the problem.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt; -michael&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 25 Nov 2009 17:54:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/openmp-exception-handling-bug-on-Intel-C/m-p/876827#M3184</guid>
      <dc:creator>Michael_K_Intel2</dc:creator>
      <dc:date>2009-11-25T17:54:36Z</dc:date>
    </item>
  </channel>
</rss>

