X-Recipient: archive-cygwin@delorie.com X-Spam-Check-By: sourceware.org Date: Thu, 14 May 2009 19:01:06 -0400 From: Christopher Faylor To: cygwin@cygwin.com Subject: Re: Question of the necessity of rebaseall Message-ID: <20090514230106.GA27859@ednor.casa.cgf.cx> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <4A0B6BE4.1020905@cygwin.com> <4A0B751A.30007@cygwin.com> <4A0B7CB2.5050203@byu.net> <17393e3e0905141420w19b8ef8fr4f58a0f5c7f49ee7@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17393e3e0905141420w19b8ef8fr4f58a0f5c7f49ee7@mail.gmail.com> User-Agent: Mutt/1.5.16 (2007-06-09) Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Delivered-To: mailing list cygwin@cygwin.com On Thu, May 14, 2009 at 05:20:58PM -0400, Matt Wozniski wrote: >On Wed, May 13, 2009 at 10:06 PM, Eric Blake wrote: >>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. > >Is this a place where using vfork() instead of fork() helps (where it's >applicable, of course)? If so, we might be able to reduce the number >of rebase failures in the future just by trying to push other projects >to use vfork wherever it's substitutable for fork... In Cygwin vfork == fork. cgf -- 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/