Date: Thu, 12 Oct 2000 22:19:28 +0200 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: "Chaos" Message-Id: <2950-Thu12Oct2000221927+0300-eliz@is.elta.co.il> X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.5h CC: djgpp AT delorie DOT com In-reply-to: <39e60652@news.vogel.pl> (chengin@alpha.net.pl) Subject: Re: free() error References: <39e36135 AT news DOT vogel DOT pl> <39e60652 AT news DOT vogel DOT pl> Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > From: "Chaos" > Newsgroups: comp.os.msdos.djgpp > Date: Thu, 12 Oct 2000 20:46:54 +0200 > > > >You probably have a buffer overflow somewhere, writing garbage over > >the data structure that malloc()/free() uses to keep track of the > >heap. For more information, look in DJGPP FAQ entry 9.2. YAMD, yet > >another malloc() debugger by Nate Eldredge, may help: > > http://www3.hmc.edu/~neldredge/yamd/ > > Strange. All free()'s are at the very end of program. It doesn't matter. If the code elsewhere in your program has overwritten some of the allocated buffers, any call to free() can crash, because malloc and free maintain information about memory allocations right before the beginning and after the end of the buffer that you get from malloc.