This is the mail archive of the cygwin mailing list for the Cygwin 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: Broken autoconf mmap test (was Re: 1.7] BUG - GREP slows to a crawl with large number of matches on a single file)

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
    # 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:
> 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.


Problem reports:
Unsubscribe info:

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