Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
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
Date: Thu, 15 Jul 2004 17:34:14 -0400
From: Christopher Faylor <cgf-no-personal-reply-please@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: [BUG] mprotect() on Windows NT 5+
Message-ID: <20040715213414.GA13349@trixie.casa.cgf.cx>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <1089925820.40f6f2bcf1d88@imp3-q.free.fr>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <1089925820.40f6f2bcf1d88@imp3-q.free.fr>
User-Agent: Mutt/1.4.1i

On Thu, Jul 15, 2004 at 11:10:20PM +0200, Xavier Joubert wrote:
>Hello Corinna,
>
>
>Selon Corinna Vinschen <corinna-cygwin@cygwin.com>:
>> The cause is a limitation in newer Windows NT versions, which make sense.
>> Well, sort of.  The protection modes PAGE_READWRITE and PAGE_WRITECOPY are
>> mutually exlusive, which is enforced in calls to VirtualProtect since W2K.
>>
>> Since your example uses MAP_PRIVATE, which Cygwin maps to PAGE_WRITECOPY,
>> trying to protect with MAP_WRITE, which internally maps to PAGE_READWRTE,
>> fails on W2K and later.  I've checked in a fix, so that mprotect tests for
>> the original protection mode of the first page in the area, and uses
>> READWRITE or WRITECOPY, whichever matches the original protection.
>
>Whow! That's amazing! I didn't expect to get a reply today. Even less a fix
>commited to CVS. If all bugs last only 51 minutes in Cygwin, this software will
>quickly become perfect!

Unfortunately, some of us are slackers and are not as adroit as Corinna in
fixing bugs so perfection is still a long way off...

cgf

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

