X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-0.7 required=5.0	tests=AWL,BAYES_00,SPF_NEUTRAL,TW_YG,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Message-ID: <4D8A308F.508@cornell.edu>
Date: Wed, 23 Mar 2011 13:40:31 -0400
From: Ken Brown <kbrown@cornell.edu>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: Broken autoconf mmap test
References: <4D8668C6.8020500@cornell.edu> <4D890D95.6090302@redhat.com> <4D891A55.6050601@cornell.edu> <20110323091921.GB10657@calimero.vinschen.de> <4D89D4AA.6070903@cornell.edu> <20110323132622.GM31220@calimero.vinschen.de> <4D89FEC7.3000107@cornell.edu> <20110323154421.GN31220@calimero.vinschen.de>
In-Reply-To: <20110323154421.GN31220@calimero.vinschen.de>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

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

