Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Date: Tue, 9 Apr 2002 18:34:42 +0200
From: Corinna Vinschen <cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: mmap of large amount returns invalid pointer
Message-ID: <20020409183442.H1127@cygbert.vinschen.de>
Mail-Followup-To: cygwin@cygwin.com
References: <20020319115739.U29574@cygbert.vinschen.de> <15514.12648.934526.894670@asv-058.sjc.ca.bbnow.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <15514.12648.934526.894670@asv-058.sjc.ca.bbnow.net>
User-Agent: Mutt/1.3.22.1i

On Thu, Mar 21, 2002 at 11:15:52AM -0800, Stephen Weeks wrote:
> 
> > Could you please describe what happens in the error case
> > in plain English?  I see that there could be a timing problem in
> > fork() but I'd like to read how the error looks like.
> 
> The process mmaps some memory, writes to the memory, and then forks.
> After the fork, the parent unmaps the memory and exits, while the
> child reads from the memory.  From looking at the strace, I see that
> the Cygwin fork implementation allows the parent process to continue
> before ensuring that the child has completed the memory copy.  In this
> case, the parent unmaps the memory before the child can copy it.
> Hence, we see the following line in the strace, which indicates the
> failure in the child process (138).
> 
>  1813  914381 [main] fork 138 fixup_mmaps_after_fork: ReadProcessMemory failed for MAP_PRIVATE address 0x2A230000, Win32 error 998
> c:\sweeks\tmp\fork.exe: *** recreate_mmaps_after_fork_failed

I've checked in a fix.  Please try the next devlopers snapshot
or current from CVS.

Thanks for the report and the testcase,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

