- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Everyone,
I got stack overflow error. It is on subroutine entry. How to expand the size of stack?
Thank
I got stack overflow error. It is on subroutine entry. How to expand the size of stack?
Thank
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is not a reply to your question. Just some additional observations. I have encountered the error that you are talking about several times. It was always happening when I was passing faily big sized arrays as the arguments to a subroutine. The thing that puzzles me is that I was always under the impression that all the arguments are passed by reference in fortran (by default). So, when you are passing an array to a subroutine, only one address pointer must have been passed around which could not possibly overflow the stack. So, what is the reason for overflowing the stack.
Ali Asi
asi@enginia.com
Ali Asi
asi@enginia.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You probably have an array temporary created on subroutine entry due to the way you're making the call. You can increase the size of the stack, but a larger array may one day exceed that too. Or you can change the way you make the call and avoid the creation of the array temporary. I'd choose the latter.
hth,
JT
Links:
In the online docs
Setting the stack size with the /stack linker switch
Changing the stack size with the editbin tool
Passing arrays:
Newsletter 1, Chris Bord's article 'PASSING ARRAYS IN FORTRAN 90'
In the online docs, under Programmer's Guide | Performance: Making Programs Run Faster | Use Arrays Efficiently | Passing Array Arguments Efficiently
hth,
JT
Links:
In the online docs
Setting the stack size with the /stack linker switch
Changing the stack size with the editbin tool
Passing arrays:
Newsletter 1, Chris Bord's article 'PASSING ARRAYS IN FORTRAN 90'
In the online docs, under Programmer's Guide | Performance: Making Programs Run Faster | Use Arrays Efficiently | Passing Array Arguments Efficiently
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank a lot,
I almost use allocatable and pointer in my routine, and deallocate when it not used.
With same problem, stack overflow does not occur if I compiled with LF95. It means stack size of CVF too small?
I almost use allocatable and pointer in my routine, and deallocate when it not used.
With same problem, stack overflow does not occur if I compiled with LF95. It means stack size of CVF too small?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Toppo,
If you'd like a specific diagnosis of the problem, you should probably post the version of CVF you're using, and enough code to let someone point out anything that may help (this should include the subroutine declaration and the declaration of all dummy variables, local variables, and the actual args passed in.)
-JT
If you'd like a specific diagnosis of the problem, you should probably post the version of CVF you're using, and enough code to let someone point out anything that may help (this should include the subroutine declaration and the declaration of all dummy variables, local variables, and the actual args passed in.)
-JT
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