delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/02/08/09:56:00

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-0.8 required=5.0 tests=AWL,BAYES_00,TO_NO_BRKTS_PCNT
X-Spam-Check-By: sourceware.org
Date: Wed, 8 Feb 2012 15:55:04 +0100
From: Denis Excoffier <cygwin AT Denis-Excoffier DOT org>
To: cygwin AT cygwin DOT com
Subject: Re: cygwin-1.7.10-1 fork - address space needed by ... already in use
Message-ID: <20120208145527.GA4644@qp9482>
References: <33279157 DOT post AT talk DOT nabble DOT com> <20120207154359 DOT GA2952 AT qp9482> <20120207161428 DOT GB12159 AT calimero DOT vinschen DOT de> <4F31559B DOT 6060600 AT cs DOT utoronto DOT ca> <B0ED7173-1AC3-4B4E-8B79-3A9B22652684 AT Denis-Excoffier DOT org> <20120208090824 DOT GA1724 AT qp9482> <20120208092711 DOT GF25129 AT calimero DOT vinschen DOT de> <20120208102235 DOT GA2796 AT qp9482> <20120208130012 DOT GG25129 AT calimero DOT vinschen DOT de> <20120208133502 DOT GH25129 AT calimero DOT vinschen DOT de>
MIME-Version: 1.0
In-Reply-To: <20120208133502.GH25129@calimero.vinschen.de>
User-Agent: Mutt/1.5.21 (2010-09-15)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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

On Wed, Feb 08, 2012 at 02:35:02PM +0100, Corinna Vinschen wrote:
>> On Feb  8 14:00, Corinna Vinschen wrote:
>> > On Feb  8 11:22, Denis Excoffier wrote:
>> > > I can reproduce.
>> > > 
>> > > On my system (2012-02-07 snapshot instrumented), the following is able
>> > > to exercise the fork failure any time.
>> > > 
>> > > I do this from within a dedicated directory named "stc".
>> > > Current shell seems indifferent. Here it is /bin/tcsh and
>> > > i've tried with /bin/bash with the same result.
>> > > 
>> > > % cat doit1
>> > > #!/usr/bin/tcsh -f
>> > > setenv PATH "/usr/bin"
>> > > cp /usr/bin/cyggcc_s-1.dll .
>> > > ls
>> > > rm cyggcc_s-1.dll
>> > > %
>> > > % cat doit2
>> > > #!/tmp/tcsh -f
>> > > setenv PATH "/usr/bin"
>> > > cp /usr/bin/cyggcc_s-1.dll .
>> > > ls
>> > > rm cyggcc_s-1.dll
>> > > %
>> > > 
>> > > Also you will need to do (once): cp /usr/bin/tcsh.exe /tmp/tcsh.exe
>> > > 
>> > > 
>> > > % ./doit1
>> > > cyggcc_s-1.dll  doit1  doit2
>> > > %
>> > > % ./doit2
>> > >       1 [main] tcsh 3660 dll_list::reserve_space: address space needed by 'cygiconv-2.dll' (0x674C0000 with type 1=DLL_LINK)
>> > >      [...etc...]
>> > 
>> > Thanks for the testcase!  I can reproduce now as well.  I think I see
>> > what's going wrong, but I'm not quite sure what the best fix is.  Stay
>> > tuned.
>> 
>> What happens in this testcase is that Cygwin checks the full DLL path
>> and then finds that the new path to cyggcc_s-1.dll is not the same as
>> the path it has already loaded.  Therefore it assumes that it has to add
>> the file to list.
>> 
>> This is plainly wrong, because, as you can read on
>> http://msdn.microsoft.com/en-us/library/ms682586%28v=vs.85%29.aspx the
>> Windows loader does not load a DLL again, if it already has a module
>> loaded which has the same basename.  Therefore the test for the full
>> pathname in Cygwin has to to be replaced with only testing the module
>> basename.
>> 
>> However, while this situation in the doit2 testcase is simply explained,
>> I don't see how this affects your rsync call.
>> 
>> Denis, can you please change your test output?  Instead of printing only
>> d_alt->modname, please print d_alt->name and then run your rsync test
>> again.  If this is the same problem as in the doit testcase, I'd like to
>> see where the second cygiconv-2.dll is coming from.  In theory, if you
>> have only a single installation of cygiconv-2.dll, this should'nt
>> happen.
Here it is. Enjoy!
      1 [main] gcc-4 5440 dll_list::reserve_space: address space needed by 'cygiconv-2.dll' (file D:\Home\dexcoff1\dexcoff1\cygwin2011f\bin\cygiconv-2.dll) (0x674C0000 with type 1=DLL_LINK)
   1580 [main] gcc-4 5440 dll_list::reserve_space: address space needed by 'cygintl-8.dll' (file D:\Home\dexcoff1\dexcoff1\cygwin2011f\bin\cygintl-8.dll) (0x6F5C0000 with type 1=DLL_LINK)
   1899 [main] gcc-4 5440 dll_list::reserve_space: address space needed by 'cygiconv-2.dll' (file \\?\D:\Home\dexcoff1\dexcoff1\cygwin2011f\bin\cygiconv-2.dll) (0x674C0000 with type 2=DLL_LOAD)
   2562 [main] gcc-4 5440 dll_list::reserve_space: address space needed by 'cygintl-8.dll' (file \\?\D:\Home\dexcoff1\dexcoff1\cygwin2011f\bin\cygintl-8.dll) (0x6F5C0000 with type 2=DLL_LOAD)
   3290 [main] gcc-4 5440 child_info_fork::abort: address space needed by 'cygiconv-2.dll' (0x674C0000) is already occupied
      2 [main] gcc 3408 fork: child -1 - forked process died unexpectedly, retry 0, exit code 1, errno 11

I don't think you will need /proc/5440/maps this time.

Regards,

Denis.


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

- Raw text -


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