Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Sep 1997 13:46:45 -0600 (MDT)
From:      Nate Williams <nate@mt.sri.com>
To:        Poul-Henning Kamp <phk@critter.freebsd.dk>
Cc:        Nate Williams <nate@mt.sri.com>, Graham Wheeler <gram@cdsec.com>, hackers@freebsd.org
Subject:   Re: Bug in malloc/free (was: Memory leak in getservbyXXX?) 
Message-ID:  <199709181946.NAA13960@rocky.mt.sri.com>
In-Reply-To: <11097.874611676@critter.freebsd.dk>
References:  <199709181912.NAA13699@rocky.mt.sri.com> <11097.874611676@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> >[ 'hangs' in malloc due to memory over-write causing circular lists ]
> >
> >> >> This is about the only way you could get it to loop I think.  That means
> >> >> that somebody wrote to memory malloc hadn't passed them (ie: your code).
> >> >
> >> >Yikes, this would be 'Hard to Do', even by design (ie; self-modifying
> >> >code).  But, stranger things have happened, especially with dealing with
> >> >malloc/free.
> >> 
> >> No, all you have to do is to make each allocation have it's own set of
> >> pages, munmap them when free is called and never use those pages again.
> >> 
> >> You run out of address space really fast, and it is slow, but it works.
> >
> >It's slow, but how would it cause malloc to hang?
> 
> It wouldn't, it would detect accesses to free'ed memory.

Ahh, I misunderstand what you meant.  I thought that you meant that
getting PHK-malloc to spin was easy to do with the above, not that
detecting it would be easy to do.


Nate



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199709181946.NAA13960>