Broken autoconf mmap test (was Re: 1.7] BUG - GREP slows to a crawl with large number of matches on a single file)

Charles Wilson cygwin@cwilson.fastmail.fm
Sun Nov 8 19:13:00 GMT 2009


Corinna Vinschen wrote:
> On Nov  8 14:56, Corinna Vinschen wrote:
>> Btw., the check for mmap in grep's configure file is broken.  It tries
>> to mmap to a fixed address formerly allocated via malloc().  This doesn't
>> work on Windows.  An autoconf run with a newer version of autoconf would
>> be nice.
> 
> 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
that may depend on the current behavior, esp. given my current (lack of)
knowledge about how mmap is *supposed* to work in the various MAP_* modes.

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
> The mmap test is crap.  How can an application expect to be able to
> access just about every address together with MAP_FIXED?
> 
> Consequentially MapViewOfFileEx returns error 487 in these cases,
> "Attempt to access invalid address."
> 
> That's just another example of a crappy autoconf mmap test.

--
Chuck

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