NetBSD Problem Report #49206

From www@NetBSD.org  Tue Sep 16 10:41:32 2014
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 5E635CE1A7
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 16 Sep 2014 10:41:32 +0000 (UTC)
Message-Id: <20140916104131.08930CE1A7@mollari.NetBSD.org>
Date: Tue, 16 Sep 2014 10:41:31 +0000 (UTC)
From: ozaki-r@netbsd.org
Reply-To: ozaki-r@netbsd.org
To: gnats-bugs@NetBSD.org
Subject: ping6 dies with SIGINT even when it just fails to ping
X-Send-Pr-Version: www-1.0

>Number:         49206
>Category:       bin
>Synopsis:       ping6 dies with SIGINT even when it just fails to ping
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 16 10:45:00 +0000 2014
>Closed-Date:    Wed Sep 17 06:33:53 +0000 2014
>Last-Modified:  Wed Sep 17 06:33:53 +0000 2014
>Originator:     Ryota Ozaki
>Release:        current
>Organization:
>Environment:
NetBSD rangeley 7.99.1 NetBSD 7.99.1 (GENERIC) #7: Mon Aug 25 15:02:51 JST 2014  ozaki-r@rangeley:(hidden) amd64
>Description:
ping6 dies with SIGINT on error (see below). It shouldn't be expected and should simply exit with non-zero exit status (e.g. 2 as same as ping).
>How-To-Repeat:
$ cat ping6.rb 
p system("/sbin/ping6 -c 1 fe80::225:90ff:fe82:985c%wm0")
p $?
p system("/sbin/ping6 -c 1 fe80::225:90ff:fe82:985c%wm1")
p $?
$ ruby ping6.rb 
PING6(56=40+8+8 bytes) fe80::225:90ff:fe82:985c%wm0 --> fe80::225:90ff:fe82:985c%wm0
16 bytes from fe80::225:90ff:fe82:985c%wm0, icmp_seq=0 hlim=64 time=0.086 ms

--- fe80::225:90ff:fe82:985c%wm0 ping6 statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.086/0.086/0.086/0.000 ms
true
#<Process::Status: pid 20653 exit 0>
PING6(56=40+8+8 bytes) fe80::1%lo0 --> fe80::225:90ff:fe82:985c%wm1
ping6: sendmsg: No route to host
ping6: wrote fe80::225:90ff:fe82:985c%wm1 16 chars, ret=-1

--- fe80::225:90ff:fe82:985c%wm1 ping6 statistics ---
1 packets transmitted, 0 packets received, 100.0% packet loss
false
#<Process::Status: pid 7904 SIGINT (signal 2)>

>Fix:
n/a

>Release-Note:

>Audit-Trail:
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/49206: ping6 dies with SIGINT even when it just fails to ping
Date: Tue, 16 Sep 2014 13:30:16 +0200

 I can not reproduce it:

 [~] martin@whoever-brings-the-night > ping6 -c 1 fe80::4:204:baff:fecd:945e%bge0
 PING6(56=40+8+8 bytes) fe80::1%lo0 --> fe80::4:204:baff:fecd:945e%bge0
 ping6: sendmsg: No route to host
 ping6: wrote fe80::4:204:baff:fecd:945e%bge0 16 chars, ret=-1

 --- fe80::4:204:baff:fecd:945e%bge0 ping6 statistics ---
 1 packets transmitted, 0 packets received, 100.0% packet loss

 [~] martin@whoever-brings-the-night > echo $status
 1


 Martin

From: Ryota Ozaki <ozaki-r@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: bin/49206: ping6 dies with SIGINT even when it just fails to ping
Date: Tue, 16 Sep 2014 21:33:04 +0900

 On Tue, Sep 16, 2014 at 8:35 PM, Martin Husemann <martin@duskware.de> wrote:
 > The following reply was made to PR bin/49206; it has been noted by GNATS.
 >
 > From: Martin Husemann <martin@duskware.de>
 > To: gnats-bugs@NetBSD.org
 > Cc:
 > Subject: Re: bin/49206: ping6 dies with SIGINT even when it just fails to ping
 > Date: Tue, 16 Sep 2014 13:30:16 +0200
 >
 >  I can not reproduce it:
 >
 >  [~] martin@whoever-brings-the-night > ping6 -c 1 fe80::4:204:baff:fecd:945e%bge0
 >  PING6(56=40+8+8 bytes) fe80::1%lo0 --> fe80::4:204:baff:fecd:945e%bge0
 >  ping6: sendmsg: No route to host
 >  ping6: wrote fe80::4:204:baff:fecd:945e%bge0 16 chars, ret=-1
 >
 >  --- fe80::4:204:baff:fecd:945e%bge0 ping6 statistics ---
 >  1 packets transmitted, 0 packets received, 100.0% packet loss
 >
 >  [~] martin@whoever-brings-the-night > echo $status
 >  1

 csh seems to return 1 on that case while other shells returns 130.
 Are you using csh?

   ozaki-r

 >
 >
 >  Martin
 >

