Runtime error 170: "Stack overflow" - What's the cause and what should I do?

Runtime error 170: "Stack overflow" - What's the cause and what should I do?

In running one large Fortran application program I encountered the runtime error "Stack overflow". What could be the cause and what should I do to fix it? I'd appreciate all helpful comments/tips.

6 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Read this, then let us know if you have more questions.

Retired 12/31/2016

Thanks Steve. I am using Visual Fortran 11.1 with VS2008. The linker options related to stack is on the "system" sub menu, and then two choices: "Stack Reserve Size","Stack Commit Size", all default at 0. How big should I change to? (I an running pretty big problems - factorize a non-sparse matrix roughly 1 million by 1 million in double precision complex).

Stack Reserve Size is the value to look at. But let me suggest instead changing Fortran > Optimization > Heap Arrays to 0. This will enable the Heap Arrays feature.

But if you need a million by a million by double-precision-complex in a temporary, you're not going to get it, at least not on 32-bit Windows. Are you using 64-bit Windows? I hope the compiler isn't trying to create a 16TB temporary!

Retired 12/31/2016

Thanks Steve. Let me try your suggestions. I'll report back.

I am using xp64 with 12 core and 32 GB memory, 5x2 TB HD. The matrix is symmetric. I am using PARDISO's out-of-core option. I just hope the compiler and OS wouldn't have internal limits!

Ok -let us know how it works. With a problem size like that, use Heap Arrays and not the Stack Reserve, which is limited to 1GB no matter what,

The compiler does not have its own limits here.

Retired 12/31/2016

Leave a Comment

Please sign in to add a comment. Not a member? Join today