From owner-freebsd-testing@freebsd.org Thu Dec 27 22:45:20 2018 Return-Path: Delivered-To: freebsd-testing@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 529F114259F1 for ; Thu, 27 Dec 2018 22:45:20 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id DC4938F596 for ; Thu, 27 Dec 2018 22:45:19 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 98F1414259F0; Thu, 27 Dec 2018 22:45:19 +0000 (UTC) Delivered-To: testing@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59FF514259EF for ; Thu, 27 Dec 2018 22:45:19 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E91A38F591 for ; Thu, 27 Dec 2018 22:45:18 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id 397449061 for ; Thu, 27 Dec 2018 22:45:18 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id wBRMjIGI032476 for ; Thu, 27 Dec 2018 22:45:18 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id wBRMjIBh032475 for testing@freebsd.org; Thu, 27 Dec 2018 22:45:18 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: testing@freebsd.org Subject: [Bug 233646] Flakey test case: bin.sh.builtins.functional_test.kill1 Date: Thu, 27 Dec 2018 22:45:18 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: tests X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: jilles@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: testing@freebsd.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-testing@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Testing on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Dec 2018 22:45:20 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D233646 Jilles Tjoelker changed: What |Removed |Added ---------------------------------------------------------------------------- Status|New |Open --- Comment #3 from Jilles Tjoelker --- In the below text, wait(2) means any wait system call; sh(1) uses wait3() w= hich appears as wait4() in ktrace. The test case is meant to test that a terminated, wait(2)ed for but not wait(1)ed for job can be passed to kill(1) without error (the command will = do nothing). The part with the second background job, p2 and wait is intended = to wait for the first background job to terminate and be wait(2)ed for, without taking excessive time or wait(1)ing for it (which would make the %1 specification invalid). If the first background job is slow to terminate, t= he kill command will do something but this is harmless. If the first background job terminates but the kernel has not returned it yet via wait(2), the kill command will kill a zombie which per POSIX does nothing successfully. I noticed that the problem is quickly reproduced on head using a loop like while sh builtins/kill1.0; do :; done using head's sh as well as stable/11's sh, while it can run for quite a whi= le on stable/11 using stable/11's sh as well as head's sh built against stable= /11. Reproducing with ktrace -i seems hard, but reproducing with plain ktrace wo= rks. The below ktrace extract seems to indicate that the kernel is at fault, returning an [ESRCH] error for killing a zombie: 19837 sh CALL fork 19837 sh RET fork 19838/0x4d7e 19837 sh CALL wait4(0xffffffff,0x7fffffffe91c,0x1,0) 19837 sh RET wait4 0 19837 sh CALL fork 19837 sh RET fork 19839/0x4d7f 19837 sh CALL sigprocmask(SIG_BLOCK,0x7fffffffe820,0x7fffffffe810) 19837 sh RET sigprocmask 0 19837 sh CALL sigaction(SIGCHLD,0x7fffffffe850,0x7fffffffe830) 19837 sh RET sigaction 0 19837 sh CALL wait4(0xffffffff,0x7fffffffe80c,0x1,0) 19837 sh RET wait4 19839/0x4d7f 19837 sh CALL sigaction(SIGCHLD,0x7fffffffe830,0) 19837 sh RET sigaction 0 19837 sh CALL sigprocmask(SIG_SETMASK,0x7fffffffe810,0) 19837 sh RET sigprocmask 0 19837 sh CALL kill(0x4d7e,SIGTERM) 19837 sh RET kill -1 errno 3 No such process Process ID 18007 has not been returned by a wait4() call, so it must either= be still running or a zombie. In either case, a kill() on it must succeed. It appears that there is no test that specifically verifies that killing a zombie process succeeds. --=20 You are receiving this mail because: You are the assignee for the bug.=