delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/07/15/06:52:37

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: Thu, 15 Jul 2004 12:52:14 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: mmapped memory lost after fork
Message-ID: <20040715105214.GE19753@cygbert.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <20040714194718 DOT 24047 DOT qmail AT web90105 DOT mail DOT scd DOT yahoo DOT com>
Mime-Version: 1.0
In-Reply-To: <20040714194718.24047.qmail@web90105.mail.scd.yahoo.com>
User-Agent: Mutt/1.4.2i

On Jul 14 12:47, Tenedor Roquefort wrote:
> I'm using Cygwin 1.5.10-3 and have found what seems to
> be a fork/mmap bug. I have two examples where a forked
> child cannot access memory that was mmapped by the
> parent. The problem seems to arise when the parent
> munmaps some pages (different from the ones the child
> will try to access) before forking.
> 
> In the example below, the parent mmaps 2 pages,
> munmaps the first page, writes to the second page and
> forks. Then both parent and child try to access the
> second page, the parent succeeds but the child dies
> trying. The examples work on Linux without the child
> dying. Has this problem been documented before and is
> there a known fix?
> 
> Thanks.

Thanks for the test case!  It was very helpful.  It turned out to be
an off-by-one error in the child routine which generates the same
memory protection layout as in the parent process.

I've applied a fix and created a new developer snapshot.  Please give
it a try, see http://cygwin.com/snapshots/


Corinna

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

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