Re: Stack corruption and memory leak problems in c++/Fortran application



On Oct 31, 4:32 pm, LR <lr...@xxxxxxxxxxxxx> wrote:
Anndy wrote:
Hello Folks,

I am facing problem in a Porting project(HP-Unix->Windows XP(64 bit))
where there are lots of C++->Fortran and Fortran->C++ calls.

There are some thousands of files including FORTRAN and C++ code.
After performing few operation which involves lot of FORTRAN->C++ and C
++->FORTRAN calling, application gives stack overflow error or behaves
unexpectedly.

Is it possible that you have a recursive routine that isn't behaving well?


I am not sure that 100% i don't have any recursive calls in my
application.
but there is a very least possibility of having recursive calls in it.

I been debugging this code from last 6 months. in this time i have
never seen any recursive calls in it.



one more thing which i have noticed is, whenever i am making a call to
a FORTRAN function there is a increase in
application memory by 4Bytes.

On the stack? Do you suspect this change signifies something? What?



compiler c++ : MS Visual Studio 2005 / Compiling for 64 bit
compiler FORTRAN :Intel Fortran Compiler 9.1

Some environment specific advice. Have you tried building a debug
version and seeing what the call stack looks like when the app crashes?


I tried with debug, when it crash each time it show me error on
different place and
there is nothing i see in call stack which can really help.

Can anyone please help in mentioning the possible problem areas ...

I'd like to reiterate glen herrmannsfeldt's advice that you verify that
you're calling with the parameters you think you're calling with.

LR


.



Relevant Pages

  • Re: Run-time check #4 from VC in VS2005
    ... > the stack, to allow the data to be passed by reference. ... Nine times out of ten the error results from a mismatch in calling ... Show that and the Fortran ...
    (microsoft.public.vc.language)
  • Re: Stack corruption and memory leak problems in c++/Fortran application
    ... There are some thousands of files including FORTRAN and C++ code. ... It could just be that the stack is too small. ... compiler FORTRAN:Intel Fortran Compiler 9.1 ... Calling between Fortran and C ...
    (comp.lang.fortran)
  • Tracing
    ... I have a VB control that is calling into a VC DLL and I need to debug the ... call stack and even trace through the VB code from within VC. ...
    (microsoft.public.vb.general.discussion)
  • Re: Need Help Debugging
    ... you should use straight and plain ADPlus.VBS from the debugger package. ... debug info loaded, etc... ... does that avoid using the stack ?!? ... which is our custom CRITICAL_SECTION class. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Ecos, LwIP, PPP and GPRS
    ... the modem has an IP stack built in. ... FTP is the most important right now. ... >>while printing the messages over another serial port. ... >Can you modify the debug output to go to a memory buffer instead of the ...
    (comp.arch.embedded)