delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/11/09/07:50:00

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_SOFTFAIL
X-Spam-Check-By: sourceware.org
Message-ID: <4AF80FFB.4040701@byu.net>
Date: Mon, 09 Nov 2009 05:50:03 -0700
From: Eric Blake <ebb9 AT byu DOT net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666
MIME-Version: 1.0
To: cygwin AT cygwin DOT com, Autoconf Bugs <bug-autoconf AT gnu DOT org>
Subject: Re: Broken autoconf mmap test (was Re: 1.7] BUG - GREP slows to a crawl with large number of matches on a single file)
References: <20091108141548 DOT GB26344 AT calimero DOT vinschen DOT de> <4AF716DB DOT 8060904 AT cwilson DOT fastmail DOT fm> <20091109115903 DOT GE26344 AT calimero DOT vinschen DOT de>
In-Reply-To: <20091109115903.GE26344@calimero.vinschen.de>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Corinna Vinschen on 11/9/2009 4:59 AM:
>>> I just found that the latest autoconf *still* has this broken test
>>> for mmap, which basically calls
>>>
>>>   data2 = malloc (size);
>>>   mmap(data2, ...);
>>>
>>> Why has this test never been fixed?  Chuck?
>> ...err, 'cause I didn't realize it was a problem. I see that cygport has
>> hidden this for years:
>>
>>     # AC_HAVE_MMAP fails despite a working mmap, so we force this to yes
>>     # (see http://www.cygwin.com/ml/cygwin/2004-09/msg00741.html
>>     # and following thread for details)
>>     export ac_cv_func_mmap_fixed_mapped=yes;
>>
>> NTTAWWT, but it never triggered my "gee I ought to fix that" reflex. I
>> agree this should be fixed, but I'm leery of changing an autoconf test
>> without knowing how that change will affect the other 9,236 platforms
> 
> The problem in this testcase is the fact that it calls malloc, then
> computes the next page-aligned free address after the mallocated area
> and then tries to mmap to this address with MAP_FIXED set.  Sure, this
> *might* work, and it works on most systems, but there's no reason at all
> to *expect* that it works since it only works by chance.  The memory
> addresses can be taken by anything and to require that an arbitrary
> fixed address is available to mmap is just plain wrong.  From the
> Linux man page:
> 
> MAP_FIXED
>   [...]
>   If the specified address cannot be used, mmap() will fail.  Because
>   requiring a fixed address for a mapping is less portable, the use of
>   this option is discouraged.
> 
> Since autoconf is supposed to help applications to be more portable,
> it's not really feasible, IMHO, that autoconf requires a non-portable
> feature to work.
> 
> It's frustrating that mmap() and even mmap(MAP_FIXED)
> works fine on Cygwin, just not in the non-portable way it's tested
> in the autoconf test.  Maybe we need two mmap tests in autconf, one
> for mmap in general, the other for MAP_FIXED iisues.
> 
>> I think this is an issue for the autoconf list as a whole.  Would you --
>> or Eric -- care to raise it there?  Especially as you seemed to have
>> quite strong feelings about it back in 2004:
>> http://www.cygwin.com/ml/cygwin/2004-09/msg00753.html
> 
> I had hoped that you, as the autoconf maintainer, would put this
> upstream...

It's an upstream issue now ;)

The problem is that I need some more advice from the cygwin list on how
best to fix the test to pass on cygwin by default.  I'm hoping to release
autoconf 2.65 this week, so a speedy fix to help this issue go away before
the release would be extra nice.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9 AT byu DOT net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkr4D/sACgkQ84KuGfSFAYCOjwCghVcvxtUrAPxqB7w+/6gaT+Y/
H0EAoIUsDfqQ42NzKa8olQtBdhkvVS1f
=36fe
-----END PGP SIGNATURE-----

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019