🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #1954

Re: Stack Size question

#1954
From: Bryan Donaldson
Date: Mon, 20 Aug 1990 18:09
44 lines
2503 bytes
prk@planet.bt.co.uk (Peter Knight) writes:
>hlison@bbn.com (Herb Lison) writes:
>>I'm having a problem allocating a larger stack than the default.  I've
>>got a large program, approximately 330 K for the .EXE file.  When I
>>increase the stack size from 2K to 8K with the EXEMOD utility, the
>>program immediately exits with a stack overflow error (R6000).  Running
>>the program with a smaller stack results in a stack overflow error later
>>on.  I've tried using overlays, but this doesn't seem to make any
>>difference.
>>Anyone have any ideas on what do here?  There's not much more code that
>>I can hack away and I'm not going to be able to use extended memory.
>>Thanks in advance.
>>Herb Lison
>You do not say which compiler and linker you are using, but for increasing 
>the stack size using of Microsoft compiled code, eg C v5.1, you can use 
>the link option /ST:XXXX where XXXX is the (hex) size of your desired
>stack.  If exemod doesn't work, it is likely that the version you are using
>is not compatible with the compiler and linker that you are using.
>Peter Knight 
>BT Research

Often, you'll have to add the additional option -Gt to move some of your
data items out of the default data segment.

Since the stack and default data usually occupy the same segment, 
sometimes when you expand the stack you'll get the message ,
"stack plus data exceeds 64K."  The way we found to get around
this is to use the -Gt switch, with a value of 16, 32, or 64; which
ever would move enough of the default data to another segment. 

(Basically we'd try values until they didn't produce the error anymore.)

Check to see if your linker is producing a message like to one above.
Ignoring this message will cause stack overflows and other odd
behaviour.

BGD


-- 
Bryan Donaldson                                             gatech!stiatl!bryan
Sales Technologies, Inc
3399 Peachtree Rd, NE
Atlanta, GA  (404) 841-4000
Technical Details
Message-ID: <10418@stiatl.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!wuarchive!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!stiatl!bryan
References: <14298@silica.BBN.COM> <prk.651138885@aries>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!wuarchive!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!stiatl!bryan
From: bryan@stiatl.UUCP (Bryan Donaldson)
Newsgroups: comp.os.msdos.programmer,alt.msdos.programmer
Subject: Re: Stack Size question
Message-ID: <10418@stiatl.UUCP>
Date: 20 Aug 90 18:09:22 GMT
References: <14298@silica.BBN.COM> <prk.651138885@aries>
Followup-To: comp.os.msdos.programmer
Distribution: comp, alt
Organization: Sales Technologies Inc.  Atlanta, Ga.
Lines: 44