Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29246 Discussions

Allocated Array Reference Causes Crash without Write Statement???

yood
Beginner
432 Views
Hi, I have Intel Fortran Compiler 8.1 running on a 64-bit Itanium2 under Windows XP-64 version 2003. I have a Fortran program linking to a Fortran DLL. It all compiles and links fine. I can run the program, however when I try to set an element of a dynamically allocated array (real*8). It causes a crash: forrtl: severe (157): Program Exception - access violation Image PC Routine Line Source detailopt.exe 000000000040C134 Unknown Unknown Unknown detailopt.exe 0000000000404510 Unknown Unknown Unknown detailopt.exe 0000000000581CF0 Unknown Unknown Unknown detailopt.exe 000000000056B1E0 Unknown Unknown Unknown kernel32.dll 0000000077D24510 Unknown Unknown Unknown 32-bit versions of the same code work fine. I'm not sure if I'm compiling/linking these up correctly. I notice that the size of the 64-bit DLL is very small when compare with every other piece of Fortran code I've converted from 32-bit to 64-bit. I was able to come up come up with the following solution / even more perplexing situation. I have discovered that if I put a simple write statement like: write(6,'(/a)') ' here is the stat array ' immediately after allocation, then the allocatable array is fine and the program runs to completion. Without the write statement - crash/burn as soon as the allocatable array is referenced in any way. I'm thinking its some kind of boundary problem or some such thing. Is there any way to get around this and/or ensure this won't happen or should I just have a nice display and call it a feature? Any thoughts would be interesting. Thankx to all who viewed my query, Mark Link to my previous (and unanswered) query: 64-bit DLL linking question / problem ? http://softwareforums.intel.com/ids/board/message?board.id=5&message.id=16999
0 Kudos
0 Replies
Reply