www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/01/31/22:24:28

Via: uk.ac.ulcc.vmsfe; Tue, 31 Jan 1995 14:15:35 +0000
Date: Tue, 31 Jan 95 14:15 GMT
From: "Kevin Ashley, Systems Development, ULCC" <CZIWKGA AT VMSFE DOT ULCC DOT AC DOT UK>
To: ENRICO <@GENERAL.ULCC.AC.UK:ENRICO AT MAX DOT TIAC DOT NET>,
DJGPP <DJGPP AT SUN DOT SOE DOT CLARKSON DOT EDU>
Subject: RE: malloc bug?

Others have already replied pointing out how you may be causing this
crash if your program overwrites malloc buffers. The malloc.c in the
source part of the djgpp distribution can be easily recompiled
to include more consistency checking (i.e. checking that blocks
passed to free have come from malloc, and looking at the linked lists)
as well as including extra routines which you can call which do
things like dump the linked list of malloc'ed and freed blocks.

I don't have the source to hand since I am miles from my PC, but I
recall two constants which need to be #DEFINED or passed with -D
to turn all this on. Look at the source of malloc.c for more info ;
there's no need to understand how it all works to understand how
to use these debugging features.

Kevin Ashley
------------------------------------------------------------------------------
Kevin Ashley                              K DOT Ashley AT Ulcc DOT ac DOT uk
Systems Development Group Manager      http://www.ulcc.ac.uk/staff/Kevin+Ashley
University of London Computer Centre.      ...ukc!ncdlab!K.Ashley
                      This is not a signature

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019