From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9248 invoked by alias); 16 Jan 2013 19:14:41 -0000 Received: (qmail 9236 invoked by uid 22791); 16 Jan 2013 19:14:40 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mho-04-ewr.mailhop.org (HELO mho-02-ewr.mailhop.org) (204.13.248.74) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 16 Jan 2013 19:14:34 +0000 Received: from pool-98-110-183-21.bstnma.fios.verizon.net ([98.110.183.21] helo=cgf.cx) by mho-02-ewr.mailhop.org with esmtpa (Exim 4.72) (envelope-from ) id 1TvYRW-0004qu-71 for cygwin@cygwin.com; Wed, 16 Jan 2013 19:14:34 +0000 Received: from localhost (ednor.casa.cgf.cx [192.168.187.5]) by cgf.cx (Postfix) with ESMTP id 84D308805BD for ; Wed, 16 Jan 2013 14:14:33 -0500 (EST) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX18z37WF+HjmKiKt3lii5tz/ Date: Wed, 16 Jan 2013 19:14:00 -0000 From: Christopher Faylor To: cygwin@cygwin.com Subject: Re: Intermittent failures with ctrl-c Message-ID: <20130116191433.GA20563@ednor.casa.cgf.cx> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <50DCB454.9030400@coverity.com> <20121229215725.GA18847@ednor.casa.cgf.cx> <50E23F98.1060004@coverity.com> <20130101053606.GB18911@ednor.casa.cgf.cx> <50E48743.5040401@coverity.com> <20130102204821.GA6524@ednor.casa.cgf.cx> <50E4A597.1060600@coverity.com> <50F5D559.4090909@coverity.com> <20130116020420.GA13284@ednor.casa.cgf.cx> <50F6D757.3000005@coverity.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <50F6D757.3000005@coverity.com> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2013-01/txt/msg00240.txt.bz2 On Wed, Jan 16, 2013 at 11:37:43AM -0500, Tom Honermann wrote: >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. Again, if I hit CTRL-C while running ./test.bat in mintty then test.bat exits immediately, as expected. Hitting ctrl-c repeatedly after that point gives me a new bash prompt. Non-exiting behavior was a symptom of a previous snapshot which was mentioned here: http://cygwin.com/ml/cygwin/2013-01/msg00164.html >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. Btw, an incorrect exit code is still a possibility if you're running from a cmd shell since it is possible to interrupt a cygwin process before cygwin is entirely set up. That will cause a normal windows CTRL-C exit. cgf -- 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