Broken autoconf mmap test
Ken Brown
kbrown@cornell.edu
Wed Mar 23 17:46:00 GMT 2011
On 3/23/2011 11:44 AM, Corinna Vinschen wrote:
> On Mar 23 10:08, Ken Brown wrote:
>> On 3/23/2011 9:26 AM, Corinna Vinschen wrote:
>>> Btw., I just experimented with another flag which has not been exposed
>>> to the Win32 API, and which is not officially documented. It's called
>>> AT_EXTENDABLE_FILE and allows to specify a view which is bigger than
>>> the filesize. I tried this on W7-64, and it works. Just not exactly
>>> as we need it. The trailing pages are not commited but only reserved,
>>> so accessing them still results in a SEGV. And while commiting them
>>> allows to run the autoconf testcase, it also changes the filesize of
>>> the file on disk. Oh well.
>>
>> Is the scenario in which the autoconf test fails likely to occur in
>> practice? I wonder if it could be responsible for some of the
>> mysterious crashes that people have reported on 64-bit systems.
>
> Usually it shouldn't. While you can write into a mmaped area beyond
> EOF up to the end of the last page, it doesn't make a lot of sense.
> The data will never show up in the mapped file.
>
> I have no idea if there are applications out there which rely on this
> crude behaviour.
I was mainly thinking of this from the point of view of a Cygwin package
maintainer. In view of what you said, it seems that it's probably safe
to continue using the workaround
export ac_cv_func_mmap_fixed_mapped=yes
that's built into cygport. Maintainers who don't use cygport and who
build on a 64-bit system will have to manually use a similar workaround,
or else their builds won't use mmap.
It doesn't look like there's going to be an autoconf change to resolve this:
http://lists.gnu.org/archive/html/autoconf/2011-03/msg00041.html
Ken
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
More information about the Cygwin
mailing list