X-Spam-Check-By: sourceware.org
Date: Fri, 5 Jan 2007 11:52:20 -0600
From: Brian Ford <Brian.Ford@FlightSafety.com>
Reply-To: cygwin@cygwin.com
To: cygwin@cygwin.com
Subject: Re: 1.7.0 CVS mmap failure
In-Reply-To: <Pine.CYG.4.58.0701051054010.280@PC1163-8460-XP.flightsafety.com>
Message-ID: <Pine.CYG.4.58.0701051144030.2880@PC1163-8460-XP.flightsafety.com>
References: <Pine.CYG.4.58.0701041715140.3520@PC1163-8460-XP.flightsafety.com>    <20070105095752.GB28768@calimero.vinschen.de>   <Pine.CYG.4.58.0701050959060.2704@PC1163-8460-XP.flightsafety.com>  <Pine.CYG.4.58.0701051054010.280@PC1163-8460-XP.flightsafety.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@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 Fri, 5 Jan 2007, Brian Ford wrote:
> On Fri, 5 Jan 2007, Brian Ford wrote:
> > Ok, after further investigation, this is a /3GB boot.ini flag interaction.
> > Unfortunately, this is a critical flag for our application, so all our
> > machines are configured this way.  That is why I failed to realize its
> > significance before.
> >
> > I understand if this is now too much of an obscure case for you to be
> > interested in.  If so, I'll try to look into it soon on my own.  I suspect
> > it must have been related to your MEM_TOP_DOWN change.
>
> One more tidbit before I have time to find the real problem.  Compiling
> the test case with -Wl,large-address-aware makes the test pass on a /3GB
> system.

Here is an interesting strace comparison:

Non-/3GB:
 4978   26688 [main] mmaptest 2284 MapViewNT: 7FFA0000 =
NtMapViewOfSection (h:6EC, addr:0, len:28237, off:0, protect:80, type:0)
[snip]
    60   27113 [main] mmaptest 2284 MapViewNT: 7FFA7000 =
NtMapViewOfSection (h:6E8, addr:7FFA7000, len:36864, off:0, protect:80, type:0)
  126   27239 [main] mmaptest 2284 mmap64: 0x7FFA0000 = mmap()

/3GB not large address aware:
  183   22192 [main] mmaptest 2856 MapViewNT: 7FFF0000 =
NtMapViewOfSection (h:6F0, addr:0, len:28237, off:0, protect:80, type:0)
[snip]
   68   22648 [main] mmaptest 2856 MapViewNT: 0 = NtMapViewOfSection
(h:6EC, addr:7FFF7000, len:36864, off:0, protect:80, type:0)
   44   22692 [main] mmaptest 2856 seterrno_from_win_error:
../../../../cygwin/winsup/cygwin/mmap.cc:1707 windows error 487
   46   22738 [main] mmaptest 2856 geterrno_from_win_error: windows error
487 == errno 22
   41   22779 [main] mmaptest 2856 __set_errno: void
seterrno_from_win_error(const char*, int, DWORD):310 val 22
   79   22858 [main] mmaptest 2856 __set_errno: void* mmap64(void*,
size_t, int, int, int, _off64_t):1251 val 12
--- Process 2856, exception C0000008 at 7C90EB74
13337   36195 [main] mmaptest 2856 mmap64: 0xFFFFFFFF = mmap()

/3GB large address aware:
  191   22246 [main] mmaptest 3420 MapViewNT: AEFA0000 =
NtMapViewOfSection (h:6EC, addr:0, len:28237, off:0, protect:80, type:0)
[snip]
   66   22676 [main] mmaptest 3420 MapViewNT: AEFA7000 =
NtMapViewOfSection (h:6E8, addr:AEFA7000, len:36864, off:0, protect:80,
type:0)
  126   22802 [main] mmaptest 3420 mmap64: 0xAEFA0000 = mmap()

The second MapViewNT call is filling out the padding to a 64k boundary.
It appears in the problem case that the system doesn't like the 0x7FFF7000
address.  Any idea why?

-- 
Brian Ford
Lead Realtime Software Engineer
VITAL - Visual Simulation Systems
FlightSafety International
the best safety device in any aircraft is a well-trained crew...



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

