For Programmers: Free Programming Magazines  


Home > Archive > Fortran > December 2004 > Access Violation









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Access Violation
Nitesh

2004-12-15, 3:59 pm

Hi,

I am using a set fortran subroutines which does some mechanical
computations. In one of the subroutines, I have declared some arrays
of pretty huge size.

I am successful in compiling this code. But when i execute it, the
program crashes.

When I use the debugger, at one particular line, I get "Access
Violation" error and the program stops.

When I used a breakpoint to exactly locate the error, then I found
that some part of an array variable had undefined address location.

For example, my program would look like this,
.....
DIMENSION A(100)
.....
DO N=1,100
.....
TEMP = A(N)
.....
.....
END DO
.....

The loop runs from N = 1 to 50, but later stops saying "Access
Violation".
When I used the watch window to check the values of that array
variable, I got the following results:
for N = 1 to 50 I got some defined values for A.
for N = 50 to 60 I got undefined address.
for N = 60 to 100 I got some defined values again(in this case zeros).
Here only some part of the array is giving "Access Violation" error.

Please can anyone give me some solution to overcome this error.

I am using Compaq Visual Fortran 6.6a on Windows.

Thanks & regards in advance,

Nitesh K PATIL
Michel OLAGNON

2004-12-15, 3:59 pm


In article <2a0aa2c6.0412150655.77499d19@posting.google.com>, niteshkpatil@rediffmail.com (Nitesh) writes:
>Hi,
>
>I am using a set fortran subroutines which does some mechanical
>computations. In one of the subroutines, I have declared some arrays
>of pretty huge size.
>
>I am successful in compiling this code. But when i execute it, the
>program crashes.
>
>When I use the debugger, at one particular line, I get "Access
>Violation" error and the program stops.
>
>When I used a breakpoint to exactly locate the error, then I found
>that some part of an array variable had undefined address location.
>
>For example, my program would look like this,
> .....
>DIMENSION A(100)
> .....
>DO N=1,100
> .....
> TEMP = A(N)
> .....
> .....
>END DO
> .....
>
>The loop runs from N = 1 to 50, but later stops saying "Access
>Violation".
>When I used the watch window to check the values of that array
>variable, I got the following results:
>for N = 1 to 50 I got some defined values for A.
>for N = 50 to 60 I got undefined address.
>for N = 60 to 100 I got some defined values again(in this case zeros).
>Here only some part of the array is giving "Access Violation" error.
>
>Please can anyone give me some solution to overcome this error.
>
>I am using Compaq Visual Fortran 6.6a on Windows.
>
>Thanks & regards in advance,
>
>Nitesh K PATIL


Are you sure that A is not an argument to the subroutine, in which
case the dimension A(100) statement is useless if A was declared of size 50
in the calling program ?



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com