Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <3BA80460.3010208@ece.gatech.edu> Date: Tue, 18 Sep 2001 22:35:12 -0400 From: Charles Wilson User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2) Gecko/20010713 X-Accept-Language: en-us MIME-Version: 1.0 To: Robert Collins CC: cygwin AT cygwin DOT com Subject: Re: [BUG] cygwin-1.3.3-2 -- making auto-import dlls References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Robert Collins wrote: > I went round this one with Paul's original patch. > > Auto image base is bad (for cygwin). > > Very bad. > > Ok, now the scare is over, here is why: > > Lemma: Cygwin1.dll is only relocatable if it is consistently relocated > to the same address in _all_ process's that load cygwin1.dll. Proof: > cygwin copies the process address space to fork, if references to > cygwin1.dll are not valid in the hild, the child will die badly. > > Auto image base will conflict with cygwin1.dll semi-randomly. Because > other cygwin linked .dll's come before cygwin1.dll in the PE header > (don't know if this is due to link order, sorting of the file or > whathaveyou) cygwin1.dll is the last .dll. Thus when there is a > conflict, cygwin1.dll gets relocated. > > The problem: bash does not depend on these conflicting .dll's, so every > process started that does depend on them will fail to initialise. > > Solution: don't use auto-image-base. The overhead from relocation is > quite low, why not let windows just do its thing. Okay, suppose I have 5 dll's that are all based at the default, 0x10000000. I start an exe that depends on those 5, so at startup time they all get relocated to (random) address in my exe's address space. Then cygwin1.dll is loaded. But the random addresses chosen for the relocation for the first 5 dlls MAY or may NOT conflict with cygwin1.dll's *fixed* location. Boom (sometimes). How is this better than the current "boom (sometimes)" behavior? What am I missing? --Chuck -- 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/