delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2020/08/25/11:57:35

X-Recipient: archive-cygwin AT delorie DOT com
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2761D3857807
Authentication-Results: sourceware.org;
dmarc=none (p=none dis=none) header.from=cs.umass.edu
Authentication-Results: sourceware.org;
spf=pass smtp.mailfrom=moss AT cs DOT umass DOT edu
Subject: Re: [cygwin] Re: Mandatory ASLR breaks Cygwin - Windows 10
To: Jason Pyeron <jpyeron AT pdinc DOT us>, cygwin AT cygwin DOT com
References: <!&!AAAAAAAAAAAuAAAAAAAAAALnY9Oyj39Bmm+bZ+AsdEYBAMO2jhD3dRHOtM0AqgC7tuYAAAAAAA4AABAAAACpqdOkYbaoTKteTcuy1wdvAQAAAAA=@linuxandria.com>
<4AA035EB-1325-4C1B-B399-28FC9176F203 AT roc DOT cs DOT umass DOT edu>
<006c01d67aed$2f7f0660$8e7d1320$@linuxandria.com>
<cd134b34-3b17-3082-4da8-879583667070 AT SystematicSw DOT ab DOT ca>
<1b2501d67af3$efcd9e80$cf68db80$@pdinc.us>
From: Eliot Moss <moss AT cs DOT umass DOT edu>
Message-ID: <bd42ad69-6955-801c-5708-8847abcef71a@cs.umass.edu>
Date: Tue, 25 Aug 2020 11:56:41 -0400
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101
Thunderbird/68.11.0
MIME-Version: 1.0
In-Reply-To: <1b2501d67af3$efcd9e80$cf68db80$@pdinc.us>
X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS,
KAM_NUMSUBJECT, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS,
TXREP autolearn=ham autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
Reply-To: moss AT cs DOT umass DOT edu
Errors-To: cygwin-bounces AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces AT cygwin DOT com>

Following up ...

One possible practical direction than can ameliorate this in some cases, and more importantly, 
perhaps speed up creation of child processes, would be to support posix_spawn more directly under 
Cygwin.  Right now, it does fork and then adjusts things, incurring all the problems and overheads 
of fork.  The full generality of posix_spawn would be hard to do in a more direct (non-fork) manner. 
  It _may_ be possible to handle the simplest cases.

posix_spawn is. roughly, fork + exec, meaning the newly forked child is going to get replaced 
anyway.  However, a number of things can be adjusted in this procedure, described by additional 
arguments to posix_spawn.  It might be that the most common and straightforward cases could be done 
directly, split off from the current, general case.  However, the implementers suggest that even 
this would involve a lot of effort

People also ask: Can't we get the Windows team just to support fork?  The answer has been 
consistently "no".  WSL (Windows Subsystem for Linux) version 1 appears to implement fork similarly 
to Cygwin - in any case, it incurs similar overheads.  They are able to exploit some private 
interface, I believe, that avoids Cygwin's hassles with ASLR, but I don't really know.  Fork 
performance under WSL1 is comparable to fork's performance in Cygwin.

Meanwhile, WSL version 2 runs under a hypervisor and thus implements its own fork directly, giving 
speeds more like Linux (a _lot_ faster).  Hence it is clear that the Windows OS team do not intend 
to support fork - they'd just say "use a hypervisor".  And of course the way WSL 2 uses hypervisor 
technology is inside out to the way VirtualBox (etc.) virtualizes hardware, which means that 
VirtualBox essentially doesn't work (at least not reliably and with good performance) when Windows 
hardware virtualization is turned on.  (I went through a whole long deal to figure out how to 
really, really, turn it off so that I can run VirtualBox, which I need for other purposes.  And of 
course doing so defeats some of Microsoft's more recent OS additions to improve security.)

Hope some of these tidbits are helpful in understanding the situation - one of longstanding 
frustration to Cygwiners, but not the fault of our excellent volunteer support team!

Regards - Eliot Moss
--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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