delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/07/14/05:16:17

X-Spam-Check-By: sourceware.org
Date: Fri, 14 Jul 2006 11:16:01 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: 1.5.21s mmap error
Message-ID: <20060714091601.GD8759@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <Pine DOT CYG DOT 4 DOT 58 DOT 0607121030410 DOT 3792 AT PC1163-8460-XP DOT flightsafety DOT com> <20060712165900 DOT GQ8759 AT calimero DOT vinschen DOT de> <Pine DOT CYG DOT 4 DOT 58 DOT 0607121318080 DOT 2284 AT PC1163-8460-XP DOT flightsafety DOT com> <20060712202215 DOT GS8759 AT calimero DOT vinschen DOT de> <Pine DOT CYG DOT 4 DOT 58 DOT 0607121536330 DOT 3784 AT PC1163-8460-XP DOT flightsafety DOT com> <20060713103431 DOT GA17383 AT calimero DOT vinschen DOT de> <Pine DOT CYG DOT 4 DOT 58 DOT 0607130933400 DOT 1164 AT PC1163-8460-XP DOT flightsafety DOT com> <Pine DOT CYG DOT 4 DOT 58 DOT 0607131315110 DOT 3316 AT PC1163-8460-XP DOT flightsafety DOT com>
Mime-Version: 1.0
In-Reply-To: <Pine.CYG.4.58.0607131315110.3316@PC1163-8460-XP.flightsafety.com>
User-Agent: Mutt/1.4.2i
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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

On Jul 13 13:52, Brian Ford wrote:
> > On Thu, 13 Jul 2006, Corinna Vinschen wrote:
> > > I added an (hopefully) appropriate patch, which commits a page within a
> > > MAP_NORESERVE area when memory in this page is accessed by the
> > > application.  If commiting the memory fails, SIGBUS is generated. Please
> > > test CVS HEAD or the next developer snapshot from
> > > http://cygwin.com/snapshots/
> >
> > Wow!  Thanks.  Given my limited Windows API knowledge, that sounded
> > difficult to accomplish properly.  I'll test it for you shortly.
> 
> One problem found.  If the memory is not touched before using it as a
> buffer to a read call, the read returns -1 with errno set to ISDIR.  STC
> attached.

Unfortunately the OS functions don't trigger the exception handler of
the application, so the standard way of doing this doesn't work here.
There's no way around that except for wrapping each and every call to an
OS function manipulating application memory (here: ReadFile) with a test
for ERROR_NOACCESS and trying to resolve this by looking through the
list of mmaps.  I'm not sure we really want to do that, certainly not
for 1.5.21.  If you need this sort of functionality, switch off
MAP_NORESERVE.

As for EISDIR, that's fixed in CVS. EACCES is returned now.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

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