Mail Archives: djgpp/1999/10/04/21:08:28
Sune Nielsen wrote:
>
> Please don't rip my head off for posting this rather longish email,
> but I seriously need help :(
>
> I've recently upgraded DJGPP from version 2.01 to 2.02, and now, for
> some reason of which I have absolutely no idea, it compiles my code
> into completely rubbish. Well... it actually compiles rather fine, but
> when I try to run the program it tells me something like
>
> <snip>----------------------
> Call frame traceback:
> in function malloc+99
> in function _flsbuf+76
> etc...
> <snip>---------------------
>
> I mean "malloc"... I donīt even use that function (itīs supposed to be
> C++ ;)
> Have I totally missed some point or... is my code really that buggy? I
> am positive that it worked under v2.01!
It's very likely to be a bug in your code. v2.02 introduced a new
implementation of malloc (and C++'s `new' and `delete' are built on top
of the `malloc' family) that happens to be much less tolerant of
erroneous behavior like overrunning arrays and multiple freeing.
Note that your traceback doesn't necessarily point to the buggy code;
often something like an overrun will corrupt malloc's internal state and
cause it to crash on a later, valid operation.
Anyway, you should start hunting the bug. An automated malloc checking
tool is often helpful in cases like these. I've written one called YAMD
available from
http://www3.hmc.edu/~neldredge/yamd/
There are others on Simtelnet if you prefer.
--
Nate Eldredge
neldredge AT hmc DOT edu
- Raw text -