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

sporadic access violation error

bmbarber
Beginner
734 Views
I have written a short program to manage data that runs fine the first time. The second time I run the executable, I get the following error message:

forrtl: severe (157): Program Exception - access violation
Image PC Routine Line Source
temp.exe 0040103C Unknown Unknown Unknown
temp.exe 00449891 Unknown Unknown Unknown
temp.exe 0043C328 Unknown Unknown Unknown
kernel32.dll 7C816FD7 Unknown Unknown Unknown

If I copy the executable to a different file name, the new executable seems to work fine for the first time too.

I am a researcher that is a self-taught programmer and use fortran primarily for data management and manipulation of large datafiles, so I'm hoping there is an easy fix that I am not aware of... (I have checked array dimensions and all seems to be fine and the program runs fine -- but only once...)

0 Kudos
4 Replies
Steven_L_Intel1
Employee
734 Views
I would suspect an antivirus tool or some other background task. Try this. Reboot the PC into Safe Mode (F8 during the initial Windows boot screen) and then try running your program multiple times. If it then works, you have some detective work to do to figure out which of the background tasks that normally run is interfering with your program.

I don't see any way that it could be the compiler.
0 Kudos
bmbarber
Beginner
734 Views
Thanks much for the quick reply. I'll give this a try over the weekend and let you know how things go.
0 Kudos
greldak
Beginner
734 Views
Also check you don't have the datafile open in an editor at the same time - or that you don't have an instance of your program still running in the background (or a process spawned by it) that hasn't closed down properly
0 Kudos
grg99
Beginner
734 Views
First thing, turn on the /traceback and all the debugging options, at least then the error message will point you to the line with the problem.

Next check all your variables to make sure they're initialized to some value. Programs that run once and then don't the next time often have this problem.

Also make sure the first program has completely quit before you try running it again.

Also make sure your program closes all its input and output files (if any) at program end. That is, don't just do a "STOP" or "END",

Also if you open any files, use the END = and ERR = options so you can capture any missing file or read past end of file errors.



0 Kudos
Reply