delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2002/03/02/21:46:52

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-workers-bounces using -f
Message-ID: <3C8179B3.F5529DFD@yahoo.com>
Date: Sat, 02 Mar 2002 20:17:39 -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> <3C8118C3 DOT C4EF9685 AT yahoo DOT com> <4331-Sat02Mar2002220420+0200-eliz AT is DOT elta DOT co DOT il>
Reply-To: djgpp-workers AT delorie DOT com

Eli Zaretskii wrote:
> 
> > Date: Sat, 02 Mar 2002 13:24:03 -0500
> > From: CBFalconer <cbfalconer AT yahoo DOT com>
> >
> > 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.
> 
> It's fatal if you use buffered stdio functions.  If you use `write'
> (or even `_write') instead, it's not fatal.  The crash message is
> written using these methods, and you could do the same with some
> additional text you print before you abort.

Already put it in, along with things in the test software to
trigger it.  It is using write, but it doesn't need sprintf and
buffers etc. so it does become quite simple.  Seems to be working
fine, and I am replacing asserts with it now.  Detecting freeing a
freed block is not as positive as I thought, because it may have
been combined with other blocks, and the combined block is what is
marked as free.  However the asserts that are being changed over
seem to catch that nicely.

Maybe the output message should tell them to "run symify
<progname>"?  Really a detail that can be handled at anytime.

-- 
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