- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I obtain with Intel Visual Fortran Composer XE 2011 Integration for Microsoft Visual Studio* 2010, 12.0.3470.2010, VS 2010, on my Windows 64 machine a:
"Debug Assertion Failed!
Program: *
File: **\\winsig.c
Line: 417
Expression("Invalid signal error",0)
blahblahblah....
"
and a stack overflow, trying to Debug || Run in release the following code:
but if instead i do :
everything is ok.
I guess that this is due to a stack limitation and that i'm doing something very stupid...but what exactly ???
"Debug Assertion Failed!
Program: *
File: **\\winsig.c
Line: 417
Expression("Invalid signal error",0)
blahblahblah....
"
and a stack overflow, trying to Debug || Run in release the following code:
[fortran]PROGRAM PointTest implicit none real,pointer,dimension(:,:,:) :: pa,pb real,target,allocatable,dimension(:,:,:) :: a,b allocate(a(80,80,42),b(80,80,42)) a=0.0 b=1.0 pa=>a(1:78,1:80,1:42) pb=>b(1:78,1:80,1:42) pa=pb ! <-- At this point the problem appears write(*,*) "Hey" END PROGRAM PointTest[/fortran]
but if instead i do :
[fortran]pa=>a(1:76,1:80,1:42) pb=>b(1:76,1:80,1:42) [/fortran]
everything is ok.
I guess that this is due to a stack limitation and that i'm doing something very stupid...but what exactly ???
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Stack overflow, yes. I'm not sure why such a large stack temp is created, but... Two ways of fixing this. 1) in the project properties , Linker, System, set "Stack reserve size" to a larger value than the default 1 million. Start with 100000000 and rebuild. 2) Set Fortran > Optimization > Heap arrays to 0 and rebuild.
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Stack overflow, yes. I'm not sure why such a large stack temp is created, but... Two ways of fixing this. 1) in the project properties , Linker, System, set "Stack reserve size" to a larger value than the default 1 million. Start with 100000000 and rebuild. 2) Set Fortran > Optimization > Heap arrays to 0 and rebuild.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Many thanks for that, it did the trick.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, now I did the math. The array slice is about 4MB and the compiler chose to create a temp for it before assigning. As I noted earler, the linker defaults to a measly 1MB of stack.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page