<?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: forrtl: severe (157): Program Exception - access violation in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/forrtl-severe-157-Program-Exception-access-violation/m-p/904104#M81634</link>
    <description>&lt;P&gt;There are a number of reasons why you might get this error. Basically it means you're touching memory you're not allowed to.&lt;/P&gt;
&lt;P&gt;You could be writing into a constant parameter, you could be reading/writing outside of bounds, you could be accessing an uninitialized variable .... lots of things could cause this.&lt;/P&gt;
&lt;P&gt;Your first course of action should be to try running it under the debugger, to see where it's failing so you can get a clue. If it doesn't fail with debug, try setting /traceback. Oh, and even if you don't *want* to change the code, you should check for reading/writing out of bounds by setting /check:bounds.&lt;/P&gt;
&lt;P&gt;- Lorri&lt;/P&gt;</description>
    <pubDate>Thu, 14 Aug 2008 17:37:42 GMT</pubDate>
    <dc:creator>Lorri_M_Intel</dc:creator>
    <dc:date>2008-08-14T17:37:42Z</dc:date>
    <item>
      <title>forrtl: severe (157): Program Exception - access violation</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/forrtl-severe-157-Program-Exception-access-violation/m-p/904103#M81633</link>
      <description>Dear Fortran Forum,
&lt;BR /&gt;
&lt;BR /&gt;I'm getting the following error:
&lt;BR /&gt;
&lt;BR /&gt;forrtl: severe (157): Program Exception - access violation
&lt;BR /&gt;
&lt;BR /&gt;I've spent some time looking for a solution and it seems like this message means I'm reading outside an array or something similar.
&lt;BR /&gt;
&lt;BR /&gt;But I'm hesitant to change the code, as it compiles as-is under a bunch of other compilers (ifort on Mac OS X, plus Absoft (9.2 OS X; 8.2 Win) and GNU gfortran on OS X).
&lt;BR /&gt;
&lt;BR /&gt;So I think it is probably some compile options. I've tried to take the ifort OS X compile options and replicate on Windows, but I still get this 157 error.
&lt;BR /&gt;
&lt;BR /&gt;Should I post my build.bat file? Can anyone offer any suggestions?
&lt;BR /&gt;
&lt;BR /&gt;Thanks,
&lt;BR /&gt;
&lt;BR /&gt;   -k.
&lt;BR /&gt;
&lt;BR /&gt;</description>
      <pubDate>Thu, 14 Aug 2008 17:02:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/forrtl-severe-157-Program-Exception-access-violation/m-p/904103#M81633</guid>
      <dc:creator>mankoff</dc:creator>
      <dc:date>2008-08-14T17:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: forrtl: severe (157): Program Exception - access violation</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/forrtl-severe-157-Program-Exception-access-violation/m-p/904104#M81634</link>
      <description>&lt;P&gt;There are a number of reasons why you might get this error. Basically it means you're touching memory you're not allowed to.&lt;/P&gt;
&lt;P&gt;You could be writing into a constant parameter, you could be reading/writing outside of bounds, you could be accessing an uninitialized variable .... lots of things could cause this.&lt;/P&gt;
&lt;P&gt;Your first course of action should be to try running it under the debugger, to see where it's failing so you can get a clue. If it doesn't fail with debug, try setting /traceback. Oh, and even if you don't *want* to change the code, you should check for reading/writing out of bounds by setting /check:bounds.&lt;/P&gt;
&lt;P&gt;- Lorri&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2008 17:37:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/forrtl-severe-157-Program-Exception-access-violation/m-p/904104#M81634</guid>
      <dc:creator>Lorri_M_Intel</dc:creator>
      <dc:date>2008-08-14T17:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: forrtl: severe (157): Program Exception - access violation</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/forrtl-severe-157-Program-Exception-access-violation/m-p/904105#M81635</link>
      <description>Hi Lorri,
&lt;BR /&gt;
&lt;BR /&gt;/check:bounds gives an error, but one that I would like ignored... If I use /check:bounds this problem comes up, that I just posted about here:
&lt;BR /&gt;
&lt;BR /&gt;&lt;A href="http://software.intel.com/en-us/forums/showthread.php?t=60242#63863" target="_blank"&gt;http://software.intel.com/en-us/forums/showthread.php?t=60242#63863&lt;/A&gt;
&lt;BR /&gt;
&lt;BR /&gt;If I remove /check:bounds then the code gets farther, then runs into the 157 error.
&lt;BR /&gt;
&lt;BR /&gt;Still working on it...
&lt;BR /&gt;
&lt;BR /&gt;  -k.</description>
      <pubDate>Sat, 16 Aug 2008 22:51:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/forrtl-severe-157-Program-Exception-access-violation/m-p/904105#M81635</guid>
      <dc:creator>mankoff</dc:creator>
      <dc:date>2008-08-16T22:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: forrtl: severe (157): Program Exception - access violation</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/forrtl-severe-157-Program-Exception-access-violation/m-p/904106#M81636</link>
      <description>&lt;P&gt;It is unlikely that using a compiler option will fix the problem for you. See &lt;A href="http://software.intel.com/en-us/forums/topic/275071#comment-1548436"&gt;this article I wrote on access violation&lt;/A&gt; - it may help you.&lt;/P&gt;
