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

Stack overflow when calling a subroutine

turkeydodo
Beginner
2,062 Views

I got error message below when calling a subroutine

CALL COMPPR(MODEL,NUMEL,NUMNOD,MAP,AREA,C3,INDPER)

forrtl: severe (170): Program Exception - stack overflow

The subroutine is below

MODULE Interface_COMPPR

    INTERFACE

        SUBROUTINECOMPPR(MODEL,NE,NQ,NodeIndex,AREA,C,INDPER)

            IMPLICIT NONE

            !input variables

            INTEGERNE,NQ

            CHARACTER*1 MODEL

            INTEGER, POINTER:: NodeIndex(:,:)

            INTEGER, POINTER:: INDPER(:)

            REAL, POINTER:: AREA(:)

            !output variables

            REAL, POINTER:: C(:,:)

        END SUBROUTINE

    END INTERFACE

END MODULE

This issue is occured only when using x64 compiler. No error message when using win32 compiler.

Could you provide any clue on this issue? Thanks!

0 Kudos
4 Replies
turkeydodo
Beginner
2,062 Views

Appendix to this issue:

This error is only occured when using x64 complier. It passes when uing win32 compiler.

0 Kudos
Steven_L_Intel1
Employee
2,062 Views

Please provide a small but complete program that demonstrates the problem. You haven't shown the actual routine, by the way, just an interface block for it. Typically, if you have an interface block for a Fortran subroutine, other than what's needed for a generic declaration, you're doing it wrong.

0 Kudos
TimP
Honored Contributor III
2,062 Views

Does /check:arg_temp_created show anything?  If so, you would expect the point where you need to set stack higher (if not using /heap-arrays) to be different for Intel64 than for ia32.

If you already set stack parameters, you can expect to need larger ones for X64.

0 Kudos
turkeydodo
Beginner
2,062 Views

I got the reason. I forget add the link option of "/STACK:10000000" in x64. Thanks!

0 Kudos
Reply