<?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 Segfault on stdout OR terminal output WRITE(6,*) ?? in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Segfault-on-stdout-OR-terminal-output-WRITE-6/m-p/740864#M598</link>
    <description>I am a fairly experienced fortran programmer, but I have never seen this before. Probably because the implimentation here is a little slapped-together, and for a full-fledged project things would be different. Here is the problem:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I have a fairly small optimization routine, in fortran, that is compiled by commands from a perl script. Ultimately this fortran routine is run and the output (a series of WRITE(6,*)) is read in by the perl script through a basic $values = `./a.out stuff...` type command. THis has been working fine for weeks.&lt;BR /&gt;&lt;BR /&gt;I changed a few things (more outputs), and now the program segfaults, seemingly at random (anywhere from 3 - 30 loops will go by running the system command just fine and then one will fail)&lt;BR /&gt;&lt;BR /&gt; WRITE(12,'(/,''  ****   RESULTS AFTER SA   ****   '')')      &lt;BR /&gt; CALL PRTVEC(XOPT,N,'SOLUTION')&lt;BR /&gt; WRITE(12,'(A)')'THIS TEXT DOES NOT CAUSE PROBLEM'&lt;BR /&gt; CALL PRTVEC(VM,N,'FINAL STEP LENGTH')&lt;BR /&gt; WRITE(12,'(A)')'NOR THIS'&lt;BR /&gt; WRITE(12,1001) FOPT, NFCNEV, NACC, NOBDS, T, IER&lt;BR /&gt; &lt;BR /&gt;1000     FORMAT(/,' SIMULATED ANNEALING EXAMPLE',/,&amp;amp;&lt;BR /&gt; /,' NUMBER OF PARAMETERS: ',I3,'   MAXIMAZATION: ',L5,&amp;amp;&lt;BR /&gt; /,' INITIAL TEMP: ', G8.2, '   RT: ',G8.2, '   EPS: ',G8.2,&amp;amp;&lt;BR /&gt; /,' NS: ',I3, '   NT: ',I2, '   NEPS: ',I2,&amp;amp;&lt;BR /&gt; /,' MAXEVL: ',I10, '   IPRINT: ',I1, '   ISEED1: ',I4,&amp;amp;&lt;BR /&gt; '   ISEED2: ',I4)&lt;BR /&gt;1001     FORMAT(/,' OPTIMAL FUNCTION VALUE: ',G20.13&amp;amp;&lt;BR /&gt; /,' NUMBER OF FUNCTION EVALUATIONS:     ',I10,&amp;amp;&lt;BR /&gt; /,' NUMBER OF ACCEPTED EVALUATIONS:     ',I10,&amp;amp;&lt;BR /&gt; /,' NUMBER OF OUT OF BOUND EVALUATIONS: ',I10,&amp;amp;&lt;BR /&gt; /,' FINAL TEMP: ', G20.13,'  IER: ', I3)&lt;BR /&gt; WRITE(6,'(I5,X)', ADVANCE='no')CL_INT1&lt;BR /&gt; WRITE(6,'(I5,X)', ADVANCE='no')CL_INT2&lt;BR /&gt; WRITE(6,'(A)')''&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;These WRITE(6) statements never get written, and if the fortran is executed from inside the perl I never even hear the error message - it just hangs and when I kill it a.out is still running in the background doing nothing! It just sits! If I take it out on it's own and run it, I get this:&lt;BR /&gt;&lt;BR /&gt;forrtl: severe (174): SIGSEGV, segmentation fault occurred&lt;BR /&gt;Image              PC                Routine            Line        Source             &lt;BR /&gt;libc.so.6          00007FF84A607E5D  Unknown               Unknown  Unknown&lt;BR /&gt;libc.so.6          00007FF84A60A4C9  Unknown               Unknown  Unknown&lt;BR /&gt;libc.so.6          00007FF84A60C7EE  Unknown               Unknown  Unknown&lt;BR /&gt;libc.so.6          00007FF84A6648E5  Unknown               Unknown  Unknown&lt;BR /&gt;a.out              000000000044F387  Unknown               Unknown  Unknown&lt;BR /&gt;a.out              000000000041F385  Unknown               Unknown  Unknown&lt;BR /&gt;a.out              000000000043B537  Unknown               Unknown  Unknown&lt;BR /&gt;a.out              0000000000408047  Unknown               Unknown  Unknown&lt;BR /&gt;a.out              000000000040396C  Unknown               Unknown  Unknown&lt;BR /&gt;libc.so.6          00007FF84A5B0ABD  Unknown               Unknown  Unknown&lt;BR /&gt;a.out              0000000000403869  Unknown               Unknown  Unknown&lt;BR /&gt;&lt;BR /&gt;I have NO IDEA why this is happening, and all my usual tricks to find where Fortran is unhappy are failing. And this shouldn't be using THAT much memory. The only big thing is the output from the subroutine 'SA' which will happily write a thousand megabyte log file. I don't know if this is related, it hadn't been a problem so far.&lt;BR /&gt;</description>
    <pubDate>Thu, 05 Nov 2009 23:36:25 GMT</pubDate>
    <dc:creator>etmeyer</dc:creator>
    <dc:date>2009-11-05T23:36:25Z</dc:date>
    <item>
      <title>Segfault on stdout OR terminal output WRITE(6,*) ??</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Segfault-on-stdout-OR-terminal-output-WRITE-6/m-p/740864#M598</link>
      <description>I am a fairly experienced fortran programmer, but I have never seen this before. Probably because the implimentation here is a little slapped-together, and for a full-fledged project things would be different. Here is the problem:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I have a fairly small optimization routine, in fortran, that is compiled by commands from a perl script. Ultimately this fortran routine is run and the output (a series of WRITE(6,*)) is read in by the perl script through a basic $values = `./a.out stuff...` type command. THis has been working fine for weeks.&lt;BR /&gt;&lt;BR /&gt;I changed a few things (more outputs), and now the program segfaults, seemingly at random (anywhere from 3 - 30 loops will go by running the system command just fine and then one will fail)&lt;BR /&gt;&lt;BR /&gt; WRITE(12,'(/,''  ****   RESULTS AFTER SA   ****   '')')      &lt;BR /&gt; CALL PRTVEC(XOPT,N,'SOLUTION')&lt;BR /&gt; WRITE(12,'(A)')'THIS TEXT DOES NOT CAUSE PROBLEM'&lt;BR /&gt; CALL PRTVEC(VM,N,'FINAL STEP LENGTH')&lt;BR /&gt; WRITE(12,'(A)')'NOR THIS'&lt;BR /&gt; WRITE(12,1001) FOPT, NFCNEV, NACC, NOBDS, T, IER&lt;BR /&gt; &lt;BR /&gt;1000     FORMAT(/,' SIMULATED ANNEALING EXAMPLE',/,&amp;amp;&lt;BR /&gt; /,' NUMBER OF PARAMETERS: ',I3,'   MAXIMAZATION: ',L5,&amp;amp;&lt;BR /&gt; /,' INITIAL TEMP: ', G8.2, '   RT: ',G8.2, '   EPS: ',G8.2,&amp;amp;&lt;BR /&gt; /,' NS: ',I3, '   NT: ',I2, '   NEPS: ',I2,&amp;amp;&lt;BR /&gt; /,' MAXEVL: ',I10, '   IPRINT: ',I1, '   ISEED1: ',I4,&amp;amp;&lt;BR /&gt; '   ISEED2: ',I4)&lt;BR /&gt;1001     FORMAT(/,' OPTIMAL FUNCTION VALUE: ',G20.13&amp;amp;&lt;BR /&gt; /,' NUMBER OF FUNCTION EVALUATIONS:     ',I10,&amp;amp;&lt;BR /&gt; /,' NUMBER OF ACCEPTED EVALUATIONS:     ',I10,&amp;amp;&lt;BR /&gt; /,' NUMBER OF OUT OF BOUND EVALUATIONS: ',I10,&amp;amp;&lt;BR /&gt; /,' FINAL TEMP: ', G20.13,'  IER: ', I3)&lt;BR /&gt; WRITE(6,'(I5,X)', ADVANCE='no')CL_INT1&lt;BR /&gt; WRITE(6,'(I5,X)', ADVANCE='no')CL_INT2&lt;BR /&gt; WRITE(6,'(A)')''&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;These WRITE(6) statements never get written, and if the fortran is executed from inside the perl I never even hear the error message - it just hangs and when I kill it a.out is still running in the background doing nothing! It just sits! If I take it out on it's own and run it, I get this:&lt;BR /&gt;&lt;BR /&gt;forrtl: severe (174): SIGSEGV, segmentation fault occurred&lt;BR /&gt;Image              PC                Routine            Line        Source             &lt;BR /&gt;libc.so.6          00007FF84A607E5D  Unknown               Unknown  Unknown&lt;BR /&gt;libc.so.6          00007FF84A60A4C9  Unknown               Unknown  Unknown&lt;BR /&gt;libc.so.6          00007FF84A60C7EE  Unknown               Unknown  Unknown&lt;BR /&gt;libc.so.6          00007FF84A6648E5  Unknown               Unknown  Unknown&lt;BR /&gt;a.out              000000000044F387  Unknown               Unknown  Unknown&lt;BR /&gt;a.out              000000000041F385  Unknown               Unknown  Unknown&lt;BR /&gt;a.out              000000000043B537  Unknown               Unknown  Unknown&lt;BR /&gt;a.out              0000000000408047  Unknown               Unknown  Unknown&lt;BR /&gt;a.out              000000000040396C  Unknown               Unknown  Unknown&lt;BR /&gt;libc.so.6          00007FF84A5B0ABD  Unknown               Unknown  Unknown&lt;BR /&gt;a.out              0000000000403869  Unknown               Unknown  Unknown&lt;BR /&gt;&lt;BR /&gt;I have NO IDEA why this is happening, and all my usual tricks to find where Fortran is unhappy are failing. And this shouldn't be using THAT much memory. The only big thing is the output from the subroutine 'SA' which will happily write a thousand megabyte log file. I don't know if this is related, it hadn't been a problem so far.&lt;BR /&gt;</description>
      <pubDate>Thu, 05 Nov 2009 23:36:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Segfault-on-stdout-OR-terminal-output-WRITE-6/m-p/740864#M598</guid>
      <dc:creator>etmeyer</dc:creator>
      <dc:date>2009-11-05T23:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: Segfault on stdout OR terminal output WRITE(6,*) ??</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Segfault-on-stdout-OR-terminal-output-WRITE-6/m-p/740865#M599</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