&lt;P&gt;[Edit - link updated]&lt;/P&gt;</description>
      <pubDate>Sat, 16 Aug 2008 23:00:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/forrtl-severe-157-Program-Exception-access-violation/m-p/904106#M81636</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2008-08-16T23:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: forrtl: severe (157): Program Exception - access violation</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/forrtl-severe-157-Program-Exception-access-violation/m-p/904107#M81637</link>
      <description>&lt;P&gt;K,&lt;/P&gt;
&lt;P&gt;For the source file, compiled with /check:bounds,which generates the error if after walking the code and verifying the bounds violation is permissible (could be a bad assumption on your part) you can compile that source file without the /check:bounds, but leave the option on the other files. Work through this source file at at a time.&lt;/P&gt;
&lt;P&gt;Also, look at the address being referenced that produces the access violation.&lt;/P&gt;
&lt;P&gt;If the address is in the range of about 0 to 4K, or 0 to 4MB on x64 platform, then there is a high probability you are attempting to reference a deallocated array or dereference a NULL pointer to a structure. Looking in the Dissassembly window and viewing registers might confirm this.&lt;/P&gt;
&lt;P&gt;If the address is way up high (or negative on Windows system) then suspect that your code stomped on an array descriptor .OR. you are running multi-threaded and your code is creating a local (e.g. automatic) then passing the array descriptor to a different thread and exiting the subroutine prior to the other thread(s) finishing use of the array descriptor.&lt;/P&gt;
&lt;P&gt;Just because a program runs without crashing or blatently wrong output does not mean the program is running witout error. And one that could blow-up on you some day.&lt;/P&gt;
&lt;P&gt;Jim Dempsey&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Aug 2008 23:38:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/forrtl-severe-157-Program-Exception-access-violation/m-p/904107#M81637</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2008-08-16T23:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: forrtl: severe (157): Program Exception - access violation</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/forrtl-severe-157-Program-Exception-access-violation/m-p/904108#M81638</link>
      <description>Hi Steve,

I read your article. I'm still hoping this can be dealt with at the compiler level. I have hope because this code does compile with ifort on Mac OS X Intel and on Windows (with Absoft 8.2 and 9.0) and on Mac OS X PPC (Absoft 9.2) and Mac OS X Intel with gfortran.

Given all that, especially the ifort on OS X, I hope ifort on windows can handle it too.

   -Ken.</description>
      <pubDate>Sun, 17 Aug 2008 01:13:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/forrtl-severe-157-Program-Exception-access-violation/m-p/904108#M81638</guid>
      <dc:creator>mankoff</dc:creator>
      <dc:date>2008-08-17T01:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: forrtl: severe (157): Program Exception - access violation</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/forrtl-severe-157-Program-Exception-access-violation/m-p/904109#M81639</link>
      <description>Hi Jim,
