NetBSD Problem Report #51323
From silasdb@gmail.com Thu Jul 7 19:39:55 2016
Return-Path: <silasdb@gmail.com>
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 "Postmaster NetBSD.org" (verified OK))
by mollari.NetBSD.org (Postfix) with ESMTPS id E66A87A3D8
for <gnats-bugs@gnats.NetBSD.org>; Thu, 7 Jul 2016 19:39:55 +0000 (UTC)
Message-Id: <577eb008.855e370a.47699.3996@mx.google.com>
Date: Thu, 07 Jul 2016 16:37:43 -0300
From: silasdb@gmail.com
Reply-To: silasdb@gmail.com
To: gnats-bugs@NetBSD.org
Subject: ping6 -c sends a SIGINT to itself
X-Send-Pr-Version: 3.95
>Number: 51323
>Category: bin
>Synopsis: ping6 -c sends a SIGINT to itself
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Jul 07 19:40:00 +0000 2016
>Last-Modified: Fri Jul 08 00:20:01 +0000 2016
>Originator: Silas Silva
>Release: NetBSD 7.0
>Organization:
>Environment:
System: NetBSD auron 7.0 NetBSD 7.0 (GENERIC.201509250726Z) amd64
Architecture: x86_64
Machine: amd64
>Description:
When using -c option of ping6, it sends a SIGINT to itself, breaking
shell scripts with monitor option (job control) enabled because of
process group semantics. Shells would just expect a simple non-zero
exit status. For more information see kre@ explanation:
http://mail-index.netbsd.org/netbsd-users/2016/07/06/msg018667.html
>How-To-Repeat:
ping6 -c 1 fe80::a800:ff:fe13:942f
>Fix:
>Audit-Trail:
From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Cc:
Subject: Re: bin/51323: ping6 -c sends a SIGINT to itself
Date: Thu, 7 Jul 2016 16:58:08 -0400
On Jul 7, 7:40pm, silasdb@gmail.com (silasdb@gmail.com) wrote:
-- Subject: bin/51323: ping6 -c sends a SIGINT to itself
I don't think this is true. Become root and ktrace it. It seems to be
getting a SIGALRM (on -7)... Nevertheless the code does not use SIGALRM
anymore, and we could pull the fixes up...
christos
From: Silas Silva <silasdb@gmail.com>
To: gnats-bugs@NetBSD.org
Cc: gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: bin/51323: ping6 -c sends a SIGINT to itself
Date: Thu, 7 Jul 2016 20:28:24 -0300
On Thu, Jul 07, 2016 at 09:00:01PM +0000, Christos Zoulas wrote:
> I don't think this is true. Become root and ktrace it. It seems to be
> getting a SIGALRM (on -7)... Nevertheless the code does not use SIGALRM
> anymore, and we could pull the fixes up...
This is the kdump ktrace.out output (also, it may be worth to mention
that exit code is 130):
5666 1 ktrace EMUL "netbsd"
5666 1 ktrace CALL execve(0x7f7fffffd2f0,0x7f7fffffd7d8,0x7f7ffff=
fd800)
5666 1 ktrace NAMI "/home/silas/bin/ping6"
5666 1 ktrace RET execve -1 errno 2 No such file or directory
5666 1 ktrace CALL execve(0x7f7fffffd2f0,0x7f7fffffd7d8,0x7f7ffff=
fd800)
5666 1 ktrace NAMI "/home/silas/scripts/bin/ping6"
5666 1 ktrace RET execve -1 errno 2 No such file or directory
5666 1 ktrace CALL execve(0x7f7fffffd2f0,0x7f7fffffd7d8,0x7f7ffff=
fd800)
5666 1 ktrace NAMI "/bin/ping6"
5666 1 ktrace RET execve -1 errno 2 No such file or directory
5666 1 ktrace CALL execve(0x7f7fffffd2f0,0x7f7fffffd7d8,0x7f7ffff=
fd800)
5666 1 ktrace NAMI "/sbin/ping6"
5666 1 ktrace NAMI "/libexec/ld.elf_so"
5666 1 ping6 EMUL "netbsd"
5666 1 ping6 RET execve JUSTRETURN
5666 1 ping6 CALL mmap(0,0x8000,3,0x1002,0xffffffff,0,0)
5666 1 ping6 RET mmap 140187598290944/0x7f7ff7ff8000
5666 1 ping6 CALL open(0x7f7ff7c0d2c0,0,0x7f7ff7e11ef0)
5666 1 ping6 NAMI "/etc/ld.so.conf"
5666 1 ping6 RET open -1 errno 2 No such file or directory
5666 1 ping6 CALL open(0x7f7fffffd030,0,0x636573706962696c)
5666 1 ping6 NAMI "/lib/libipsec.so.3"
5666 1 ping6 RET open 3
5666 1 ping6 CALL __fstat50(3,0x7f7fffffcf48)
5666 1 ping6 RET __fstat50 0
5666 1 ping6 CALL mmap(0,0x1000,1,1,3,0,0)
5666 1 ping6 RET mmap 140187598286848/0x7f7ff7ff7000
5666 1 ping6 CALL munmap(0x7f7ff7ff7000,0x1000)
5666 1 ping6 RET munmap 0
5666 1 ping6 CALL mmap(0,0x20f000,5,0x15000002,3,0,0)
5666 1 ping6 RET mmap 140187589935104/0x7f7ff7800000
5666 1 ping6 CALL mmap(0x7f7ff7a0d000,0x1000,3,0x12,3,0,0xd000)
5666 1 ping6 RET mmap 140187592085504/0x7f7ff7a0d000
5666 1 ping6 CALL mmap(0x7f7ff7a0e000,0x1000,3,0x1012,0xffffffff=
,0,0)
5666 1 ping6 RET mmap 140187592089600/0x7f7ff7a0e000
5666 1 ping6 CALL mprotect(0x7f7ff780e000,0x1ff000,0)
5666 1 ping6 RET mprotect 0
5666 1 ping6 CALL close(3)
5666 1 ping6 RET close 0
5666 1 ping6 CALL open(0x7f7fffffd030,0,0x2e6f732e6d62696c)
5666 1 ping6 NAMI "/lib/libm.so.0"
5666 1 ping6 RET open 3
5666 1 ping6 CALL __fstat50(3,0x7f7fffffcf48)
5666 1 ping6 RET __fstat50 0
5666 1 ping6 CALL mmap(0,0x1000,1,1,3,0,0)
5666 1 ping6 RET mmap 140187598286848/0x7f7ff7ff7000
5666 1 ping6 CALL munmap(0x7f7ff7ff7000,0x1000)
5666 1 ping6 RET munmap 0
5666 1 ping6 CALL mmap(0,0x227000,5,0x15000002,3,0,0)
5666 1 ping6 RET mmap 140187585740800/0x7f7ff7400000
5666 1 ping6 CALL mmap(0x7f7ff7626000,0x1000,3,0x12,3,0,0x26000)
5666 1 ping6 RET mmap 140187587993600/0x7f7ff7626000
5666 1 ping6 CALL mmap(0x7f7ff7627000,0,3,0x1012,0xffffffff,0,0)
5666 1 ping6 RET mmap 140187587997696/0x7f7ff7627000
5666 1 ping6 CALL mprotect(0x7f7ff7426000,0x200000,0)
5666 1 ping6 RET mprotect 0
5666 1 ping6 CALL close(3)
5666 1 ping6 RET close 0
5666 1 ping6 CALL open(0x7f7fffffd030,0,0x67)
5666 1 ping6 NAMI "/lib/libgcc_s.so.1"
5666 1 ping6 RET open 3
5666 1 ping6 CALL __fstat50(3,0x7f7fffffcf48)
5666 1 ping6 RET __fstat50 0
5666 1 ping6 CALL mmap(0,0x1000,1,1,3,0,0)
5666 1 ping6 RET mmap 140187598286848/0x7f7ff7ff7000
5666 1 ping6 CALL munmap(0x7f7ff7ff7000,0x1000)
5666 1 ping6 RET munmap 0
5666 1 ping6 CALL mmap(0,0x20c000,5,0x15000002,3,0,0)
5666 1 ping6 RET mmap 140187581546496/0x7f7ff7000000
5666 1 ping6 CALL mmap(0x7f7ff720b000,0x1000,3,0x12,3,0,0xb000)
5666 1 ping6 RET mmap 140187583688704/0x7f7ff720b000
5666 1 ping6 CALL mmap(0x7f7ff720c000,0,3,0x1012,0xffffffff,0,0)
5666 1 ping6 RET mmap 140187583692800/0x7f7ff720c000
5666 1 ping6 CALL mprotect(0x7f7ff700c000,0x1ff000,0)
5666 1 ping6 RET mprotect 0
5666 1 ping6 CALL close(3)
5666 1 ping6 RET close 0
5666 1 ping6 CALL open(0x7f7fffffd030,0,0x2e6f732e6362696c)
5666 1 ping6 NAMI "/lib/libc.so.12"
5666 1 ping6 RET open 3
5666 1 ping6 CALL __fstat50(3,0x7f7fffffcf48)
5666 1 ping6 RET __fstat50 0
5666 1 ping6 CALL mmap(0,0x1000,1,1,3,0,0)
5666 1 ping6 RET mmap 140187598286848/0x7f7ff7ff7000
5666 1 ping6 CALL munmap(0x7f7ff7ff7000,0x1000)
5666 1 ping6 RET munmap 0
5666 1 ping6 CALL mmap(0,0x36e000,5,0x15000002,3,0,0)
5666 1 ping6 RET mmap 140187577352192/0x7f7ff6c00000
5666 1 ping6 CALL mmap(0x7f7ff6f4f000,0xc000,3,0x12,3,0,0x14f000)
5666 1 ping6 RET mmap 140187580821504/0x7f7ff6f4f000
5666 1 ping6 CALL mmap(0x7f7ff6f5b000,0x13000,3,0x1012,0xfffffff=
f,0,0)
5666 1 ping6 RET mmap 140187580870656/0x7f7ff6f5b000
5666 1 ping6 CALL mprotect(0x7f7ff6d4f000,0x200000,0)
5666 1 ping6 RET mprotect 0
5666 1 ping6 CALL close(3)
5666 1 ping6 RET close 0
5666 1 ping6 CALL _lwp_setprivate(0x7f7ff7ffe1c0)
5666 1 ping6 RET _lwp_setprivate 0
5666 1 ping6 CALL _lwp_self
5666 1 ping6 RET _lwp_self 1
5666 1 ping6 CALL __sigprocmask14(1,0x7f7fffffd700,0x7f7fffffd77=
0)
5666 1 ping6 RET __sigprocmask14 0
5666 1 ping6 CALL __sigprocmask14(3,0x7f7fffffd770,0)
5666 1 ping6 RET __sigprocmask14 0
5666 1 ping6 CALL __sysctl(0x7f7ff6d217e0,2,0x608760,0x7f7fffffd=
6b8,0,0)
5666 1 ping6 RET __sysctl 0
5666 1 ping6 CALL _lwp_self
5666 1 ping6 RET _lwp_self 1
5666 1 ping6 CALL __sigprocmask14(1,0x7f7fffffd6c0,0x7f7fffffd77=
0)
5666 1 ping6 RET __sigprocmask14 0
5666 1 ping6 CALL __sigprocmask14(3,0x7f7fffffd770,0)
5666 1 ping6 RET __sigprocmask14 0
5666 1 ping6 CALL _lwp_self
5666 1 ping6 RET _lwp_self 1
5666 1 ping6 CALL __sigprocmask14(1,0x7f7fffffd6c0,0x7f7fffffd77=
0)
5666 1 ping6 RET __sigprocmask14 0
5666 1 ping6 CALL __sigprocmask14(3,0x7f7fffffd770,0)
5666 1 ping6 RET __sigprocmask14 0
5666 1 ping6 CALL _lwp_self
5666 1 ping6 RET _lwp_self 1
5666 1 ping6 CALL __sigprocmask14(1,0x7f7fffffd6c0,0x7f7fffffd77=
0)
5666 1 ping6 RET __sigprocmask14 0
5666 1 ping6 CALL __sigprocmask14(3,0x7f7fffffd770,0)
5666 1 ping6 RET __sigprocmask14 0
5666 1 ping6 CALL _lwp_self
5666 1 ping6 RET _lwp_self 1
5666 1 ping6 CALL __sigprocmask14(1,0x7f7fffffd6c0,0x7f7fffffd77=
0)
5666 1 ping6 RET __sigprocmask14 0
5666 1 ping6 CALL __sigprocmask14(3,0x7f7fffffd770,0)
5666 1 ping6 RET __sigprocmask14 0
5666 1 ping6 CALL __sysctl(0x7f7fffffc5e0,2,0x7f7ff6f63fe8,0x7f7=
fffffc5f0,0,0)
5666 1 ping6 RET __sysctl 0
5666 1 ping6 CALL __sysctl(0x7f7fffffc520,2,0x7f7ff6f6d208,0x7f7=
fffffc528,0,0)
5666 1 ping6 RET __sysctl 0
5666 1 ping6 CALL readlink(0x7f7ff6d1a803,0x7f7fffffc620,0x400)
5666 1 ping6 NAMI "/etc/malloc.conf"
5666 1 ping6 RET readlink -1 errno 2 No such file or directory
5666 1 ping6 CALL mmap(0,0x1000,3,0x1002,0xffffffff,0,0)
5666 1 ping6 RET mmap 140187598286848/0x7f7ff7ff7000
5666 1 ping6 CALL mmap(0,0x1000,3,0x1002,0xffffffff,0,0)
5666 1 ping6 RET mmap 140187598282752/0x7f7ff7ff6000
5666 1 ping6 CALL mmap(0,0x100000,3,0x14001002,0xffffffff,0,0)
5666 1 ping6 RET mmap 140187593080832/0x7f7ff7b00000
5666 1 ping6 CALL __socket30(0x18,3,0x3a)
5666 1 ping6 RET __socket30 3
5666 1 ping6 CALL getuid
5666 1 ping6 RET getuid 0
5666 1 ping6 CALL seteuid(0)
5666 1 ping6 RET seteuid 0
5666 1 ping6 CALL getuid
5666 1 ping6 RET getuid 0
5666 1 ping6 CALL setuid(0)
5666 1 ping6 RET setuid 0
5666 1 ping6 CALL mmap(0,0x1000,3,0x1000,0xffffffff,0,0)
5666 1 ping6 RET mmap 140187598278656/0x7f7ff7ff5000
5666 1 ping6 CALL minherit(0x7f7ff7ff5000,0x1000,4)
5666 1 ping6 RET minherit 0
5666 1 ping6 CALL __sysctl(0x7f7fffffcbe0,2,0x7f7fffffcbf0,0x7f7=
fffffcbe8,0,0)
5666 1 ping6 RET __sysctl 0
5666 1 ping6 CALL setsockopt(3,0x29,0x2a,0x7f7fffffce28,4)
5666 1 ping6 RET setsockopt 0
5666 1 ping6 CALL setsockopt(3,0x3a,0x12,0x7f7fffffced0,0x20)
5666 1 ping6 RET setsockopt 0
5666 1 ping6 CALL __socket30(0x18,2,0)
5666 1 ping6 RET __socket30 4
5666 1 ping6 CALL connect(4,0x628cb0,0x1c)
5666 1 ping6 MISC mbsoname: [=C2=8Ej=C3=80=C3=B7=7F=7F]
5666 1 ping6 RET connect 0
5666 1 ping6 CALL getsockname(4,0x628cb0,0x7f7fffffced0)
5666 1 ping6 MISC mbsoname: [fe80::1%lo0]
5666 1 ping6 RET getsockname 0
5666 1 ping6 CALL close(4)
5666 1 ping6 RET close 0
5666 1 ping6 CALL setsockopt(3,0xffff,0x1002,0x7f7fffffce24,4)
5666 1 ping6 RET setsockopt 0
5666 1 ping6 CALL setsockopt(3,0x29,0x24,0x7f7fffffce28,4)
5666 1 ping6 RET setsockopt 0
5666 1 ping6 CALL setsockopt(3,0x29,0x25,0x7f7fffffce28,4)
5666 1 ping6 RET setsockopt 0
5666 1 ping6 CALL __fstat50(1,0x7f7fffffc270)
5666 1 ping6 RET __fstat50 0
5666 1 ping6 CALL ioctl(1,TIOCGETA,0x7f7fffffc2e0)
5666 1 ping6 GIO fd 1 read 44 bytes
"\^B)\0\0\^C\0\0\0\0K\0\0\M-O\^E\0 \^D\M^?\0\b\^W\^U\^R\M^?\^C\^\\^Z=
\^Y\^Q\^S\^V\
\^O\^A\0\^T\M^?\0\M^V\0\0\0\M^V\0\0"
5666 1 ping6 RET ioctl 0
5666 1 ping6 CALL __sysctl(0x7f7ff6d1e7d0,6,0,0x7f7fffffb5d8,0,0)
5666 1 ping6 RET __sysctl 0
5666 1 ping6 CALL __sysctl(0x7f7ff6d1e7d0,6,0x7f7ff7b0d800,0x7f7=
fffffb5d8,0,0)
5666 1 ping6 RET __sysctl 0
5666 1 ping6 CALL write(1,0x7f7ff7b0c000,0x3f)
5666 1 ping6 GIO fd 1 wrote 63 bytes
"PING6(56=3D40+8+8 bytes) fe80::1%lo0 --> fe80::a800:ff:fe13:942f\n"
5666 1 ping6 RET write 63/0x3f
5666 1 ping6 CALL __sigaction_sigtramp(SIGINT,0x7f7fffffcd30,0x7=
f7fffffcd50,0x7f7ff6c9f3f0,2)
5666 1 ping6 RET __sigaction_sigtramp 0
5666 1 ping6 CALL __sigaction_sigtramp(SIGINFO,0x7f7fffffcd30,0x=
7f7fffffcd50,0x7f7ff6c9f3f0,2)
5666 1 ping6 RET __sigaction_sigtramp 0
5666 1 ping6 CALL __sigaction_sigtramp(SIGALRM,0x7f7fffffcd30,0x=
7f7fffffcd50,0x7f7ff6c9f3f0,2)
5666 1 ping6 RET __sigaction_sigtramp 0
5666 1 ping6 CALL __setitimer50(0,0x7f7fffffce60,0)
5666 1 ping6 RET __setitimer50 0
5666 1 ping6 CALL __gettimeofday50(0x7f7fffffcd10,0)
5666 1 ping6 RET __gettimeofday50 0
5666 1 ping6 CALL sendmsg(3,0x608c00,0)
5666 1 ping6 MISC msghdr: [name=3D0x628cd0, namelen=3D28, iov=3D=
0x7f7fffffcd10, iovlen=3D1, control=3D0x0, controllen=3D0, flags=3D4000000]
5666 1 ping6 MISC mbsoname: [fe80::a800:ff:fe13:942f]
5666 1 ping6 GIO fd 3 wrote 16 bytes
"\M^@\0\0\0\M-#\M-]\0\0W~\M-d \0\a\M^HS"
5666 1 ping6 RET sendmsg 16/0x10
5666 1 ping6 CALL poll(0x7f7fffffce30,1,0xffffffff)
5666 1 ping6 RET poll -1 errno 4 Interrupted system call
5666 1 ping6 PSIG SIGALRM caught handler=3D0x4024a7 mask=3D(): c=
ode=3DSI_TIMER sent by pid=3D0, uid=3D0 with sigval 0x0)
5666 1 ping6 CALL setcontext(0x7f7fffffc9e0)
5666 1 ping6 RET setcontext JUSTRETURN
5666 1 ping6 CALL __sigaction_sigtramp(SIGALRM,0x7f7fffffcd00,0x=
7f7fffffcd20,0x7f7ff6c9f3f0,2)
5666 1 ping6 RET __sigaction_sigtramp 0
5666 1 ping6 CALL __setitimer50(0,0x7f7fffffcd50,0)
5666 1 ping6 RET __setitimer50 0
5666 1 ping6 CALL poll(0x7f7fffffce30,1,0xffffffff)
5666 1 ping6 RET poll -1 errno 4 Interrupted system call
5666 1 ping6 PSIG SIGALRM caught handler=3D0x4029e8 mask=3D(): c=
ode=3DSI_TIMER sent by pid=3D0, uid=3D0 with sigval 0x0)
5666 1 ping6 CALL write(1,0x7f7ff7b0c000,1)
5666 1 ping6 GIO fd 1 wrote 1 bytes
"\n"
5666 1 ping6 RET write 1
5666 1 ping6 CALL write(1,0x7f7ff7b0c000,0x31)
5666 1 ping6 GIO fd 1 wrote 49 bytes
"--- fe80::a800:ff:fe13:942f ping6 statistics ---\n"
5666 1 ping6 RET write 49/0x31
5666 1 ping6 CALL write(1,0x7f7ff7b0c000,0x3e)
5666 1 ping6 GIO fd 1 wrote 62 bytes
"1 packets transmitted, 0 packets received, 100.0% packet loss\n"
5666 1 ping6 RET write 62/0x3e
5666 1 ping6 CALL __sigaction_sigtramp(SIGINT,0x7f7fffffc900,0x7=
f7fffffc920,0x7f7ff6c9f3f0,2)
5666 1 ping6 RET __sigaction_sigtramp 0
5666 1 ping6 CALL getpid
5666 1 ping6 RET getpid 5666/0x1622, 2182/0x886
5666 1 ping6 CALL kill(0x1622, SIGINT)
5666 1 ping6 RET kill 0
5666 1 ping6 PSIG SIGINT SIG_DFL: code=3DSI_USER sent by pid=3D5=
666, uid=3D0)
--=20
Silas
From: Robert Elz <kre@munnari.OZ.AU>
To: christos@zoulas.com (Christos Zoulas)
Cc: gnats-bugs@NetBSD.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: bin/51323: ping6 -c sends a SIGINT to itself
Date: Fri, 08 Jul 2016 07:08:16 +0700
Date: Thu, 7 Jul 2016 16:58:08 -0400
From: christos@zoulas.com (Christos Zoulas)
Message-ID: <20160707205808.2D26217FDAB@rebar.astron.com>
| I don't think this is true. Become root and ktrace it. It seems to be
| getting a SIGALRM (on -7)... Nevertheless the code does not use SIGALRM
| anymore, and we could pull the fixes up...
It is fixed in current, but not in NetBSD 7 (where the problem occurred).
kre
From: christos@zoulas.com (Christos Zoulas)
To: Silas Silva <silasdb@gmail.com>, gnats-bugs@NetBSD.org
Cc: gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: bin/51323: ping6 -c sends a SIGINT to itself
Date: Thu, 7 Jul 2016 20:15:17 -0400
On Jul 7, 8:28pm, silasdb@gmail.com (Silas Silva) wrote:
-- Subject: Re: bin/51323: ping6 -c sends a SIGINT to itself
| On Thu, Jul 07, 2016 at 09:00:01PM +0000, Christos Zoulas wrote:
| > I don't think this is true. Become root and ktrace it. It seems to be
| > getting a SIGALRM (on -7)... Nevertheless the code does not use SIGALRM
| > anymore, and we could pull the fixes up...
|
| This is the kdump ktrace.out output (also, it may be worth to mention
| that exit code is 130):
Yes, indeed this version kills itself with SIGINT, argh 7.0 is so old...
I fixed it a while ago.
christos
revision 1.84
date: 2014-09-16 17:29:12 -0400; author: christos; state: Exp; lines: +11 -10; commitid: DLegappGTp9ZfCQx;
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.
(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.