Stack overflow query

Stack overflow query

I am developing a DLL for which I have a test program that is used to call and debug the DLL code.
I have run through all the main routines OK so far, debugging as I go, but I have come across a set of data that has resulted in a stack overflow. I use allocated arrays, but they are not enormous in size. When the debugger breaks, the cursor points to a specification statement for two of the allocatable arrays.

Is it likely that the stack overflow is related to array allocation and how can I avoid the problem?

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

I might expect a stack overflow for an automatic array - a local array whose bounds are determined by a dummy argument, COMMON variable or use/host associated variable, but not for an allocatable. Is there perhaps another array being declared on that line?

Try setting the Fortran project property Optimization > Heap Arrays to 0.

Steve - Intel Developer Support

Which project hould have Heap Arrays set? The program that loads and accesses the DLL, or the DLL itself?

The project with the Fortran code getting the stack overflow - that would probably be the DLL project. I will note that if you want instead to raise the linker's stack size, that has to be in the executable project, not the DLL.

Steve - Intel Developer Support

I am testing this code using CVF. For the executable project properties, I found and changed the Link...Output stack reserve and commit values to large values (Commit< reserve) and the stack overflow has disappeared - possibly only temporarily.

I guess when I go to my IVF version I could try heap:arrays option, which appears not to be available with the DevStudio/CVF combination.

Thanks.

Right - CVF doesn't have the Heap Arrays option.

Steve - Intel Developer Support

Lascia un commento

Eseguire l'accesso per aggiungere un commento. Non siete membri? Iscriviti oggi