&lt;BR /&gt;
&lt;BR /&gt;Thanks for your suggestions and information.
&lt;BR /&gt;
&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;IMG src="https://community.intel.com/file/6745" /&gt; &lt;STRONG&gt;JimDempseyAtTheCove:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;
&lt;BR /&gt;&lt;P&gt;For the source file, compiled with /check:bounds,which generates the error if after walking the code and verifying the bounds violation is permissible (could be a bad assumption on your part) you can compile that source file without the /check:bounds, but leave the option on the other files. Work through this source file at at a time.&lt;/P&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;
&lt;BR /&gt;I've changed the build script to compile each file to object and then link, so that I can have different options for different files as you suggest.
&lt;BR /&gt;
&lt;BR /&gt;I'm now stuck where one file stops on an obvious and purposeful out-of-bounds index:
&lt;BR /&gt;
&lt;BR /&gt;&lt;CODE&gt;
&lt;BR /&gt;      DO 206 N=1,NM8
&lt;BR /&gt;  206 KE(N,1)=0.
&lt;BR /&gt;&lt;/CODE&gt;
&lt;BR /&gt;
&lt;BR /&gt;if /check:bounds is used, and gives the 157 error if it is not used.
&lt;BR /&gt;
&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;IMG src="https://community.intel.com/file/6745" /&gt; &lt;STRONG&gt;JimDempseyAtTheCove:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;
&lt;BR /&gt;&lt;P&gt;Also, look at the address being referenced that produces the access violation.&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;If the address is in the range of about 0 to 4K, or 0 to 4MB on x64 platform, then there is a high probability you are attempting to reference a deallocated array or dereference a NULL pointer to a structure. Looking in the Dissassembly window and viewing registers might confirm this.&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;If the address is way up high (or negative on Windows system) then suspect that your code stomped on an array descriptor .OR. you are running multi-threaded and your code is creating a local (e.g. automatic) then passing the array descriptor to a different thread and exiting the subroutine prior to the other thread(s) finishing use of the array descriptor.&lt;/P&gt;
&lt;BR /&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;32 bit platform, non-multi-threaded, error is:
&lt;BR /&gt;
&lt;BR /&gt;&lt;CODE&gt;
&lt;BR /&gt;Z:GISSGCMmodelIIifortwin&amp;gt;.mwin.exe
&lt;BR /&gt;forrtl: severe (157): Program Exception - access violation
&lt;BR /&gt;Image              PC        Routine            Line        Source
&lt;BR /&gt;mwin.exe           005BBE19  Unknown               Unknown  Unknown
&lt;BR /&gt;&lt;/CODE&gt;
&lt;BR /&gt;
&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;IMG src="https://community.intel.com/file/6745" /&gt; &lt;STRONG&gt;JimDempseyAtTheCove:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;
&lt;BR /&gt;&lt;P&gt;Just because a program runs without crashing or blatently wrong output does not mean the program is running witout error. And one that could blow-up on you some day.&lt;/P&gt;
&lt;BR /&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;Ah. Yes... this code was originally written so that it intentionally exploited known compiler bugs. Most of those have been ironed out because those compilers don't exist anymore and we've gotten it running on other platforms and compilers, but I can never be totally sure.
&lt;BR /&gt;
&lt;BR /&gt;It has errors and bugs (as all code does). But at 10k+ lines I'm not worrying about them right now, I'm just trying to get it to compile. Then I'll validate outputs against baseline compiles on other platforms.
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;Finally, I'm trying to run this in the debugger, but it is less than helpful:
&lt;BR /&gt;&lt;CODE&gt;
&lt;BR /&gt;(idb) run
&lt;BR /&gt;Starting program...
&lt;BR /&gt;Thread generated exception: Access Violation
&lt;BR /&gt;
&lt;BR /&gt;(idb) frame
&lt;BR /&gt;#0 0x005bbe19
&lt;BR /&gt;(idb) info source
&lt;BR /&gt;Current source file is unknown
&lt;BR /&gt;(idb) info line
&lt;BR /&gt;No so
urce file named.
&lt;BR /&gt;&lt;/CODE&gt;
&lt;BR /&gt;
&lt;BR /&gt;I'm running it in the directory with all the source and object files. I'm familiar with basic gdb but not with this idb.
&lt;BR /&gt;
&lt;BR /&gt;Thanks for any more help you might have,
&lt;BR /&gt;   
&lt;BR /&gt;    Ken Mankoff</description>
      <pubDate>Sun, 17 Aug 2008 01:30:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/forrtl-severe-157-Program-Exception-access-violation/m-p/904109#M81639</guid>
      <dc:creator>mankoff</dc:creator>
      <dc:date>2008-08-17T01:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: forrtl: severe (157): Program Exception - access violation</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/forrtl-severe-157-Program-Exception-access-violation/m-p/904110#M81640</link>
      <description>Compile and link with traceback enabled is often helpful on Windows. I don't think there is any effort to facilitate debugging under mwin. &lt;BR /&gt;As you appear to have an intentionally intractable source code, you might make the effort to compile and run debug mode (/Zi), both with optimization off (default for /Zi) and on.&lt;BR /&gt;</description>
      <pubDate>Sun, 17 Aug 2008 06:58:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/forrtl-severe-157-Program-Exception-access-violation/m-p/904110#M81640</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2008-08-17T06:58:54Z</dc:date>
    </item>
    <item>
      <title>Re: forrtl: severe (157): Program Exception - access violation</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/forrtl-severe-157-Program-Exception-access-violation/m-p/904111#M81641</link>
      <description>&lt;P&gt;Ken,&lt;/P&gt;
&lt;P&gt;As a quick hack to work around the problem insert diagnostic code to find out the largest value of NM8 used on statement&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;DO 206 N=1,NM8 &lt;/FONT&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;e.g.&lt;/P&gt;
&lt;P&gt;integer, save :: LargestNM8 = 0&lt;BR /&gt;...&lt;BR /&gt;if(NM8 .gt. LargestNM8) then&lt;BR /&gt;LargestNM8 = NM8&lt;BR /&gt;write(*,*) NM8&lt;BR /&gt;endif&lt;BR /&gt;do 206 N=1,NM8&lt;BR /&gt;...&lt;/P&gt;
&lt;P&gt;When you find the largest value, if that does not shed light on anything, then the hack is to allocate KE(:,:) or declare it, such that it is large enough to accomidate the 0's. &lt;/P&gt;
&lt;P&gt;Also, if this introduces other problems in code execution prior to the former bounds error, then this indicates the KE array may by design, overlay something else that needs to be referenced alternately as KE(n,m) and by that something else.&lt;/P&gt;
&lt;P&gt;The hunt is on.... good luck.&lt;/P&gt;
&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Mon, 18 Aug 2008 20:19:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/forrtl-severe-157-Program-Exception-access-violation/m-p/904111#M81641</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2008-08-18T20:19:03Z</dc:date>
    </item>
  </channel>
</rss>

