delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/08/23/02:09:30

Date: Wed, 23 Aug 2000 09:08:30 +0200
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
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: <r1j5qsg8vjruoq5s3q515lq33fcrmi1vur@4ax.com> (message from Bernd
Becker on Wed, 23 Aug 2000 01:23:15 +0100)
Subject: Re: freeing/allocating memory causes a SIGSEGV
References: <r1j5qsg8vjruoq5s3q515lq33fcrmi1vur AT 4ax DOT com>
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

> From: Bernd Becker <munin AT munin DOT inka DOT de>
> 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.

- Raw text -


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