- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Has anyone else come across this problem? Valgrind can be quite useful, so it may be worth contributing some Fortran-specific enhancements that make it better able to deal with Intel Fortran code.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The recursive routines have one argument, an array. If I convert that array to an allocatable, I still have the stack overflow problem. If I allocate one large 2D allocatable in the main routine, the stack problem goes away, but I then have to pick a fixed recursion limit. Maybe this is because large allocations are from heap, and small ones are from the stack?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It would be nice if the debugger could detect stack overflows. That would have saved a lot of time. At least now I know to look for a stack overflow if a segfault is followed by strange behavior in IDB.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Would I be correct in assuming that your recursive subroutine's one argument isn't an array but it is a subset of an array? e.g. the outer most level passes the whole array, the next level passes a portion of the array, the next level a portion of the portion, etc...
Depending on how the array is declared and portioned out your routine may be creating stack temporaries as you slice up the array going into the recursion. A different layout or technique can often be implemented that eliminates the stack temporaries. There was (or is) supposed to be a option to generate warnings when array stack temporaries are created on call statements. Steve might be able to comment on this.
There is a runtime check for arg temp creation
/check:arg_temp_created
But a compile time warning option would be better IMHO.
Jim Dempsey

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page