🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Stack Overflow! -- turbo c++ 1.0

#5032
From: Paul T. Shannon
Date: Tue, 05 Mar 1991 21:24
30 lines
1756 bytes
I have a turbo c++ bug that perhaps some one has seen before.  I suspect
that this is a bug in the compiler (borland's c++ version 1.0).

I've developed a small class that does ega animation by storing images in
expanded memory, and retrieving them on demand.  This code works great
when all of the source code is in one file.  All possible error checking
is on, at both compile- and run-time.   I've exercised this a lot. 
For simplicity, let's call this file class.cpp.

In preparation for using this class with a larger c++ program, I decided
to test the new class by calling it out of a very small separate main
program (call it main.cpp).  The class header is included, and maybe 40
lines of code were moved from class.cpp to main.cpp.   

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
Technical Details
Message-ID: <1991Mar5.212434.2829@murdoch.acc.Virginia.EDU>
Path: arc1-ca.pugleaf.net!utzoo!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!wuarchive!udel!haven!uvaarpa!murdoch!usenet

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!wuarchive!udel!haven!uvaarpa!murdoch!usenet
From: pts@faraday.clas.Virginia.EDU (Paul T. Shannon)
Newsgroups: comp.os.msdos.programmer
Subject: Stack Overflow!  -- turbo c++ 1.0
Message-ID: <1991Mar5.212434.2829@murdoch.acc.Virginia.EDU>
Date: 5 Mar 91 21:24:34 GMT
Sender: usenet@murdoch.acc.Virginia.EDU
Organization: University of Virginia
Lines: 30