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



Anndy wrote:
On Oct 31, 3:31 pm, glen herrmannsfeldt <g...@xxxxxxxxxxxxxxxx> wrote:
Anndy wrote:
On Oct 31, 12:47 pm, "Colin Watters"
<qolin.see_signat...@xxxxxxxxxxxxx> wrote:
"Anndy" <see.n...@xxxxxxxxx> wrote
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.
It could just be that the stack is too small.


I tried with increasing the stack size in compiler options, but
problem remains the same.

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.
You mean 4 bytes each call, that doesn't go away when it returns?
In other words, a memory leak?


Yes, This same thing I tried by creating a small application where i
am calling
a fortran subroutine from C++. In this sample I have not written any
code and subroutine
takes no argument. Here also i am seeing this leak.

Can you post the code in your small application?

If you have a memory leak and your subroutine has no arguments, then my theory about strlen() is indeed complete nonsense.

Louis
.



Relevant Pages

  • Re: Fortran based MEX w/ COMMON/SAVE
    ... I believe dat (pointer to the array) and the ... SAVE at the begining of each subroutine is a bit unusual to me. ... > to unload it if there isn't a Fortran END or STOP statement. ... interaction w/ Matlab). ...
    (comp.soft-sys.matlab)
  • Re: Help Constructing Fictional Cross-Religious Movement
    ... You know how to do something in Fortran that I ... >don't know how to do despite being pretty familiar with it, COBOL ... > subroutine point ... >was finding a programming problem that seemed reasonably amenable to ...
    (rec.arts.sf.composition)
  • Re: Callbacks - Delphi and CVF
    ... | I have a FORTRAN DLL that does the computations and takes about hours ... | want to be able to access the callback functions address from every ... | subroutine in the fortran dll. ... SUBROUTINE ReportProgress ...
    (comp.lang.fortran)
  • Re: Callbacks - Delphi and CVF
    ... | I have a FORTRAN DLL that does the computations and takes about hours ... | want to be able to access the callback functions address from every ... | subroutine in the fortran dll. ... SUBROUTINE ReportProgress ...
    (comp.lang.fortran)
  • Re: Help Constructing Fictional Cross-Religious Movement
    ... Given that this is something that I'd really like to know how to do in Fortran -- and, while Fortran 2003 has objects, there are as yet no ... Consider the following subroutine, which defines what amounts to a ... entry getpoints ... was finding a programming problem that seemed reasonably amenable to object-oriented programming, and that I wanted to write starting from a blank slate. ...
    (rec.arts.sf.composition)