From: Gary Leavens Newsgroups: comp.os.msdos.djgpp Subject: Re: Bohem-Demers-Weiser garbage collector (gc) with C++ under DJGPP Date: Fri, 06 Jun 1997 12:59:06 -0500 Organization: Department of Computer Science, Iowa State Univ. Lines: 38 Message-ID: <33984FEA.57ED@cs.iastate.edu> References: <33973FC7 DOT 67A6 AT cs DOT iastate DOT edu> <5n7mcb$26o_002 AT fmsc DOT com DOT au> NNTP-Posting-Host: larch.cs.iastate.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Peter Monks wrote: > > In article <33973FC7 DOT 67A6 AT cs DOT iastate DOT edu>, Gary Leavens wrote: > >What happens is that when I run C++ programs with the gc interface, > >I get messages like: > > > > Abort! > > STACK_GROWS_DOWN is defd, but stack appears to grow up > > sp = 0x198f48, GC_stackbottom = 0xc0174 > > stack direction = 3 > > I had the same problem with C programs that use the Boehm-Demers-Weiser gc. > The problem seems to be that the stack for a DJGPP program is not necessarily > located at the same place in memory each time the program is run, which is an > assumption the default gc makes. > > The gc documentation describes a way to get around this, though. Look in > readme.dj and config.h for details. > > Basically, you have to declare a dummy local variable in your main function, > and then point GC_stackbottom at it. After doing this, I had no problems with > the garbage collector's basic functionality. Thanks for the help. I tried this, but unfortunately it still doesn't work. Now I get messages that are slightly different, but still of the same kind... Abort! STACK_GROWS_DOWN is defd, but stack appears to grow up sp = 0xfffacf48, GC_stackbottom = 0xc0b74 stack direction = 3 Perhaps the problem is that sp is wrapping around to negative numbers? I'm not sure. Any help would be appreciated. Gary Leavens