[comp.sys.ibm.pc] Microsoft Compiler Stack Problem

remote02@paisano.UUCP (remote account #2) (11/05/87)

     We are developing a system using Microsoft 4.0 C and UNIFY DBMS. 
Occasionally, we get stack overflow messages.  We have corrected these by 
increasing the stack size using exemod.  It seems, however, that if we increase 
the stack size to a certain size it will also cause stack overflow errors.  
This size is less than the 64K stack size maximum documented in the 
Microsoft manual.  Can anyone explain Microsoft's 4.0 C stack usage and 
how to use it correctly? How is the /min option on exemod related?

Paul Charlton
ISN
10411 Motor City Drive
Bethesda, MD
301-469-0400

singer@XN.LL.MIT.EDU (Matthew R. Singer) (11/06/87)

In article <286@paisano.UUCP>, remote02@paisano.UUCP (remote account #2) writes:
> 
>      We are developing a system using Microsoft 4.0 C and UNIFY DBMS. 
> Occasionally, we get stack overflow messages.  We have corrected these by 
> increasing the stack size using exemod.  It seems, however, that if we increase 
> the stack size to a certain size it will also cause stack overflow errors.  
> This size is less than the 64K stack size maximum documented in the 
> Microsoft manual.  Can anyone explain Microsoft's 4.0 C stack usage and 
> how to use it correctly? How is the /min option on exemod related?
> 
> Paul Charlton
> ISN
> 10411 Motor City Drive
> Bethesda, MD
> 301-469-0400


This error occurs becuase by default the stack does not have its
own segment.  Even in the large model, the stack shares space unless
you use your own model. In the large memory model, the stack shares
space with initialized data.  In the small model, it shares space with
all bss data.