delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/01/13/15:16:30

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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: Mon, 13 Jan 2003 15:21:11 -0500
From: Jason Tishler <jason AT tishler DOT net>
Subject: Re: Cygwin vsFTPd porting issues
In-reply-to: <20030113145517.GI16529@cygbert.vinschen.de>
To: cygwin AT cygwin DOT com
Mail-followup-to: cygwin AT cygwin DOT com
Message-id: <20030113202110.GG1012@tishler.net>
MIME-version: 1.0
User-Agent: Mutt/1.4i
References: <20030113143624 DOT GF1012 AT tishler DOT net>
<20030113145517 DOT GI16529 AT cygbert DOT vinschen DOT de>

Corinna,

On Mon, Jan 13, 2003 at 03:55:17PM +0100, Corinna Vinschen wrote:
> On Mon, Jan 13, 2003 at 09:36:24AM -0500, Jason Tishler wrote:
> >   160 37333219 [main] vsftpd 2232 fixup_mmaps_after_fork: ReadProcessMemory failed for MAP_PRIVATE address 0xB40000, Win32 error 299      
> > 
> > I will try to dig deeper to determine why ReadProcessMemory() is
> > failing with ERROR_PARTIAL_COPY (i.e., 299), but any help or
> > pointers will be greatly appreciated.
> 
> If you can figure out why that happens, I'd really appreciate a simple
> testcase.  Please compare the above with the strace output generated
> by mmap(), probably you will find a discrepancy like the address in
> the above strace output is not inside of a mapped block.

I haven't tried the above yet.  See below...

> It's also a big difference if the mmap is mapped anonymously or to a
> file since the mmap() code behaves pretty different.

vsFTPd defaults to anonymous mappings under Cygwin.  However, I forced
it to try file based mappings on Friday as a workaround, but this failed
in the same way.  After reading the vsFTPd *and* Cygwin code some more,
it is clear why the behavior is the same.  vsFTPd uses /dev/zero if
anonymous mappings are not available and Cygwin treats mappings to
/dev/zero the same as anonymous mappings.

> Another way would be to remove MAP_PRIVATE from the mmap() call and
> try again.  MAP_PRIVATE is somewhat problematic on Windows hosts,
> unfortunately.

Replacing MAP_PRIVATE with MAP_SHARED worked around the mmap()/fork()
problem.  Is this a reasonable accommodation?  Or, should I try to get
MAP_PRIVATE to work?

Thanks,
Jason

-- 
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019