www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/04/23/02:31:21

Date: Tue, 23 Apr 1996 09:20:11 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: j DOT aldrich6 AT genie DOT com
Cc: djgpp AT delorie DOT com
Subject: Re: Unexplained memory problems
In-Reply-To: <199604230019.AA055928794@relay1.geis.com>
Message-Id: <Pine.SUN.3.91.960423091418.18939J-100000@is>
Mime-Version: 1.0

On Tue, 23 Apr 1996 j DOT aldrich6 AT genie DOT com wrote:

> allocated via calloc() from the heap.  They should be safe from stack
> overflows, right?

No, they aren't safe.  Please try to enlarge the stack size of your 
program (the FAQ describes how to do it in section 15.8) and see if the 
problems go away.  Any program that uses a lot of automatic variables 
should define a large stack (the default is 256KB).

>  And how, regardless of what my program has done,
> could the memory be being 'reinitialized'?  I'm pretty sure I'm not
> accidentally freeing the memory.

The best way to catch these errors is to run the program under the FSDB 
debugger.  It lets you define a data-write breakpoint, so you can put it 
at the address that seems to be overwritten and run the program as 
usual.  When some code writes to that address, the debugger gets control; 
you can then examine the function call stack to see who did that.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019