PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Course

runtime error

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
kuldeep gupta



Joined: 11 Oct 2011
Posts: 41

PostPosted: Thu Mar 01, 2012 10:39 pm    Post subject: runtime error Reply with quote

this is my program

Code:
program cpf
implicit none
integer n,m,b,k,D1,i,j,r,a,p,p1
complex, dimension(2,2) :: Y
real ,dimension(2,2) :: Yabs,angle
real ,dimension(D1,1) :: deltaAp,deltaAc
real, dimension(1,2) :: V,d
real, dimension(:,:) :: dia1
real v2,d2,Lm,it,g,pp0,qq0
v2=1.004
d2=0.013
Lm=0
it=0
g=1
n=2
m=0
D1=2*n-2-m+1
b=10
pp0=0.1
qq0=0
k=1
r=10
a=10
p=0
p1=0
Y(1,1)=(0,-10)
Y(1,2)=(0,10)
Y(2,1)=(0,10)
Y(2,2)=(0,-10)
Yabs=abs(Y)
angle=atan2(aimag(Y),real(Y))


do i=1,D1
deltaAp(i,1)=0
deltaAc(i,1)=1
end do

end program cpf


it is running successfully but after sometime a message comes
___.exe file has stopped working..

reason is 0xC0000374: A heap has been corrupted.

where the problem is??
Back to top
View user's profile
mecej4



Joined: 19 Jun 2011
Posts: 62

PostPosted: Fri Mar 02, 2012 5:19 am    Post subject: Compiler Bug Reply with quote

The program is illegal and the compiler should have refused to produce an executable from it. The behavior of the resulting program is undefined.

Line 6 uses an uninitialized integer D1 as a dimension in an array declaration. An integer constant is acceptable here in a main program; an integer variable here, let alone one with no value specified, is not legal.

That the program ran for an appreciable length of time, given the insignificantly small amount of computing intended, is also a sign of a major bug in the program.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group