delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/01/16/11:38:20

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-4.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_NO,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RCVD_IN_HOSTKARMA_YE
X-Spam-Check-By: sourceware.org
X-Forefront-Antispam-Report: CIP:132.245.2.21;KIP:(null);UIP:(null);IPV:NLI;H:BN1PRD0512HT001.namprd05.prod.outlook.com;RD:none;EFVD:NLI
X-SpamScore: -4
X-BigFish: PS-4(zzbb2dI98dI9371I7eaI146dM1432Izz1ee6h1de0h1202h1e76h1d1ah1d2ahzz75dfhb412mz32i2a8h668h839h947hd25he5bhf0ah1288h12a5h12a9h12bdh137ah13b6h1441h1504h1537h153bh162dh1631h1758h1765h1155h)
Message-ID: <50F6D757.3000005@coverity.com>
Date: Wed, 16 Jan 2013 11:37:43 -0500
From: Tom Honermann <thonermann AT coverity DOT com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: <cygwin AT cygwin DOT com>
Subject: Re: Intermittent failures with ctrl-c
References: <20121222175041 DOT GA14475 AT ednor DOT casa DOT cgf DOT cx> <20121223165621 DOT GA9935 AT ednor DOT casa DOT cgf DOT cx> <50DCB454 DOT 9030400 AT coverity DOT com> <20121229215725 DOT GA18847 AT ednor DOT casa DOT cgf DOT cx> <50E23F98 DOT 1060004 AT coverity DOT com> <20130101053606 DOT GB18911 AT ednor DOT casa DOT cgf DOT cx> <50E48743 DOT 5040401 AT coverity DOT com> <20130102204821 DOT GA6524 AT ednor DOT casa DOT cgf DOT cx> <50E4A597 DOT 1060600 AT coverity DOT com> <50F5D559 DOT 4090909 AT coverity DOT com> <20130116020420 DOT GA13284 AT ednor DOT casa DOT cgf DOT cx>
In-Reply-To: <20130116020420.GA13284@ednor.casa.cgf.cx>
X-OriginatorOrg: coverity.com
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

On 01/15/2013 09:04 PM, Christopher Faylor wrote:
> On Tue, Jan 15, 2013 at 05:16:57PM -0500, Tom Honermann wrote:
>> I noticed that some changes were checked in related to signal handling
>> and process termination recently, so I downloaded the most recent
>> snapshot (20130114) and tested again.  I was still able to produce
>> hanging processes (including hangs of strace.exe) by hitting ctrl-c in a
>> mintty window while Cygwin processes ran in an infinite loop inside of a
>> .bat file.  I was able to produce a hang ~1 out of 20 times.
>
> How does one run a .bat file inside mintty which handles CTRL-C?  AFAIK,
> a CTRL-C will just cause the .bat file to exit when run under bash.

Here is the test case:

1) Install the latest snapshot

2) Copy bash.exe, false.exe, and their dependent DLLs from a Cygwin 
install into the usr/bin directory of the snapshot.  For me this 
consisted of:
   bash.exe
   cygintl-8.dll
   cygiconv-2.dll
   cygreadline7.dll
   cygncurses-10.dll
   cygncursesw-10.dll
   cyggcc_s-1.dll
   false.exe

3) Create 'test.bat' in the usr/bin directory of the snapshot with the 
following contents:

@echo off
setlocal

set PATH=%CD%;%PATH%

:loop
echo test...
bash -c false
if not errorlevel 1 (
     echo exiting...
     exit /B 1
)
goto loop

4) Launch mintty using an existing Cygwin installation.  Naturally, this 
will run a shell from the existing Cygwin install.

5) Change directories to the usr/bin directory of the snapshot.

6) Start task manager or some other process monitoring tool and keep it 
running.  Run ./test.bat from the Cygwin shell running within mintty and 
interrupt it with ctrl-c.  Repeat until you see a new bash.exe or 
false.exe process persisting following the interrupt.  You'll likely 
have multiple bash processes running.  If you are able to reproduce, you 
should see one with a command line of 'bash -c false'.  Alternatively, 
if your process monitoring tool shows the path to the executable, you'll 
be able to identify it as the one from the usr/bin directory of the 
snapshot.

I rather doubt that the use of a .bat file is necessary to reproduce 
this hang, but I haven't tried producing a test case that doesn't use a 
.bat file.  This is a test case I was using when debugging the 
intermittent incorrect exit code issue.

Tom.


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