Home > Archive > Fortran > June 2004 > Stack overflow
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
|
| A friend of mine gets "stack overflow" during runtime. We have tried to
debug the problem. The CVF6 arrow points at the variable definition of
an array.
Can you please tell me the source of this?
Thanks in advance!!
Regards,
Hĺkan Lane
| |
| Jan Vorbrüggen 2004-06-25, 7:43 pm |
| Go into Linker tab (IIRC) and increase the default stack size substantially
- for instance, by as least the size of the array he is allocating.
Jan
| |
| Arjen Markus 2004-06-25, 7:43 pm |
| Jan Vorbrüggen wrote:
>
> Go into Linker tab (IIRC) and increase the default stack size substantially
> - for instance, by as least the size of the array he is allocating.
>
> Jan
Alternatively:
if the array is an automatic array, like below:
subroutine aha( nelems )
real, dimension(1:nelems) :: array ! Automatic array depending on
problem size
real, dimension(1:100) :: array2 ! Automatic too, as far as I
understand, but
! it might be made static by
the compiler
end subroutine
then with a suitable value of the argument nelems, the program will give
a stack overflow.
Consider an explicit array allocation instead or pass the array as
an argument from the caller (ultimately from the main program).
Regards,
Arjen
| |
| Tim Prince 2004-06-25, 7:43 pm |
|
"Jan Vorbrüggen" <jvorbrueggen-not@mediasec.de> wrote in message
news:2jg3k2F111oifU1@uni-berlin.de...
> Go into Linker tab (IIRC) and increase the default stack size
substantially
> - for instance, by as least the size of the array he is allocating.
>
> Jan
The Windows command line version of this is to append
/link /stack:<big stack size, in bytes>
should work for all Windows compilers.
|
|
|
|
|