For Programmers: Free Programming Magazines  


Home > Archive > Fortran > April 2007 > Intel fortran error (76) help









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 Intel fortran error (76) help
tomguest@hotmail.com

2007-04-18, 7:05 pm

Hi

I'm having a problem compiling my code using the linux intel fortran
compiler (version 9.1.040)
When I don't use the -g flag i get the following error message

*** glibc detected *** free(): invalid next size (normal):
0x0000000000588cf0 ***
forrtl: error (76): IOT trap signal

The error comes from the labelled line in the code section below.

The allocation works correctly as shown by the write statement at run
time.

I have tried compiling using the -g flag. When I do this I dont get
the error message.

Any help would be greatly welcomed

Tom



Code section

allocate (layers%Vtop(layers%num), stat=checkstat)
if (checkstat.gt.0) THEN
write(6,*) 'unable to allocate Vtop'
endif
allocate (layers%Vbottom(layers%num), stat=checkstat)
if (checkstat.gt.0) THEN
write(6,*) 'unable to allocate Vbottom'
endif
c
write(6,*) 'vtop',layers%Vtop,'bottom',layers%Vbott
om


do i=1,layers%num
write(6,*) 'enter velocity at top of layer',i
read(5,*) layers%Vtop(i) ------ERROR OCCURS AFTER
THIS LINE
write(6,*) 'enter velocity at bottom of layer',i
read(5,*) layers%Vbottom(i)
enddo

glen herrmannsfeldt

2007-04-18, 7:05 pm

tomguest@hotmail.com wrote:

> I'm having a problem compiling my code using the linux intel fortran
> compiler (version 9.1.040)
> When I don't use the -g flag i get the following error message


> *** glibc detected *** free(): invalid next size (normal):
> 0x0000000000588cf0 ***
> forrtl: error (76): IOT trap signal


> The error comes from the labelled line in the code section below.


In this case, the location given is usually not the cause of the
problem. The cause is overwriting the information used to keep
track of allocated memory. The effect usually happens the next time
memory is allocated or deallocated, in your case likely by the READ
statement.

Turn on array bounds checking, and hopefully it will find it.

Though I have recently found that gfortran doesn't check the lower
bound on (*) arrays, but g95 does.

-- glen

FX

2007-04-18, 7:05 pm

> Though I have recently found that gfortran doesn't check the lower
> bound on (*) arrays


Doh? Never checked that one, thanks for the tip. Will be fixed soon.

--
FX
Sponsored Links







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

Copyright 2008 codecomments.com