delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2002/03/02/14:03:04

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-workers-bounces using -f
Message-ID: <3C8118C3.C4EF9685@yahoo.com>
Date: Sat, 02 Mar 2002 13:24:03 -0500
From: CBFalconer <cbfalconer AT yahoo DOT com>
Organization: Ched Research
X-Mailer: Mozilla 4.75 [en] (Win98; U)
X-Accept-Language: en
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com
Subject: Re: Malloc/free DJGPP code
References: <10203021522 DOT AA15526 AT clio DOT rice DOT edu>
Reply-To: djgpp-workers AT delorie DOT com

Charles Sandmann wrote:
> 
> > > Date: Fri, 01 Mar 2002 16:26:35 -0500
> > > From: CBFalconer <cbfalconer AT yahoo DOT com>
> > >
> > > The point of the
> > > SIGSEGV would be that the rest of the system would provide a
> > > traceback, while a message to stderr would not.
> >
> > That's why I suggested SIGABRT instead: it also produces a traceback.
> 
> SIGABRT is fine, but I'd also like to see a message why the abort
> happened, something like:
> 
> Malloc memory control structures are corrupt, probably due to program
> writing data beyond the end of the allocated data.
> 
> or
> 
> Attempt to free a memory block not allocated with malloc.
> 
> Real exceptions happen because we didn't catch them - so we show everything
> we know about it.  If we are going to raise an exception, lets tell the
> user why, instead of making it hard to understand.  Only a few dozen
> people really understand our register dump and trace stuff and why it's
> our gift to them :-)

No great sweat doing that, but as I discovered early on malloc is
used during initialization and if any errors occur then writing to
stdout at least is fatal and useless.  If I have to put back in
the debug printout mechanism for that feature the code will grow
considerably.  I assume write to the stderr handle will work as
well as write to the stdout handle (not fwrite to streams).

-- 
Chuck F (cbfalconer AT yahoo DOT com) (cbfalconer AT XXXXworldnet DOT att DOT net)
   Available for consulting/temporary embedded and systems.
   (Remove "XXXX" from reply address. yahoo works unmodified)
   mailto:uce AT ftc DOT gov  (for spambots to harvest)


- Raw text -


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