From: Martin Husemann <martin@duskware.de>
To: Ryota Ozaki <ozaki-r@netbsd.org>
Cc: gnats-bugs@netbsd.org
Subject: Re: bin/49206: ping6 dies with SIGINT even when it just fails to ping
Date: Tue, 16 Sep 2014 14:52:23 +0200

 On Tue, Sep 16, 2014 at 09:33:04PM +0900, Ryota Ozaki wrote:
 > csh seems to return 1 on that case while other shells returns 130.
 > Are you using csh?

 Yes, and you are right:

   1257      1 ping6    GIO   fd 1 wrote 57 bytes
        "--- fe80::4:204:baff:fecd:945e%bge0 ping6 statistics ---\n"
   1257      1 ping6    RET   write 57/0x39
   1257      1 ping6    CALL  write(1,0xfffffffffec0c000,0x3e)
   1257      1 ping6    GIO   fd 1 wrote 62 bytes
        "1 packets transmitted, 0 packets received, 100.0% packet loss\n"
   1257      1 ping6    RET   write 62/0x3e
   1257      1 ping6    CALL  __sigaction_sigtramp(SIGINT,0xffffffffffffa880,0xffffffffffffa8a0,0xfffffffffee53860,2)
   1257      1 ping6    RET   __sigaction_sigtramp 0
   1257      1 ping6    CALL  getpid
   1257      1 ping6    RET   getpid 1257/0x4e9, 1900/0x76c
   1257      1 ping6    CALL  kill(0x4e9, SIGINT)
   1257      1 ping6    RET   kill 0
   1257      1 ping6    PSIG  SIGINT SIG_DFL: code=SI_USER sent by pid=1257, uid=0)


 Martin

From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/49206 CVS commit: src/sbin/ping6
Date: Tue, 16 Sep 2014 17:29:13 -0400

 Module Name:	src
 Committed By:	christos
 Date:		Tue Sep 16 21:29:13 UTC 2014

 Modified Files:
 	src/sbin/ping6: ping6.c

 Log Message:
 PR/49206: ping6 dies with SIGINT even when it just fails to ping
 When reusing the same handler for SIGALRM, make don't pretend you
 got SIGINT.


 To generate a diff of this commit:
 cvs rdiff -u -r1.83 -r1.84 src/sbin/ping6/ping6.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Ryota Ozaki <ozaki-r@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: PR/49206 CVS commit: src/sbin/ping6
Date: Wed, 17 Sep 2014 10:03:56 +0900

 On Wed, Sep 17, 2014 at 6:30 AM, Christos Zoulas <christos@netbsd.org> wrote:
 > The following reply was made to PR bin/49206; it has been noted by GNATS.
 >
 > From: "Christos Zoulas" <christos@netbsd.org>
 > To: gnats-bugs@gnats.NetBSD.org
 > Cc:
 > Subject: PR/49206 CVS commit: src/sbin/ping6
 > Date: Tue, 16 Sep 2014 17:29:13 -0400
 >
 >  Module Name:   src
 >  Committed By:  christos
 >  Date:          Tue Sep 16 21:29:13 UTC 2014
 >
 >  Modified Files:
 >         src/sbin/ping6: ping6.c
 >
 >  Log Message:
 >  PR/49206: ping6 dies with SIGINT even when it just fails to ping
 >  When reusing the same handler for SIGALRM, make don't pretend you
 >  got SIGINT.

 Thanks! It works as expected now.

   ozaki-r

 >
 >
 >  To generate a diff of this commit:
 >  cvs rdiff -u -r1.83 -r1.84 src/sbin/ping6/ping6.c
 >
 >  Please note that diffs are not public domain; they are subject to the
 >  copyright notices on the relevant files.
 >

State-Changed-From-To: open->closed
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Wed, 17 Sep 2014 06:33:53 +0000
State-Changed-Why:
Confirmed fixed.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.