MSC STACK OVERFLOW

Walter Bright bright at Data-IO.COM
Thu Mar 17 05:39:31 AEST 1988


In article <12416 at brl-adm.ARPA> SWANGER%AUDUCVAX.BITNET at CUNYVM.CUNY.EDU writes:
<I am using MSC 5.0 to write a software package for my IBM PC clone.  I am
<having problems with stack overflow.  I've tried enlarging the stack with
<the /ST flag, but I'm approaching the 64k stack limit.  My code is only
<about 500 lines or so, but when I get about three functions deep, the
<program dies with a stack overflow message.
<Does anyone have
<any suggestions how I can get around this problem?  Is there a way to
<increase the stack size past 64k, or is this an Intel curse?

In MSC, the stack and static data share the same segment. In other words,
SS == DS in all memory models. This means that if you have a lot of statically
allocated data, you reduce the available space for the stack. Check your
.MAP file to see how much space is being used in DGROUP.

My suspicion, though, is that you have a pointer bug. Try reducing your
program to the smallest possible one that reproduces the problem. Try
codeview on it, paying special attention to the values of SP, SS and DS.

No way you can have a stack >64k, this is wired into the CPU hardware.



More information about the Comp.lang.c mailing list