delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/09/15/21:01:45

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
Date: Wed, 15 Sep 2004 21:01:35 -0400 (EDT)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Sam Steingold <sds AT gnu DOT org>
cc: cygwin AT cygwin DOT com
Subject: Re: checking for working mmap...no
In-Reply-To: <ullfbtb6l.fsf@gnu.org>
Message-ID: <Pine.GSO.4.61.0409152044550.3716@slinky.cs.nyu.edu>
References: <uk6uvnxt9 DOT fsf AT gnu DOT org> <20040915210751 DOT GG23012 AT trixie DOT casa DOT cgf DOT cx> <ullfbtb6l DOT fsf AT gnu DOT org>
MIME-Version: 1.0
X-Scanned-By: MIMEDefang 2.39

On Wed, 15 Sep 2004, Sam Steingold wrote:

> > * Christopher Faylor <pts-ab-crefbany-ercyl-cyrnfr AT pltjva DOT pbz> [2004-09-15 17:07:51 -0400]:
> >
> > On Wed, Sep 15, 2004 at 03:20:50PM -0400, Sam Steingold wrote:
> >>It appears that cygwin mmap() is lacking:
> >>
> >>configure:20536: checking for working mmap
> >>configure:20617: gcc -o conftest.exe -g -O2 conftest.c  >&5
> >>configure:20620: $? = 0
> >>configure:20622: ./conftest.exe
> >>configure:20625: $? = 1
> >>configure: program exited with status 1
> >>configure: failed program was:
> >
> > It would be enormously helpful if you apprised us of exactly *what*
> > was wrong rather than expecting us to figure it out.
>
> Let me assure you that you know these matters much better than I do.
>
> The C program in my original e-mail is supposed to terminate with exit
> code 0 if mmap() works correctly.  It does, e.g., on Linux and Solaris.
>
> On cygwin, it terminates with exit code 1, which indicates that mmap()
> does not work correctly as it is supposed to according to the spec.
>
> Unfortunately, I am far from being an expert on these matters...

Well, it looks like what configure basically complains about is that the
following mmap() calls fail (i.e., return (void*)-1) when they should have
succeeded (i.e., returned the first parameter):

mmap(0xa000000,40960,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0)
mmap(0xb000000,49152,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0)
mmap(0xc000000,49152,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0)
mmap(0xd000000,57344,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0)
mmap(0xe000000,57344,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0)
mmap(0xf000000,65536,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0)
mmap(0x10000000,65536,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0)
mmap(0x11000000,73728,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0)
mmap(0x12000000,73728,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0)
mmap(0x13000000,81920,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0)
mmap(0x14000000,81920,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0)
mmap(0x15000000,90112,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0)
mmap(0x16000000,90112,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0)
mmap(0x17000000,98304,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0)
mmap(0x18000000,98304,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0)
mmap(0x19000000,106496,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0)
mmap(0x1a000000,106496,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0)
mmap(0x1b000000,114688,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0)
mmap(0x1c000000,114688,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0)
mmap(0x1d000000,122880,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0)
mmap(0x1e000000,122880,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0)
mmap(0x1f000000,131072,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0)
mmap(0x20000000,131072,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0)
mmap(0x21000000,139264,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0)
mmap(0x22000000,139264,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0)

BTW, I'm not at all sure this is abnormal behavior...  Especially given
that the 9 preceding mmap() calls and ~30 later calls succeed:

mmap(0x1000000,8192,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x1000000
mmap(0x2000000,8192,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x2000000
mmap(0x3000000,16384,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x3000000
mmap(0x4000000,16384,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x4000000
mmap(0x5000000,24576,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x5000000
mmap(0x6000000,24576,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x6000000
mmap(0x7000000,32768,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x7000000
mmap(0x8000000,32768,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x8000000
mmap(0x9000000,40960,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x9000000
[failures]
mmap(0x23000000,147456,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x23000000
mmap(0x24000000,147456,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x24000000
mmap(0x25000000,155648,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x25000000
mmap(0x26000000,155648,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x26000000
mmap(0x27000000,163840,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x27000000
mmap(0x28000000,163840,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x28000000
mmap(0x29000000,172032,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x29000000
mmap(0x2a000000,172032,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x2a000000
mmap(0x2b000000,180224,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x2b000000
mmap(0x2c000000,180224,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x2c000000
mmap(0x2d000000,188416,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x2d000000
mmap(0x2e000000,188416,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x2e000000
mmap(0x2f000000,196608,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x2f000000
mmap(0x30000000,196608,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x30000000
mmap(0x31000000,204800,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x31000000
mmap(0x32000000,204800,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x32000000
mmap(0x33000000,212992,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x33000000
mmap(0x34000000,212992,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x34000000
mmap(0x35000000,221184,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x35000000
mmap(0x36000000,221184,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x36000000
mmap(0x37000000,229376,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x37000000
mmap(0x38000000,229376,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x38000000
mmap(0x39000000,237568,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x39000000
mmap(0x3a000000,237568,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x3a000000
mmap(0x3b000000,245760,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x3b000000
mmap(0x3c000000,245760,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x3c000000
mmap(0x3d000000,253952,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x3d000000
mmap(0x3e000000,253952,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x3e000000
mmap(0x3f000000,262144,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x3f000000
mmap(0x40000000,262144,PROT_READ|PROT_WRITE,MAP_ANON|MAP_PRIVATE|MAP_FIXED,-1,0) => 0x40000000

It may have just hit on a reserved region (e.g., one set aside for
DLLs)...  FWIW, when attempting to write to the mmapped area, the program
crashes with a SEGV (probably also not surprising, as the fd was set to
-1).  It could simply be that the configure script is non-portable or
non-POSIX-compliant...
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Happiness lies in being privileged to work hard for long hours in doing
whatever you think is worth doing."  -- Dr. Jubal Harshaw

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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