X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:subject:to:references:from:message-id:date
	:mime-version:in-reply-to:content-type
	:content-transfer-encoding; q=dns; s=default; b=gG32l1pfgx/ik4hw
	aRlEd+HJJagEBSXTyCKxlWSUmBvnPaAilq6LklWOSLqX8tGHc6KqaUjScI0DgJRo
	7byHtJvLFHjJmM7wktrNtnEhnf0Xeg1MI2qf3TwEsbQPDzXANF9NIkx64h3zyK6T
	NwG5/PXAbffJhdIkc9Q+s6T8JM0=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:subject:to:references:from:message-id:date
	:mime-version:in-reply-to:content-type
	:content-transfer-encoding; s=default; bh=X/oyTy1tkgc9yOZTVKhTE2
	kSctE=; b=NHCZYllJg+Md7IS0vJKP5tX3AJVxf3hwyi3fkU51L/pMeie4+wyuLc
	rltVaqVyUp6t2NMJQvkrFdJFiN9YKdktP2mWDh9fsBWFRLAwYZihzmWhyI90idUE
	GH3O6zMnHw0at9195Uf1jWyba+w2W8/1QQLVyi9Rhgk4L4sGI0vuw=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=2.2 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 spammy=shutdown, gems, Expected, H*Ad:D*gmx.de
X-HELO: mout.gmx.net
Subject: ctrl-c doesn't reliably kill applications
To: cygwin@cygwin.com
References: <56E6F25A.7070000@gmx.de> <56E75B3E.7020102@farance.com> <56E95EA2.8070800@gmail.com>
From: =?UTF-8?Q?Bj=c3=b6rn_Stabel?= <stabelweb@gmx.de>
Message-ID: <56EB0DDE.60205@gmx.de>
Date: Thu, 17 Mar 2016 21:04:46 +0100
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0
MIME-Version: 1.0
In-Reply-To: <56E95EA2.8070800@gmail.com>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-UI-Out-Filterresults: notjunk:1;V01:K0:vXscdXvsPxI=:5+T2+l9Io/5V+h4j3UZJVF TrxSvCFYCpmpWEdwRVAecyD6WoovpJI8ejvJEb7t+NwflXhwJ2iKCxNzNYPHydMY+7JpMi9Ce n3e2Rr2krFOZ4PD7iQd3HXsSDYwSkHx6ZuZ/AXYZa0JrfbACa0AICJ1tdYIoTWNJRB6G5z6EH HlLwDTU4r3jFnLLd6MeW9TH+DBcQcSUZf4GREoFmmOdUGMhEIcTvRSMjySPebPAwv9F44OH9Q ES+gpVDHaIr5OfwaRBKJ/3faonsWyk1scuBrGgWdzXX3bCrfHeH+zjjqTjURc0wrqWarsKivb BJyq6RqTBOjBSF9vu5EHBIFnptNdQCk3FCphL1b9la0wEtsWWTEa20NCzPGw11K9SRyp1rQ15 8KQgKomUkezNJViZRPFgWETIpY2gfZWBfwhgaFhEu9wmyyhZTEVlfvsjQZbmht1+WuDEdYRv+ 8EVH/srRHmYK8JOMbRhr0Vxi4TvIgCVz9lEOb+G61I86P/FRYPibFKwM38/+DM3oMjjkGNiVh lZjf6mQR/RpwDaRed/zVRGFz8TyhhEJr66GR5pyV6V2ViMxXxLL/Veg32pTuCXjgBQhznsKMO dr7TkMXonBW015gzzTg6haV1bY3b0EzmTC7i/lkQK97a3c0bAAASj9/tPo0LJTECAY7CY0Btv oaMCdYACNguNkdGUJQoi5g9ndsT3UL2J6ZtS/SjTBbvkS1+LVx9Uyi02W4h/crIkEXGFa9dBx 8aYsZvulddaw1yMHKdm9XVRDJHGv/o+GE7riwck4T8ZkMb/nwPQDDGpaKCKYrhyGXZNnKrZZo aZASWpu
X-IsSubscribed: yes

