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

Program crash at the end of function

mtrover
Beginner
798 Views
I have a console program that consists of a loop which processes files. Each file is processed the same way. The program goes through the loop once, just fine. On the second pass with the second file it quits in the middle of the loop. In release mode there is no error--it just stops. In debug mode I have tracked it to the end of one function. The processing in thefunction appears to proceed just fine, but at the very end when it is returning I get a pointer exception. The function is an integer function, basically returning an error value. I'm not real familiar with exceptions so I don't know how to coax information out of the system. The exception occurs at line 1132 of dbgheap.c.
All of the subroutines are in modules with corresponding use statements, so all the interfaces are explicit. This program was brought to Intel Fortran 8.0.2225.2003 (This is v 8.0.50 I thought, was downloaded from Intel) from CVF 6.6C. The only pointer worth mentioning at this time is the return pointer.
Any ideas on what could cause this behavior?
MikeT
0 Kudos
1 Reply
Jugoslav_Dujic
Valued Contributor II
798 Views
In debug mode I have tracked it to the end of one function. The processing in thefunction appears to proceed just fine, but at the very end when it is returning I get a pointer exception. The function is an integer function, basically returning an error value.
...
The only pointer worth mentioning at this time is the return pointer.
Hmm, well what is it at the end -- an INTEGER function or INTEGER, POINTER function?
The symptoms indicate that the error occurs either
- at the assignment itself
- on an attempt to automatically DEALLOCATE a localallocatable array within the function
- that the stack is corrupted and stack-pointer is notcorrectly saved.
But you should really post some source code to give us an idea. You could also get a bit more insight by debugging it in assembly view -- place a breakpoint at RETURN or END statement, and when it's hit, switch to "Disssembly view" (Alt+8) where you should see something like:

end function

0040114D ffree st(0)

0040114F pop ebx

00401150 mov esp,ebp

00401152 pop ebp

00401153 ret 10h

Then, step by step (F10) -- does it reach "ret" statement or crashes earlier?
IVF still has some bugs in area of pointers (not that your situation resembles any that I know of) -- consider submitting the sample code to Premier Support.
Jugoslav

Message Edited by JugoslavDujic on 06-14-2004 04:58 PM

0 Kudos
Reply