This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] [BZ #10283] localedef: align fixed maps to SHMLBA
- From: Rich Felker <dalias at aerifal dot cx>
- To: Carlos O'Donell <carlos at redhat dot com>
- Cc: Mike Frysinger <vapier at gentoo dot org>, libc-alpha at sourceware dot org
- Date: Thu, 23 May 2013 20:22:37 -0400
- Subject: Re: [PATCH] [BZ #10283] localedef: align fixed maps to SHMLBA
- References: <1369327649-906-1-git-send-email-vapier at gentoo dot org> <519EA212 dot 6020508 at redhat dot com>
On Thu, May 23, 2013 at 07:11:14PM -0400, Carlos O'Donell wrote:
> On 05/23/2013 12:47 PM, Mike Frysinger wrote:
> > Many Linux arches require fixed mmaps to be aligned higher than pagesize,
> > so use the SHMLBA define as it represents this quantity exactly.
> >
> > This fixes spurious errors seen on those arches like:
> > cannot map archive header: Invalid argument
>
> I had a deeper think about this issue and I don't know
> that you can rely on glibc's SHMLBA to do this correctly.
>
> See:
> http://lkml.indiana.edu/hypermail/linux/kernel/0309.1/1005.html
>
> Which says that the kernel and glibc values for SHMLBA don't
> match.
>
> We need correct SHMLBA values in order to ensure that the kernel
> will be less likely to return EINVAL for an mmap with a fixed
> address.
It would be helpful to know *why* the kernel is returning EINVAL for
otherwise-correct (page-aligned) mmap requests. Mapping on a
page-aligned address over top of an existing mapping *should* always
be valid, conceptually. Any link to an explanation on why it's
sometimes not valid?
Rich