From: Mike on
Hi

according to
http://h21007.www2.hp.com/portal/site/dspp/PAGE.template/page.document?ciid=ca08d7c682f02110d7c682f02110275d6e10RCRD&jumpid=reg_R1002_USEN
My program gets the error "forrtl: severe: Program Exception - stack
overflow" 05-Jun-2000

/stack:n where n is the number of bytes (in decimal) you want for the
stack. In Developer Studio, select Project..Settings..Link and add the
option switch to the list of Project Options.

I set /stack:0xFFFFFFFF, which is the maximum value.
However, the compiled results still show "warning LNK4084: total image
size 1126330368 exceeds max (268435456); image may not run".
If I run it, "stack overflow" will be shown.
I use CVF6.6c in Windows XP.

Does anybody know why?

Mike

From: Tim Prince on
Mike wrote:

>
> I set /stack:0xFFFFFFFF, which is the maximum value.
> However, the compiled results still show "warning LNK4084: total image
> size 1126330368 exceeds max (268435456); image may not run".
> If I run it, "stack overflow" will be shown.
> I use CVF6.6c in Windows XP.
>
Your warning about total image size is only a reminder that things would
be worse in Windows 98. If your application actually is that large, it
could be a problem in XP-SP2.
The /stack option must be preceded by /link, or it will have no effect.
I have doubts about assigning your entire virtual space to stack.
Conceivably, the /3GB boot switch could help, if you haven't tried it,
along with setting a larger than default stack.
From: Mike on
On Oct 8, 2:10 pm, Tim Prince <timothypri...(a)sbcglobal.net> wrote:
> Mike wrote:
>
> > I set /stack:0xFFFFFFFF, which is the maximum value.
> > However, the compiled results still show "warning LNK4084: total image
> > size 1126330368 exceeds max (268435456); image may not run".
> > If I run it, "stack overflow" will be shown.
> > I use CVF6.6c in Windows XP.
>
> Your warning about total image size is only a reminder that things would
> be worse in Windows 98. If your application actually is that large, it
> could be a problem in XP-SP2.

I use XP-SP2.

> The /stack option must be preceded by /link, or it will have no effect.

No. I've added /link before /stack:0xFFFFFFFF, but CVF didn't
recognize "link".

> I have doubts about assigning your entire virtual space to stack.
> Conceivably, the /3GB boot switch could help, if you haven't tried it,
> along with setting a larger than default stack.


I've also tried /stack:1126330368, which will be changed into /stack:
0x43227000. And the same error message is shown.

I also use cygwin to compile the program.
In compling, there is no warning message.
But after running, it shows that memory is not enough.

Mike

From: Steve Lionel on
On Oct 8, 3:05 am, Mike <Sulfate...(a)gmail.com> wrote:

> > The /stack option must be preceded by /link, or it will have no effect.
>
> No. I've added /link before /stack:0xFFFFFFFF, but CVF didn't
> recognize "link".

/link tells the df command driver that everything following it is to
be passed to the linker. Therefore, it and the following switches
have to be at the end of the command line.

Steve

From: Louis Krupp on
Mike wrote:
> Hi
>
> according to
> http://h21007.www2.hp.com/portal/site/dspp/PAGE.template/page.document?ciid=ca08d7c682f02110d7c682f02110275d6e10RCRD&jumpid=reg_R1002_USEN
> My program gets the error "forrtl: severe: Program Exception - stack
> overflow" 05-Jun-2000
>
> /stack:n where n is the number of bytes (in decimal) you want for the
> stack. In Developer Studio, select Project..Settings..Link and add the
> option switch to the list of Project Options.
>
> I set /stack:0xFFFFFFFF, which is the maximum value.
> However, the compiled results still show "warning LNK4084: total image
> size 1126330368 exceeds max (268435456); image may not run".
> If I run it, "stack overflow" will be shown.
> I use CVF6.6c in Windows XP.
>
> Does anybody know why?

If you're successfully specifying the maximum stack size and your
program still gets a stack overflow, there might be a bug in your program.

If you have a function or subroutine that calls itself too many times,
you're likely to get a stack overflow. You might want to take another
look at your program. If you can do a debug build and get a stack trace
when the program fails, it might help you see where things go wrong.

Calling functions or subroutines that declare really big arrays can also
cause a stack overflow. If that's the problem, there are a couple of
possible solutions.

Louis