www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/05/13/22:06:59

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_SOFTFAIL
X-Spam-Check-By: sourceware.org
Message-ID: <4A0B7CB2.5050203@byu.net>
Date: Wed, 13 May 2009 20:06:42 -0600
From: Eric Blake <ebb9 AT byu DOT net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.6.666
MIME-Version: 1.0
To: cygwin AT cygwin DOT com, lenik AT bodz DOT net
Subject: Re: Question of the necessity of rebaseall
References: <gufoof$4ov$1 AT ger DOT gmane DOT org> <4A0B6BE4 DOT 1020905 AT cygwin DOT com> <gufqp0$8jv$1 AT ger DOT gmane DOT org> <4A0B751A DOT 30007 AT cygwin DOT com> <guftc9$de2$1 AT ger DOT gmane DOT org>
In-Reply-To: <guftc9$de2$1@ger.gmane.org>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
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

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Lenik on 5/13/2009 7:49 PM:
>> You have it backwards. Forking doesn't break the relocation. Relocation
>> breaks forking. cygwin1.dll needs to have a very special memory layout to
>> implement the fork semantics in Win32. If this memory layout is
>> disrupted, fork breaks.
>>
> Could you explain in more detail? I can't find any document about this
> special memory layout.

Read the source.  This link is a bit old, but still captures the essence:
http://cygwin.com/cgi-bin/cvsweb.cgi/src/winsup/cygwin/how-cygheap-works.txt?rev=1.5&content-type=text/x-cvsweb-markup&cvsroot=src

Remember, the semantics of fork is that BOTH processes (the parent and
child) must see the SAME memory, and that includes all shared libraries
being mapped at the SAME location.  But since Windows doesn't provide a
native fork, the child must remap everything that the parent had, and hope
that it lands at the same place.  Rebasing improves the chance that the
child will remap, because there are fewer dlls to be remapped in an
arbitrary order.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9 AT byu DOT net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkoLfLIACgkQ84KuGfSFAYDpbQCcDXx2/G9B08xMHgTZU++SeLA+
NEIAoJGTv/tj2DxYSl22yqPbtffd8v6y
=pTcV
-----END PGP SIGNATURE-----

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