Who understands this code?

Greg Schafer gschafer at zip.com.au
Thu Mar 13 21:04:27 PST 2003

On Thu, Mar 13, 2003 at 11:53:53PM -0500, Donald Smith wrote:
> >Hey Greg,
> >
> >make sure this function (getpagesize()) returns the same value both 
> >inside and outside the chroot environment.
> >
> >My second theory is that an mmap call inside the chroot environment 
> >causes an mmap call on the outside thus screwing the contiguousness of 
> >the two mmap calls in this program (which is what it's testing for). The 
> >reason for the contiguous mappings is only to check that both 
> >individually mapped regions can be unmapped with a single call.
> >
> >BTW, if the reported pagesizes differ, mmap rounds up to the next whole 
> >page increment. So the one inside the chroot is actually mapping more 
> >than the reported page size, and the actually contiguous pages would 
> >appear to be discontiguous. This can be fixed by saving the actually 
> >mapped sizes somewhere.
> >
> >Don
> >
> P.S. Judging by the reported page addresses being 0x135000 apart, I 
> don't think the problem is either of those. mmap appears to just work 
> differently in the chroot environment. Bummer!!

Don, both tests are being done inside a chroot. One fails, one doesn't.
One is an early chroot (kernel headers, glibc, binutils + Ch 5 stuff), one
is a full system. :-/

For the record, my logs dating back to Aug 2002 with gcc-3.1.1 also confirm
the problem back then.

Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-dev' in the subject header of the message

More information about the lfs-dev mailing list