www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/11/22/11:57:59

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=3.0 required=5.0 tests=AWL,BAYES_05,RDNS_DYNAMIC,SPF_HELO_PASS,TVD_RCVD_IP
X-Spam-Check-By: sourceware.org
Mime-Version: 1.0 (Apple Message framework v1082)
Subject: Re: Problem with fork() in latest snapshot
From: Heath Kehoe <heath AT nozzala DOT net>
In-Reply-To: <20101116154141.GA32170@calimero.vinschen.de>
Date: Mon, 22 Nov 2010 10:57:14 -0600
Message-Id: <73EBB9A2-DA4C-4CBD-AD29-0C49CCE4520B@nozzala.net>
References: <4CDAF5D0 DOT 8080306 AT budcat DOT com> <20101116154141 DOT GA32170 AT calimero DOT vinschen DOT de>
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes
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 Nov 16, 2010, at 9:41 AM, Corinna Vinschen wrote:

> On Nov 10 13:43, Heath Kehoe wrote:
>> I have ruby 1.9.2 which I built from source. It works fine in cygwin
>> 1.7.7 and earlier, but in the current snapshot when it does a fork,
>> the child process dies pretty much instantly.
>>=20
>> I've put together a test case (see attached) which replicates what
>> ruby is doing so that this problem can be repro'd without needing to
>> build ruby. It seems that the failure only happens when the fork
>> call is in a dll, and it also seems to depend on manipulating
>> threads in close proximity to the fork.
>>=20
>> Here's the test program under 1.7.7:
>>=20
>>   $ uname -a
>>   CYGWIN_NT-6.1-WOW64 hkehoe1 1.7.7(0.230/5/3) 2010-08-31 09:58 i686
>>   Cygwin
>>   $ ./testfork
>>   Before fork
>>   After fork pid=3D5060
>>   After fork pid=3D0
>>   subprocess status 0 (0x0)
>>=20
>> And here it is in the snapshot:
>>=20
>>   $ uname -a
>>   CYGWIN_NT-6.1-WOW64 hkehoe1 1.7.8s(0.233/5/3) 20101102 14:03:08 i686
>>   Cygwin
>>   $ ./testfork
>>   Before fork
>>   After fork pid=3D3808
>>   subprocess status 32512 (0x7f00)
>>=20
>>=20
>> Note the missing 'After fork' message from the child and the -127
>> exit status.
>>=20
>> An strace of testfork will reveal this error occurring shortly after
>> the fork returns in the child:
>> --- Process 2944, exception C0000005 at 610E4B8C
>> (the process ID is the child's)
>=20
> Would you mind to test which snapshot introduced this problem?

I apologize for the delay, but I've had an abrupt career change (the entire=
 studio was closed down). I had to resubscribe under a new email address.

And I'm using 32-bit Win7 now instead of 64-bit Win7.

But I do have some more information:

-- Beginning with snapshot 20100901, the test program produces no output.
-- Beginning with snapshot 20100926, the test program produces output consi=
stent with the newest snapshots (no output from the child process; child pr=
ocess exits -127)
-- If I run the test program in strace (under any snapshot), it produces co=
rrect output and the child exits 0, however I see an exception message in t=
he strace output:
		--- Process 3848, exception C0000005 at 610E114A
		(oddliy, the process ID is that of the parent, not the child)
-- Running the test program in strace under 1.7.7, I also get a similar exc=
eption message in the strace output even though the test program appears to=
 work correctly.

-heath



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