www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/09/14/08:10:20

From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Heap structure
Date: 14 Sep 2001 09:45:00 GMT
Organization: Aachen University of Technology (RWTH)
Lines: 21
Message-ID: <9nsjis$nj7$1@nets3.rz.RWTH-Aachen.DE>
References: <3BA1292B DOT C593DFD8 AT cyberoptics DOT com>
NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de
X-Trace: nets3.rz.RWTH-Aachen.DE 1000460700 24167 137.226.32.75 (14 Sep 2001 09:45:00 GMT)
X-Complaints-To: abuse AT rwth-aachen DOT de
NNTP-Posting-Date: 14 Sep 2001 09:45:00 GMT
Originator: broeker@
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Eric Rudd <rudd AT cyberoptics DOT com> wrote:
> I have a DJGPP program that is bombing with a SIGSEGV error.  I have
> reason to believe that the program has an array overflow that is
> corrupting the structure of the heap.  (The program actually bombs in a
> malloc call inside fprintf, but at this point I have no convincing
> reason to believe that a system function bug is to blame.)

For most cases, it's probably going to be easiest to use YAMD to catch
this.  It'll crash your program and dump sufficient information as
soon as any line of code dares to read or write beyond the end of some
heap-allocated array, or does just about anything else that's fishy.

The main advantage over heap-walking after the fact is that you get
informed not just that somebody crunched your heap, but which line of
code did it, and from where it was called. 

Find more in the FAQ, section 9.2 "Programs that crash in `malloc' or
`free'."
-- 
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


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