Mail Archives: djgpp/1996/04/23/02:31:21
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 -