Stack overflow and memory allocation error

Stack overflow and memory allocation error

I’ve recently started working with a f77 source code which comes with 11 subroutines. This code is pretty old and others who have used this code in the past say that it worked perfectly when using Compaq Visual Fortran to compile it. Now we’ve switched to VS2012 Fortran compiler and I get a number of errors when compiling and running the code.

To explain in details, I first got errors #8284, #6633 and #6634 for a couple of arrays in some of the subroutines and the source code. I looked this up in forums and used this fix: I set the property Diagnostics > Check Routine Interfaces to No. Then, I am able to build the solution and create the executable.

When I run the executable I get a stack overflow error. I tried solving this by changing some properties. For instance, I tried Heap Arrays option. This time I get a new run-time error. It complains of the allocated memory for a specific array inside the code. I also tried changing Stack Reserve Size but faced the same error again. I am sure that the allocated size for that array is more than enough but I cannot figure out why I still get this error.

I’d be thankful if someone could help me solve this problem.

4 post / 0 nuovi
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione

What is the exact error you are getting? Note that CVF didn't check for some coding errors that the newer compiler can. Also, Intel Fortran defaults to stack allocation for many things where CVF used static allocation.

Steve Intel Developer Support

Try the option /Qsave as a temporary solution to your problems.

Secondly, do not use any libraries that were built for CVF with code compiled by IFort -- not because this is impossible but it requires knowledge of how the two compilers work with respect to subroutine linkage to combine CVF compiled code with IVF compiled code..

 

Steve, Thank you very much for your help. Just to give an update, "the error message is not produced by Intel Visual Fortran - it is almost certainly coming from somewhere in my program" as you said. I was looking in the wrong place. The message is coming from the source code when it is checking for the size allocated to one specific array. I am looking into the input files and the code itself more precisely to resolve this.

Accedere per lasciare un commento.