- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am developing a DLL for which I have a test program that is used to call and debug the DLL code.
I have run through all the main routines OK so far, debugging as I go, but I have come across a set of data that has resulted in a stack overflow. I use allocated arrays, but they are not enormous in size. When the debugger breaks, the cursor points to a specification statement for two of the allocatable arrays.
Is it likely that the stack overflow is related to array allocation and how can I avoid the problem?
I have run through all the main routines OK so far, debugging as I go, but I have come across a set of data that has resulted in a stack overflow. I use allocated arrays, but they are not enormous in size. When the debugger breaks, the cursor points to a specification statement for two of the allocatable arrays.
Is it likely that the stack overflow is related to array allocation and how can I avoid the problem?
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I might expect a stack overflow for an automatic array - a local array whose bounds are determined by a dummy argument, COMMON variable or use/host associated variable, but not for an allocatable. Is there perhaps another array being declared on that line?
Try setting the Fortran project property Optimization > Heap Arrays to 0.
Try setting the Fortran project property Optimization > Heap Arrays to 0.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Which project hould have Heap Arrays set? The program that loads and accesses the DLL, or the DLL itself?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The project with the Fortran code getting the stack overflow - that would probably be the DLL project. I will note that if you want instead to raise the linker's stack size, that has to be in the executable project, not the DLL.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am testing this code using CVF. For the executable project properties, I found and changed the Link...Output stack reserve and commit values to large values (Commit< reserve) and the stack overflow has disappeared - possibly only temporarily.
I guess when I go to my IVF version I could try heap:arrays option, which appears not to be available with the DevStudio/CVF combination.
Thanks.
I guess when I go to my IVF version I could try heap:arrays option, which appears not to be available with the DevStudio/CVF combination.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Right - CVF doesn't have the Heap Arrays option.
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