This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] [BZ #10283] localedef: align fixed maps to SHMLBA


From: Rich Felker <dalias@aerifal.cx>
Date: Thu, 23 May 2013 20:22:37 -0400

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

It's not valid if it would create a bad virtual cache alias, that's
why the SHMLBA restriction exists.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]