Mail Archives: djgpp/2000/01/12/03:41:56
Please don't change the subject, even in minor ways. It makes it hard
to track the thread as it evolves.
On Wed, 12 Jan 2000, jazir wrote:
> thanks fr posting that Mark, i'm glad i'm not the only one with
> troubles.
Certain bugs are known to appear in code written by several people
independently ;-).
> today i recompiled the program and tried again...rather then in free(),
> the SIGSEGV occurs in malloc(). i am fairly certain that these kinds of
> errors should *never* happen. there is nothing my code can do that should
> make free() fail is there?
These are all signs of the same trouble I described in another
message: your code overruns the end of the allocated buffer, or tries
to free it more than once.
> another problem: i was compiling yet another of my old programs, and i
> got the SIGSEGV from free(), but the stack displayed after the crash only
> had free in it..not where it was called from. this is all very weird.
Take a look at section 12.2 of the FAQ, it explains how this can
happen. In a nutshell: your code probably overwrites the stack, and
thus the library function which prints the traceback cannot unwind the
stack correctly.
- Raw text -