Date: Tue, 23 Apr 1996 09:20:11 +0200 (IST) From: Eli Zaretskii 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: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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.