NetBSD Problem Report #53463

From martin@duskware.de  Mon Jul 23 07:34:21 2018
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 9218D7A1ED
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 23 Jul 2018 07:34:21 +0000 (UTC)
From: martin@NetBSD.org
Reply-To: martin@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: ping responds late to SIGINT
X-Send-Pr-Version: 3.95

>Number:         53463
>Category:       bin
>Synopsis:       ping responds late to SIGINT
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jul 23 07:35:00 +0000 2018
>Last-Modified:  Mon Jul 23 15:05:00 +0000 2018
>Originator:     Martin Husemann
>Release:        NetBSD 8.99.22
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD thirdstage.duskware.de 8.99.22 NetBSD 8.99.22 (MODULAR) #100: Mon Jul 16 10:08:57 CEST 2018 martin@thirdstage.duskware.de:/usr/src/sys/arch/sparc64/compile/MODULAR sparc64
Architecture: sparc64
Machine: sparc64
>Description:

Aborting a ping to a remote host that is down takes several seconds.

>How-To-Repeat:

Run ping against a remote host that is down, wait untill the header line
is printed, then hit ^C.

On NetBSD 8.0 this instantly brings back the shell prompt.
In -curret you will have to wait untill the first ICMP unreachable response
is displayed.

>Fix:
n/a

>Audit-Trail:
From: Robert Elz <kre@munnari.OZ.AU>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/53463: ping responds late to SIGINT
Date: Mon, 23 Jul 2018 19:46:05 +0700

     Date:        Mon, 23 Jul 2018 07:35:00 +0000 (UTC)
     From:        martin@NetBSD.org
     Message-ID:  <20180723073500.3362E7A264@mollari.NetBSD.org>

   | On NetBSD 8.0 this instantly brings back the shell prompt.

 Are you sure?   That's not how I remember it, more or less, forever.

 The SIGINT tells ping to stop sending, it then waits for replies to the last
 packets it sent (anything outstanding) calculates the stats on what was
 sent/received ... etc, prints the results, and exits.

 You're right that if it takes a long time for anything to be returned (lost
 packets, or ICMP filtering, or just infrequent ICMP) then ping will wait
 quite a while before giving up.   When that happens, a second SIGINT
 has traditionally caused ping to treat the missing replies as lost packets
 (immediately) and exit.

 kre

From: mlelstv@serpens.de (Michael van Elst)
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: bin/53463: ping responds late to SIGINT
Date: Mon, 23 Jul 2018 15:01:40 -0000 (UTC)

 kre@munnari.OZ.AU (Robert Elz) writes:

 >   | On NetBSD 8.0 this instantly brings back the shell prompt.
 > 
 > Are you sure?   That's not how I remember it, more or less, forever.

 On NetBSD _7_ it does, but NetBSD 8.0 shows the same behaviour as -current.

 This is the result of the fix for PR 51267 in ping.c 1.111.

 > The SIGINT tells ping to stop sending, it then waits for replies to the last
 > packets it sent (anything outstanding) calculates the stats on what was
 > sent/received ... etc, prints the results, and exits.

 It exits immediately if no packet had been sent yet or if a second SIGINT
 is sent.

 ktrace shows that the delay isn't for the ping interval, but for a DNS
 query. This query is executed with blocked signals and may take some time,
 depending on wether the answer is cached or not.

 ping -n doesn't show the problem.


 Greetings,
 -- 
 -- 
                                 Michael van Elst
 Internet: mlelstv@serpens.de
                                 "A potential Snark may lurk in every tree."

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.