I couldn't replicate it either, but the question I started this thread
with is unrelated to either of the ping tools.
Here it is again:

The ctrl-c shortcut doesn't reliably kill applications (anymore?).
It has been that way for at least a year now.

------------------------------------------------------------------------

One example is the ruby "rerun" tool (at least when used with a sinatra
app).
The problem can be reproduced using these steps:

 1. Default cygwin install
 2. Install rubygems package
 3. gem install rerun sinatra
 4. Make sure the rerun tool is in PATH (or specify the path to it
    explicitly). I think rubygems installs executables from gems to
    ~/bin by default
 5. rerun "ruby -e 'require(\"sinatra\")'"
 6. ctrl-c
 7. tasklist /fi "IMAGENAME eq ruby.exe"
      * Expected: No process
      * Actual: process is still running

You might have to repeat steps 5 to 7 a few times for the issue to occur.
Another problem is that Q sometimes doesn't exit rerun but only the app
running inside, but that might be a problem with rerun itself or with
the shutdown detection they use.

------------------------------------------------------------------------

Another example is Vagrant.
Although that is not a cygwin application, I usually recommend coworkers
to use it with cygwin, because it benefits from mintty's better console.
The problem there occurs when you invoke a long-running vagrant command
(vagrant provision, for instance) and then cancel it with ctrl-c.
If you do that, you're back at the bash prompt, but the provisioning run
still goes on and spams the console, making it unusable.

------------------------------------------------------------------------

Under Kubuntu Linux 14.04/kde/konsole/bash, neither of these problems exist.
What the two examples seem to have in common is that they're both one
application invoking another:

  * rerun invokes sh -c "$1" (I think)
  * vagrant provision invokes (its bundled?) ssh

I think this is a bug and should be fixed. Is the bug with Cygwin or
should I report it elsewhere?

- Björn Stabel aka. TomyLobo



Am 16.03.2016 um 14:24 schrieb Marco Atzeri:
>
>
> On 15/03/2016 01:45, Frank Farance wrote:
>> I have been having this problem with "ping".  If I "ping" a location
>> that doesn't exist, then "ping" just hangs and cannot be killed via
>> "kill -KILL [pid]".
>>
>>
>> Back to the problem, so when I type
>>
>> $ ping some.unknown.host
>>
>
> I do not succeed to replicate.
> CTRL-C works fine for me
>
> $ type ping
> ping is hashed (/usr/bin/ping)
>
> $ ping 172.21.1.254
> PING 172.21.1.254 (172.21.1.254): 56 data bytes
>
> ----172.21.1.254 PING Statistics----
> 4 packets transmitted, 0 packets received, 100.0% packet loss
>
> or I have not a biased DNS answer.
>
>> according to "ping", the hostname resolves to 90.242.140.21 (as per the
>> explanation above), but I cannot kill "ping".  I tried "ping" with a
>> limited packet size and count so, in theory, "ping" would die on its own
>> after 10 packets, such as:
>>
>> $ ping some.unknown.host 50 10
>>
>> but it still hangs rather than timing out.  If I ping to some actual IP
>> address that is unresponsive (route-able to the last subnet, but dies on
>> the floor at the end), then I can kill via ctrl-c.  My only solution to
>> the hanging "ping" is to kill the terminal window.
>>
>> Any suggestions on:
>>
>> - Why "ping" behaves this way?
>> - How to avoid this problem?
>>
>> Thanks, in advance.
>
> cygwin ping is based on very old source from a time where people was not
> cheating on protocol answer.
>
> http://ftp.arl.mil/mike/ping.html
> (the author passed away 16 years ago..)
>
> can you send me a strace to see where the program is stacking ?
> No promise to find a solution but I will look on it.
>
> Regards
> Marco
>
>
>
>
>
> -- 
> 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
>
>


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

