delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/04/27/08:24:40

Message-ID: <3EABAF6E.77484C40@yahoo.com>
Date: Sun, 27 Apr 2003 06:22:38 -0400
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: 2.04 status page / 2.04 alpha 1 release schedule
References: <10304261643 DOT AA21358 AT clio DOT rice DOT edu>
Reply-To: djgpp-workers AT delorie DOT com

Charles Sandmann wrote:
> 
> > > The default sbrk has some surprising behavior at times that I'm
> > > much more worried about.  You can get address sequences like:
> > >
> > > 00010000
> > > fffd0000
> > > 00020000
> > > 00030000
> > > fffe0000
> > > (etc)
> > >
> > > Depending on how windows is feeling that particular day.  I believe
> > > you confirmed that nmalloc has no problems with randomly returned
> > > addresses which may not be in increasing order.
> >
> > IIRC I said I believed it didn't affect anything.  I have never
> > seen that effect.  On rereading my code I still see no problem.
> > sbrk is only called in one place, in routine extendsbrk().
> 
> To test this (and it really should be tested) you need shared memory
> (Windows 9x does this).  You write two programs.  One allocates
> a block of memory then pauses (exits on user input).  You open a
> window (or two, or three) and run this program.  The other program
> continues to allocate memory with malloc (and display the addresses
> returned), but pauses between allocation so you can do something
> else in one of the other windows.  (In my case I made the single
> test program - probably on a CD someplace - be able to do all of
> the above in a single program).
> 
> Typically I would start two other programs.  Then start the third,
> let it pause.  Go to first window let it exit/kill it.  Then allow
> the third to allocate blocks of memory.  You will see addresses
> which look like negative values.  If you allocate enough you get the
> jump back to positive values.  Then kill the second program.  You
> then can jump back to negative values again.
> 
> If I can find all these test programs someday maybe I'll add them to
> the test suite.

I am not worried about it.  I think I can arrange to have the
fakesbrk routine used in tnmalloc to simulate it, which will avoid
any such obscene gyrations.  It's on my mental todo list, which
means it may well get forgotten!

-- 
Chuck F (cbfalconer AT yahoo DOT com) (cbfalconer AT worldnet DOT att DOT net)
   Available for consulting/temporary embedded and systems.
   <http://cbfalconer.home.att.net>  USE worldnet address!


- Raw text -


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