Mail Archives: djgpp/2018/01/07/04:22:13
> From: "david peterac (peters DOT al AT gmx DOT com) [via djgpp AT delorie DOT com]" <djgpp AT delorie DOT com>
> Date: Sun, 7 Jan 2018 08:43:43 -0000 (UTC)
>
> Thank You for explanation. The compilation in djdev-2.05 was clean.
It's not a compilation problem, it's a run-time problem. Some code
calls malloc/free incorrectly and causes corruption of the heap memory
blocks maintained by the library.
According to the library sources, this error message, and the
following SIGABRT, happen in a call to the function 'free' when either
a memory block was released more than once, or if it is otherwise
corrupted.
If you can put a breakpoint in the function 'badcallabort', you should
be able to see the place in the program which triggers this problem.
(For that, you may need to compile nmalloc.c from the library sources
with full debug info.) Then look at the sources around this place and
try figuring out what caused the problem.
Alternatively, you could try building the program while forcing
Unix-style 'sbrk' algorithm. The library documentation of
'_crt0_startup_flags' has the details, but basically put something
like this in some source file, outside of any function:
#include <crt0.h>
int _crt0_startup_flags = _CRT0_FLAG_UNIX_SBRK;
and then rebuild the program. This trick could help if smake makes
some assumptions about memory allocation behavior that DJGPP doesn't
uphold by default. (But since at this point we don't really
understand the cause of the problem, this suggestion is just a stab in
the dark.)
- Raw text -