Date: Wed, 23 Aug 2000 09:08:30 +0200 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: munin AT munin DOT inka DOT de Message-Id: <3395-Wed23Aug2000090830+0300-eliz@is.elta.co.il> X-Mailer: Emacs 20.6 (via feedmail 8.2.emacs20_6 I) and Blat ver 1.8.5b CC: djgpp AT delorie DOT com In-reply-to: (message from Bernd Becker on Wed, 23 Aug 2000 01:23:15 +0100) Subject: Re: freeing/allocating memory causes a SIGSEGV References: Note-from-DJ: This may be spam 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: Bernd Becker > Newsgroups: comp.os.msdos.djgpp > Date: Wed, 23 Aug 2000 01:23:15 +0100 > > When memory is allocated/freed in a loop the program will crash after > going through it for a while with a SIGSEGV. Crashes in malloc or free usually mean that your program writes past the end of allocated buffers, and thus overwrites the hidden info stored just before and just after the allocated space, where malloc/free keep the information about allocated memory. I suggest to examine closely your code, and look for places which might do that. Using YAMD or another malloc debugger might also help (YAMD is not effective unless you run it on plain DOS, though). See section 9.2 of the DJGPP FAQ list for more about this.