Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!ucsd!hub.ucsb.edu!ucsbuxa!6600m00n From: 6600m00n@ucsbuxa.ucsb.edu (Steelworker) Newsgroups: comp.os.msdos.programmer Subject: Re: Stack Overflow! tc++ Message-ID: <9673@hub.ucsb.edu> Date: 6 Mar 91 17:04:53 GMT References: <1991Mar6.135439.22464@murdoch.acc.Virginia.EDU> Sender: news@hub.ucsb.edu Lines: 33 In article <1991Mar6.135439.22464@murdoch.acc.Virginia.EDU> pts@faraday.clas.Virginia.EDU (Paul T. Shannon) writes: [description deleted . . .] :Now I find that as soon as the first call is made by main.cpp, to a member :function in class.cpp, the program aborts with the message : Stack Overflow! :I've checked for errors, I've tried many different memory models, I've :traced execution with td 2.0. All to no avail. :If however, I turn the stack checking off (from the compiler option menu), :the program runs fine....except that I'm really nervous about what sins :might be hidden behind the curtains. :Has anyone seen a bug like this? Any suggestions? : - Paul Shannon : pts@virginia.edu This just means that you have allocated more than the default amount of data available on the stack (4k?). If you declare large arrays on the stack, it can quickly fill up. Also, if you pass large structures to functions, that can use up a lot of your stack. The other possible problem ( does not seem to be your case) happens when a user function is called from an interrupt ( often used in mouse functions), and the stack is not in the state Turbo-c thinks it should be in. In general, you should leave stack checking on; otherwise, your programs will get untrackable bugs when you run out of stack. Good luck, Robert Blair