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

access violation

wwendele
Beginner
638 Views
hi
when i execute my program i get a very weird problem. when I debug it, it seems that it reaches the end of a subroutine, but doesn't execute whatever's behind it.

...
call subroutine1
write(*,*) 'test'
...
subroutine subroutine1
...
end subroutine subroutine1

so the breakpoint at the "end subroutine" statement is reached, but it never reaches the "write" statement
the program stops with "forrtl: severe (157): program exception - access violation"
"stack trace terminated abnormally"

and

First-chance exception at 0x004e1b75 in fs_la_1d_eemission_nr.exe: 0xC0000005: Access violation reading location 0x00000000.
Unhandled exception at 0x00000006 in fs_la_1d_eemission_nr.exe: 0xC0000005: Access violation reading location 0x00000006.

Any help would be greatly appreciated
Thanks in advance
0 Kudos
3 Replies
Les_Neilson
Valued Contributor II
638 Views

The usual response to this sort of problem is that the problem lies elsewhere in the code (memory corruption)
(a) do you have array bounds checking switched on ?
(b) do you have "implicit none" in your code ?
(c) check for argument mismatches ?

Les

0 Kudos
wwendele
Beginner
638 Views
Thanks, I have included the implicit none statement and now it works.
0 Kudos
Les_Neilson
Valued Contributor II
638 Views

Well that on its own wouldn't fix the problem. What else did you change?

Les

0 Kudos
Reply