Did you try the methods in this article:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://software.intel.com/en-us/articles/determining-root-cause-of-sigsegv-or-sigbus-errors/"&gt;http://software.intel.com/en-us/articles/determining-root-cause-of-sigsegv-or-sigbus-errors/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Keep in mind that WRITE statements are buffered, so often times an application can fault out before the output buffers are flushed. You can try using FLUSH to halt the program and force the flush before proceeding, but typically the -g -traceback mentioned in the above article is more effective.&lt;BR /&gt;&lt;BR /&gt;ron&lt;BR /&gt;</description>
      <pubDate>Fri, 06 Nov 2009 00:00:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Segfault-on-stdout-OR-terminal-output-WRITE-6/m-p/740865#M599</guid>
      <dc:creator>Ron_Green</dc:creator>
      <dc:date>2009-11-06T00:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: Segfault on stdout OR terminal output WRITE(6,*) ??</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Segfault-on-stdout-OR-terminal-output-WRITE-6/m-p/740866#M600</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/160574"&gt;Ronald W. Green (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; Did you try the methods in this article:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://software.intel.com/en-us/articles/determining-root-cause-of-sigsegv-or-sigbus-errors/"&gt;http://software.intel.com/en-us/articles/determining-root-cause-of-sigsegv-or-sigbus-errors/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Keep in mind that WRITE statements are buffered, so often times an application can fault out before the output buffers are flushed. You can try using FLUSH to halt the program and force the flush before proceeding, but typically the -g -traceback mentioned in the above article is more effective.&lt;BR /&gt;&lt;BR /&gt;ron&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Well, I'm embarassed to say I did not know of the -check bounds option... maybe I should invest some time in reading up on the intel compiler since I am new to it, that solved the issue! The main problem, I suppose, was that the seg fault was not showing up anywhere near to where the problem actually occured. I appreciate the push in the right direction!&lt;BR /&gt;</description>
      <pubDate>Fri, 06 Nov 2009 00:50:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Segfault-on-stdout-OR-terminal-output-WRITE-6/m-p/740866#M600</guid>
      <dc:creator>etmeyer</dc:creator>
      <dc:date>2009-11-06T00:50:13Z</dc:date>
    </item>
  </channel>
</rss>

