NetBSD Problem Report #51600

From www@NetBSD.org  Sat Nov  5 01:27:21 2016
Return-Path: <www@NetBSD.org>
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 DB4E27A20D
	for <gnats-bugs@gnats.NetBSD.org>; Sat,  5 Nov 2016 01:27:21 +0000 (UTC)
Message-Id: <20161105012720.757A37A2B2@mollari.NetBSD.org>
Date: Sat,  5 Nov 2016 01:27:20 +0000 (UTC)
From: n54@gmx.com
Reply-To: n54@gmx.com
To: gnats-bugs@NetBSD.org
Subject: Tracer must detect zombie before child's parent
X-Send-Pr-Version: www-1.0

>Number:         51600
>Category:       kern
>Synopsis:       Tracer must detect zombie before child's parent
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kre
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Nov 05 01:30:01 +0000 2016
>Closed-Date:    Wed Nov 09 22:35:12 +0000 2016
>Last-Modified:  Sat Nov 19 15:25:00 +0000 2016
>Originator:     Kamil Rytarowski
>Release:        NetBSD 7.99.42 amd64
>Organization:
TNF
>Environment:
NetBSD chieftec 7.99.42 NetBSD 7.99.42 (GENERIC) #0: Fri Nov  4 20:52:34 CET 2016  kamil@chieftec:/tmp/netbsd-tmp/sys/arch/amd64/compile/GENERIC amd64
>Description:
Debugger must detect that a child has been terminated before the child's parent.

This is expected behavior found on Linux and FreeBSD.
>How-To-Repeat:
/* WARNING kernel newer than 2016-11-05 is needed in order to no panic the system */


#include <sys/param.h>
#include <sys/types.h>
#include <sys/ptrace.h>
#include <sys/sysctl.h>
#include <sys/wait.h>
#include <assert.h>
#include <err.h>
#include <errno.h>
#include <signal.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

#define ATF_REQUIRE(a) assert(a)

/*
 * A child process cannot call atf functions and expect them to magically
 * work like in the parent.
 * The printf(3) messaging from a child will not work out of the box as well
 * without estabilishing a communication protocol with its parent. To not
 * overcomplicate the tests - do not log from a child and use err(3)/errx(3)
 * wrapped with FORKEE_ASSERT()/FORKEE_ASSERTX() as that is guaranteed to work.
 */
#define FORKEE_ASSERTX(x)							\
do {										\
	int ret = (x);								\
	if (!ret)								\
		errx(EXIT_FAILURE, "%s:%d %s(): Assertion failed for: %s",	\
		     __FILE__, __LINE__, __func__, #x);				\
} while (0)

#define FORKEE_ASSERT(x)							\
do {										\
	int ret = (x);								\
	if (!ret)								\
		err(EXIT_FAILURE, "%s:%d %s(): Assertion failed for: %s",	\
		     __FILE__, __LINE__, __func__, #x);				\
} while (0)

/* This function is currently designed to be run in the main/parent process */
static void
await_zombie(pid_t process)
{
#if defined(__NetBSD__)
	struct kinfo_proc2 p;
	size_t len = sizeof(p);

	const int name[] = {
		[0] = CTL_KERN,
		[1] = KERN_PROC2,
		[2] = KERN_PROC_PID,
		[3] = process,
		[4] = sizeof(p),
		[5] = 1
	};

	const size_t namelen = __arraycount(name);

	/* Await the process becoming a zombie */
	while(1) {
		ATF_REQUIRE(sysctl(name, namelen, &p, &len, NULL, 0) == 0);

		if (p.p_stat == LSZOMB)
			break;

		ATF_REQUIRE(usleep(1000) == 0);
	}
#elif defined(__FreeBSD__)
	struct kinfo_proc p;
	size_t len = sizeof(p);

	const int name[] = {
		[0] = CTL_KERN,
		[1] = KERN_PROC,
		[2] = KERN_PROC_PID,
		[3] = process
	};

	const size_t namelen = __arraycount(name);

	/* Await the process becoming a zombie */
	while(1) {
		if(sysctl(name, namelen, &p, &len, NULL, 0) == -1) {
			if (errno == ESRCH)
				break;
			err(EXIT_FAILURE, "sysctl");
		}

		ATF_REQUIRE(usleep(1000) == 0);
	}
#elif defined(linux)
	int iszombie = 0;
	char pbuf[60];
	snprintf(pbuf, sizeof(pbuf), "/proc/%d/stat", (int)process);

	/* Detect that tracee is zombie */
	while(1) {
		FILE* fpstat = fopen(pbuf, "r");
		if (!fpstat) {
			err(EXIT_FAILURE, "fopen");
		};
		int rpid =0; char rcmd[32]; char rstatc = 0;
		fscanf(fpstat, "%d %30s %c", &rpid, rcmd, &rstatc);
		iszombie = rstatc == 'Z';

		fclose(fpstat);
		if (iszombie == 1) {
			break;
		}

		usleep(1000);
	}
#endif
}

int
main(int argc, char **argv)
{
	int fds_totracee[2], fds_totracer[2], fds_fromtracer[2];
	int status, rv;
	const int exitval_tracee = 5;
	const int exitval_tracer = 10;
	pid_t tracee, tracer, wpid;
	uint8_t msg = 0xde; /* dummy message for IPC based on pipe(2) */

	printf("Spawn tracee\n");
	ATF_REQUIRE(pipe(fds_totracee) == 0);
	ATF_REQUIRE((tracee = fork()) != -1);
	if (tracee == 0) {
		FORKEE_ASSERT(close(fds_totracee[1]) == 0);

		/* Wait for message from the parent */
		rv = read(fds_totracee[0], &msg, sizeof(msg));
		FORKEE_ASSERT(rv == sizeof(msg));

		_exit(exitval_tracee);
	}
	ATF_REQUIRE(close(fds_totracee[0]) == 0);

	printf("Spawn debugger\n");
	ATF_REQUIRE(pipe(fds_totracer) == 0);
	ATF_REQUIRE(pipe(fds_fromtracer) == 0);
	ATF_REQUIRE((tracer = fork()) != -1);
	if (tracer == 0) {
		/* No IPC to communicate with the child */
		FORKEE_ASSERT(close(fds_totracee[1]) == 0);

		FORKEE_ASSERT(close(fds_totracer[1]) == 0);
		FORKEE_ASSERT(close(fds_fromtracer[0]) == 0);

		FORKEE_ASSERT(ptrace(PT_ATTACH, tracee, NULL, 0) != -1);

		/* Wait for tracee and assert that it was stopped w/ SIGSTOP */
		wpid = waitpid(tracee, &status, 0);
		FORKEE_ASSERTX(wpid == tracee);
		FORKEE_ASSERTX(!WIFEXITED(status));
		FORKEE_ASSERTX(!WIFCONTINUED(status));
		FORKEE_ASSERTX(!WIFSIGNALED(status));
		FORKEE_ASSERTX(WIFSTOPPED(status));
		FORKEE_ASSERTX(WSTOPSIG(status) == SIGSTOP);

		/* Resume tracee with PT_CONTINUE */
		FORKEE_ASSERT(ptrace(PT_CONTINUE, tracee, (void *)1, 0) != -1);

		/* Inform parent that tracer has attached to tracee */
		rv = write(fds_fromtracer[1], &msg, sizeof(msg));
		FORKEE_ASSERT(rv == sizeof(msg));

		/* Wait for parent */
		rv = read(fds_totracer[0], &msg, sizeof(msg));
		FORKEE_ASSERT(rv == sizeof(msg));

		/* Wait for tracee and assert that it exited */
		wpid = waitpid(tracee, &status, 0);
		FORKEE_ASSERTX(wpid == tracee);
		FORKEE_ASSERTX(WIFEXITED(status));
		FORKEE_ASSERTX(!WIFCONTINUED(status));
		FORKEE_ASSERTX(!WIFSIGNALED(status));
		FORKEE_ASSERTX(!WIFSTOPPED(status));
		FORKEE_ASSERTX(WEXITSTATUS(status) == exitval_tracee);

		_exit(exitval_tracer);
	}
	ATF_REQUIRE(close(fds_totracer[0]) == 0);
	ATF_REQUIRE(close(fds_fromtracer[1]) == 0);

	printf("Wait for the tracer to attach to the tracee\n");
	rv = read(fds_fromtracer[0], &msg, sizeof(msg));
	ATF_REQUIRE(rv == sizeof(msg));

	printf("Resume the tracee and let it exit\n");
	rv = write(fds_totracee[1], &msg, sizeof(msg));
	ATF_REQUIRE(rv == sizeof(msg));

	printf("fds_totracee is no longer needed - close it\n");
	ATF_REQUIRE(close(fds_totracee[1]) == 0);

	printf("Detect that tracee is zombie\n");
	await_zombie(tracee);

	printf("Assert that there is no status about tracee - "
	    "Tracer must detect zombie first\n");
	wpid = waitpid(tracee, &status, WNOHANG);
	ATF_REQUIRE(wpid == 0);

	printf("Resume the tracer and let it detect exited tracee\n");
	rv = write(fds_totracer[1], &msg, sizeof(msg));
	ATF_REQUIRE(rv == sizeof(msg));

	printf("Wait for tracer to finish its job and exit\n");
	wpid = waitpid(tracer, &status, 0);
	ATF_REQUIRE(wpid == tracer);
	ATF_REQUIRE(WIFEXITED(status));
	ATF_REQUIRE(!WIFCONTINUED(status));
	ATF_REQUIRE(!WIFSIGNALED(status));
	ATF_REQUIRE(!WIFSTOPPED(status));
	ATF_REQUIRE(WEXITSTATUS(status) == exitval_tracer);

	printf("Wait for tracer to finish its job and exit\n");
	wpid = waitpid(tracee, &status, WNOHANG);
	ATF_REQUIRE(wpid == tracee);
	ATF_REQUIRE(WIFEXITED(status));
	ATF_REQUIRE(!WIFCONTINUED(status));
	ATF_REQUIRE(!WIFSIGNALED(status));
	ATF_REQUIRE(!WIFSTOPPED(status));
	ATF_REQUIRE(WEXITSTATUS(status) == exitval_tracee);

	printf("fds_fromtracer is no longer needed - close it\n");
	ATF_REQUIRE(close(fds_fromtracer[0]) == 0);

	printf("fds_totracer is no longer needed - close it\n");
	ATF_REQUIRE(close(fds_totracer[1]) == 0);

	return EXIT_SUCCESS;
}
>Fix:
N/A

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: kamil@NetBSD.org
State-Changed-When: Sat, 05 Nov 2016 16:56:26 +0100
State-Changed-Why:
Fixed in NetBSD-current by Christos Zoulas

http://mail-index.netbsd.org/source-changes/2016/11/05/msg078889.html


From: "Kamil Rytarowski" <kamil@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/51600 CVS commit: src/tests/kernel
Date: Sat, 5 Nov 2016 15:52:35 +0000

 Module Name:	src
 Committed By:	kamil
 Date:		Sat Nov  5 15:52:35 UTC 2016

 Modified Files:
 	src/tests/kernel: t_ptrace.c

 Log Message:
 attach1 in t_ptrace no longer fails

 Christos Zoulas fixed the issue that a parent sees termination of its child
 before a tracer observing it for its tracee.

 Many thanks to Christs for his help, he makes progress with tests so quick.

 Closes PR kern/51600

 Sponsored by <The NetBSD Foundation>.


 To generate a diff of this commit:
 cvs rdiff -u -r1.9 -r1.10 src/tests/kernel/t_ptrace.c

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

From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/51600: Tracer must detect zombie before child's parent
Date: Sat, 5 Nov 2016 20:38:41 +0000

 On Sat, Nov 05, 2016 at 01:30:01AM +0000, n54@gmx.com wrote:
  > Debugger must detect that a child has been terminated before the
  > child's parent.

 Does this need to get into -7?

 also,

  > /* WARNING kernel newer than 2016-11-05 is needed in order to no panic the system */

 is the fix for that in -7?

 -- 
 David A. Holland
 dholland@netbsd.org

From: Kamil Rytarowski <n54@gmx.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/51600: Tracer must detect zombie before child's parent
Date: Sat, 5 Nov 2016 22:57:59 +0100

 This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
 --Ko5bQEQUB4TnnstN6kJNdK2VvqrdXbphd
 Content-Type: multipart/mixed; boundary="uERH2mtSxXF22D2c5GD1LVtjM8RxTpumV"
 From: Kamil Rytarowski <n54@gmx.com>
 To: gnats-bugs@NetBSD.org
 Message-ID: <6d87e98f-cb95-6edf-2e25-0820e7070df6@gmx.com>
 Subject: Re: kern/51600: Tracer must detect zombie before child's parent
 References: <pr-kern-51600@gnats.netbsd.org>
  <20161105012720.757A37A2B2@mollari.NetBSD.org>
  <20161105204001.9F5DC7A2C7@mollari.NetBSD.org>
 In-Reply-To: <20161105204001.9F5DC7A2C7@mollari.NetBSD.org>

 --uERH2mtSxXF22D2c5GD1LVtjM8RxTpumV
 Content-Type: text/plain; charset=windows-1252
 Content-Transfer-Encoding: quoted-printable



 On 05.11.2016 21:40, David Holland wrote:
 > The following reply was made to PR kern/51600; it has been noted by GNA=
 TS.
 >=20
 > From: David Holland <dholland-bugs@netbsd.org>
 > To: gnats-bugs@NetBSD.org
 > Cc:=20
 > Subject: Re: kern/51600: Tracer must detect zombie before child's paren=
 t
 > Date: Sat, 5 Nov 2016 20:38:41 +0000
 >=20
 >  On Sat, Nov 05, 2016 at 01:30:01AM +0000, n54@gmx.com wrote:
 >   > Debugger must detect that a child has been terminated before the
 >   > child's parent.
 > =20
 >  Does this need to get into -7?
 > =20
 >  also,
 > =20
 >   > /* WARNING kernel newer than 2016-11-05 is needed in order to no pa=
 nic the system */
 > =20
 >  is the fix for that in -7?
 > =20
 >  --=20
 >  David A. Holland
 >  dholland@netbsd.org
 > =20
 >=20

 I checked both and the current answer is NO. If there is a volunteer to
 prepare -6/-7 patch sets I will prepare a list of commits to be applied
 at the end of this month. Right now I cannot duplicate the work checking
 multiple releases in order to accomplish the goals timely.


 --uERH2mtSxXF22D2c5GD1LVtjM8RxTpumV--

 --Ko5bQEQUB4TnnstN6kJNdK2VvqrdXbphd
 Content-Type: application/pgp-signature; name="signature.asc"
 Content-Description: OpenPGP digital signature
 Content-Disposition: attachment; filename="signature.asc"

 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2

 iQIcBAEBCAAGBQJYHlXtAAoJEEuzCOmwLnZsn9cP/1sdJvmt7e0rT2Uwr1+WcDHS
 4z8/GbPjDOXv9ulHr9G4MkaOWEPuwNIUnDQkqsr4f3c1wXQ24KvQV0fyyYNL087p
 jzzBqg3LBNqVWceQly6bVJQj2oyFGfHd9ACUDAG/uBYbSPzXVrUl+TjxRaFFh7G6
 sHFUrv3n9fA5s1N/2AT0rYMqHuGC6m4394cjSJ02801WfGY4p09bee037gTPNEaD
 bMUCGFHVGgoGAI+L+EFjSV+Cw+s8uLS+DDzInZemgHWAOBLwJatfHTWzVHU7j9g5
 Y+dq+znvRd0mtzQpwSNBDjH5UpeFNOkH5QyE8S20R5OJj+u2XU9GNF9CWvGAQLPG
 uBvRgPw7Q8pldwvwKJmDoDFTZ4O7D56QlfqaDQumWENmmYzucibtqAgKP2Yo/Ugk
 uJudxzRfp7r+KvHucCOL1wYCK4hGySuva+k5j7z+TpJBkuEYi/mj8bzEHUM7RZt9
 LEzYeb8rvZ91nHMWUf7a/DKTI7dIjAl8vnT4/fLWivrnMxvsrtjov+RhUlz/iB9N
 CZIqjfzZ0Czc55x+eh420VGJatverFOkfmPldIX0ehTISIMmwlBTqfsX4Mmc3E2Z
 zf36z5fdcifiIjf/oRXGN3OY45+VY2whSuvMzLgWY+ujGHubC8kw/QqqB5K+8kj9
 4jsqS8yjRHMqAqKsSJ8o
 =JssO
 -----END PGP SIGNATURE-----

 --Ko5bQEQUB4TnnstN6kJNdK2VvqrdXbphd--

State-Changed-From-To: closed->open
State-Changed-By: kre@NetBSD.org
State-Changed-When: Tue, 08 Nov 2016 01:35:48 +0000
State-Changed-Why:
This bug is not fixed, the problem is more likely with ptrace()
and the way it works than with wait().

The apparent fix for this just hid the problem, and caused PR 51606,
the fix for 51606 will be (effectively, and perhaps exactly) to
revert this fix.


From: "Robert Elz" <kre@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/51600 CVS commit: src/sys/kern
Date: Wed, 9 Nov 2016 00:30:17 +0000

 Module Name:	src
 Committed By:	kre
 Date:		Wed Nov  9 00:30:17 UTC 2016

 Modified Files:
 	src/sys/kern: kern_exit.c

 Log Message:
 PR kern/51600 ; PR standards/51606

 Revert 1.264 - that was intended to fix 51600, but didn't, it just
 hid the problem, and caused 51606.  This fixes 51606.

 Handle waiting on a process that has been detatched from its parent
 because of being ptrace'd by some other process.  This fixes 51600.
 ("handle" here means that the wait() hangs, or with WNOHANG, returns 0,
 we cannot actually wait on a process that is not currently an attached
 child.)

 Note: the detatched process waiting is not yet perfect (it fails to
 take account of options like WALLSIG and WALTSIG) - suport for those
 (that is, ignoring a detatched child that one of those options will
 later cause to be ignored when the process is re-attached.)

 For now, for ither than when waiting for a specific process ID, when
 a process does a wait() sys call (any of them), has no applicable
 children attached that can be returned, and has at least one detatched
 child, then we do a linear search of all processes to look for a
 suitable detatched child.  This is likely to be slow - but very rare.
 Eventually it might be better to keep a list of detatched children
 per process.


 To generate a diff of this commit:
 cvs rdiff -u -r1.264 -r1.265 src/sys/kern/kern_exit.c

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

Responsible-Changed-From-To: kern-bug-people->kre
Responsible-Changed-By: kre@NetBSD.org
Responsible-Changed-When: Wed, 09 Nov 2016 01:07:35 +0000
Responsible-Changed-Why:
I am (for now) handling this PR


State-Changed-From-To: open->feedback
State-Changed-By: kre@NetBSD.org
State-Changed-When: Wed, 09 Nov 2016 01:07:35 +0000
State-Changed-Why:
Can you confirm that the problem is now fixed (really fixed this time!)


From: Kamil Rytarowski <n54@gmx.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/51600 (Tracer must detect zombie before child's parent)
Date: Wed, 9 Nov 2016 02:14:50 +0100

 This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
 --08JcNv6FWlHBlx1WKnaTkai7xvO82SPJF
 Content-Type: multipart/mixed; boundary="USbOJe89KneGJlV8cTRBPPNWqUrAubw1C"
 From: Kamil Rytarowski <n54@gmx.com>
 To: gnats-bugs@NetBSD.org
 Message-ID: <f353efa8-6b87-6e67-1722-59465f117ab4@gmx.com>
 Subject: Re: kern/51600 (Tracer must detect zombie before child's parent)
 References: <pr-kern-51600@gnats.netbsd.org>
  <20161105012720.757A37A2B2@mollari.NetBSD.org>
  <20161109010735.A32617A2C8@mollari.NetBSD.org>
 In-Reply-To: <20161109010735.A32617A2C8@mollari.NetBSD.org>

 --USbOJe89KneGJlV8cTRBPPNWqUrAubw1C
 Content-Type: text/plain; charset=windows-1252
 Content-Transfer-Encoding: quoted-printable



 On 09.11.2016 02:07, kre@NetBSD.org wrote:
 > Synopsis: Tracer must detect zombie before child's parent
 >=20
 > Responsible-Changed-From-To: kern-bug-people->kre
 > Responsible-Changed-By: kre@NetBSD.org
 > Responsible-Changed-When: Wed, 09 Nov 2016 01:07:35 +0000
 > Responsible-Changed-Why:
 > I am (for now) handling this PR
 >=20
 >=20
 > State-Changed-From-To: open->feedback
 > State-Changed-By: kre@NetBSD.org
 > State-Changed-When: Wed, 09 Nov 2016 01:07:35 +0000
 > State-Changed-Why:
 > Can you confirm that the problem is now fixed (really fixed this time!)=

 >=20
 >=20
 >=20

 Thank you for working on it!

 I'm going to test your code.

 I have got also additional tests (still internal) for t_proc*. Your
 commit helps me to ultimately verify them (WNOHANG was generating
 failures) before pushing them to the sources.


 --USbOJe89KneGJlV8cTRBPPNWqUrAubw1C--

 --08JcNv6FWlHBlx1WKnaTkai7xvO82SPJF
 Content-Type: application/pgp-signature; name="signature.asc"
 Content-Description: OpenPGP digital signature
 Content-Disposition: attachment; filename="signature.asc"

 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2

 iQIcBAEBCAAGBQJYIniRAAoJEEuzCOmwLnZsmC4QAMBRIwpctlqI7lhgOP5oMb4q
 nevRB2VVTHdzkgmACTsl40qBK4hrIqW1gIgIYA7d8kKUQCSfQF3ZIZdN12cj2Kth
 dVknfsDjnvzWO0/YYG++MZ3KJoKfYD1wlRRrFrs801k3Q12ndG4dKqzD34yQmOAV
 K0S+cfgGL5IYaK/pvPkCjN7MXfK38aGUkRD51xo2fWLvyIzuARXiOAPo5Ak1mun5
 1ihfCxFxwiESgVrCse4IOl02WOOy/ampwVj0sJ0yv12QMijcSud8XJLlh7XbTRTK
 fkxdhV7TMOcRLBeDAyyy0sThUAuVndhiOf+8phqP8MKv6aIXc18Cv6ljFtRPA4qK
 RgOLg6whdr5P9ZRdMReLoWdjZOGW4crirEkcGXE9FWl5uvPhl6OR+FSiqt9JP/sj
 wFKhG3xoajANErW50I+QTvUlKVcRX45tQF/5Xz+P9CdSeBVdvLoBbKlOu5K07v+w
 lVyApYWE/YJpeCq7gCcHvdW+iJ86sNZ9DfR9vXu4mSZ2ZGal4N6n6q3H0lIP219n
 IqaWPgVLYlcGP2iqcctJWesmjjIgi9gAmq+9vzRTY5Vcn1sRn1oS6N9NdK/T5nAP
 NjafPGjNfFqXpeFbBU9OaRQB7sCEGiwJzuhgiICeBtF/tYA/F3kJF6MfHCQMytoO
 jbZeR16Bp4kqNbylN9sv
 =UOtt
 -----END PGP SIGNATURE-----

 --08JcNv6FWlHBlx1WKnaTkai7xvO82SPJF--

From: "Robert Elz" <kre@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/51600 CVS commit: src/tests/lib/libc/sys
Date: Wed, 9 Nov 2016 12:44:30 +0000

 Module Name:	src
 Committed By:	kre
 Date:		Wed Nov  9 12:44:29 UTC 2016

 Modified Files:
 	src/tests/lib/libc/sys: t_wait_noproc.c

 Log Message:
 PR standards/51600

 These tests are no longer expected to fail when called with WNOHANG
 (which is actually the t_wait_noproc_wnohang test but the sources are here.)


 To generate a diff of this commit:
 cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/sys/t_wait_noproc.c

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

From: Kamil Rytarowski <n54@gmx.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/51600 (Tracer must detect zombie before child's parent)
Date: Wed, 9 Nov 2016 18:54:55 +0100

 This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
 --mhx0k3D1SwFfVaslqo9qm44P6Gvpr7eeu
 Content-Type: multipart/mixed; boundary="AEPmLx11nnU92DFrjmpfxI9Mb1X2kcitC"
 From: Kamil Rytarowski <n54@gmx.com>
 To: gnats-bugs@NetBSD.org
 Message-ID: <f7c2171f-6de2-fefe-5f8c-9af4c845dc51@gmx.com>
 Subject: Re: kern/51600 (Tracer must detect zombie before child's parent)
 References: <pr-kern-51600@gnats.netbsd.org>
  <20161105012720.757A37A2B2@mollari.NetBSD.org>
  <20161109012000.D0F327A2AD@mollari.NetBSD.org>
 In-Reply-To: <20161109012000.D0F327A2AD@mollari.NetBSD.org>

 --AEPmLx11nnU92DFrjmpfxI9Mb1X2kcitC
 Content-Type: text/plain; charset=windows-1252
 Content-Transfer-Encoding: quoted-printable

 All tests pass and the code works properly. Thank you!


 --AEPmLx11nnU92DFrjmpfxI9Mb1X2kcitC--

 --mhx0k3D1SwFfVaslqo9qm44P6Gvpr7eeu
 Content-Type: application/pgp-signature; name="signature.asc"
 Content-Description: OpenPGP digital signature
 Content-Disposition: attachment; filename="signature.asc"

 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2

 iQIcBAEBCAAGBQJYI2L2AAoJEEuzCOmwLnZs5jMP/RTcsBBaaJn5bOhuKd2yRTuM
 1i86Dv4Kj5XE8gfaRbEGZByg9p+oia8d1RYME92vaNcYBFeBiUVACRStzAMyosvF
 JVAyQ5yPerhrJ2cB4rI6FledMcVXk+7ECpaU94V580Tcv75jmb1ahKT/hsLfmJEA
 LtqErWuCXBZowzYHWlPdJweLSFwiZzvU7o6aaiYY/iFw1VmsZ3XprTrCjaSFmojj
 ZzbSS9Mc9gEKQT5BWAc0K/SI5qAEfNmYjwQ+IzNF4FY+XZDeF8EV/EbRkdxtILmu
 DKz/aye5z3QHzxCBLYHe3E2jFWEfBw/22yP+EjNJHGqnuaLkofDYAlyXKdO2tooz
 pce15iMz2nzSJl6U1xmw1OUwko7sVhHYAApkSzwSwxaNGzNqIbAzEjQ3YS+FXsFG
 5iONV93yYE2hy8hUZ1dZgYtUgC81Kmjn6/k4+CN1LjfyMHtFkXdrBfH0sQy57fMR
 rk2L0xCAOCpoRLJlT3uWQrTRdXOXZClC9bRwHhLXvK0g5Qutia/Z4bPXZdh3TIuJ
 PVWRgM6ncl9Dg/3Pz6SmkThZEj20beAiYz8Hm5dlzNNGSO5CAP6fS6gJVIlIJmJl
 PV8gclgs2GOONKjT24ubmRhRAzFk3dogP4RZJsIO2//TxBqxY+pRiJNkfZQd1SRk
 3ou57j+HQdySJjMyHpn6
 =HPFX
 -----END PGP SIGNATURE-----

 --mhx0k3D1SwFfVaslqo9qm44P6Gvpr7eeu--

State-Changed-From-To: feedback->closed
State-Changed-By: kre@NetBSD.org
State-Changed-When: Wed, 09 Nov 2016 22:35:12 +0000
State-Changed-Why:
Submitter confirms that problem is fixed


From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/51600 (Tracer must detect zombie before child's parent)
Date: Fri, 18 Nov 2016 06:23:48 +0000

 On Wed, Nov 09, 2016 at 10:35:13PM +0000, kre@NetBSD.org wrote:
  > Synopsis: Tracer must detect zombie before child's parent
  > 
  > State-Changed-From-To: feedback->closed
  > State-Changed-By: kre@NetBSD.org
  > State-Changed-When: Wed, 09 Nov 2016 22:35:12 +0000
  > State-Changed-Why:
  > Submitter confirms that problem is fixed

 So, which commits ought to get into -7 (or -6)? The mention of panics
 with older kernels suggests that the answer is not "none of them". :-/

 -- 
 David A. Holland
 dholland@netbsd.org

From: Kamil Rytarowski <n54@gmx.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/51600 (Tracer must detect zombie before child's parent)
Date: Sat, 19 Nov 2016 05:59:24 +0100

 This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
 --1nun08g1s3dPqW1rutFGQQGxMUnvIKo7d
 Content-Type: multipart/mixed; boundary="CrP5KpwCq8FUJ9QguLhM068q95Fs0m5gj"
 From: Kamil Rytarowski <n54@gmx.com>
 To: gnats-bugs@NetBSD.org
 Message-ID: <f765635b-b677-2a18-a806-e94c187c0d3f@gmx.com>
 Subject: Re: kern/51600 (Tracer must detect zombie before child's parent)
 References: <pr-kern-51600@gnats.netbsd.org>
  <20161105012720.757A37A2B2@mollari.NetBSD.org>
  <20161118062501.9BF177A2FF@mollari.NetBSD.org>
 In-Reply-To: <20161118062501.9BF177A2FF@mollari.NetBSD.org>

 --CrP5KpwCq8FUJ9QguLhM068q95Fs0m5gj
 Content-Type: text/plain; charset=windows-1252
 Content-Transfer-Encoding: quoted-printable



 On 18.11.2016 07:25, David Holland wrote:
 > The following reply was made to PR kern/51600; it has been noted by GNA=
 TS.
 >=20
 > From: David Holland <dholland-bugs@netbsd.org>
 > To: gnats-bugs@NetBSD.org
 > Cc:=20
 > Subject: Re: kern/51600 (Tracer must detect zombie before child's paren=
 t)
 > Date: Fri, 18 Nov 2016 06:23:48 +0000
 >=20
 >  On Wed, Nov 09, 2016 at 10:35:13PM +0000, kre@NetBSD.org wrote:
 >   > Synopsis: Tracer must detect zombie before child's parent
 >   >=20
 >   > State-Changed-From-To: feedback->closed
 >   > State-Changed-By: kre@NetBSD.org
 >   > State-Changed-When: Wed, 09 Nov 2016 22:35:12 +0000
 >   > State-Changed-Why:
 >   > Submitter confirms that problem is fixed
 > =20
 >  So, which commits ought to get into -7 (or -6)? The mention of panics
 >  with older kernels suggests that the answer is not "none of them". :-/=

 > =20
 >  --=20
 >  David A. Holland
 >  dholland@netbsd.org
 > =20
 >=20

 I will prepare a list of patches to be back-ported during weekend.


 --CrP5KpwCq8FUJ9QguLhM068q95Fs0m5gj--

 --1nun08g1s3dPqW1rutFGQQGxMUnvIKo7d
 Content-Type: application/pgp-signature; name="signature.asc"
 Content-Description: OpenPGP digital signature
 Content-Disposition: attachment; filename="signature.asc"

 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2

 iQIcBAEBCAAGBQJYL9w0AAoJEEuzCOmwLnZsXzMQAKDGMzWNIV8I1+wO++/+eo7q
 JFl+PlcwRKJwUk235tPYNib6ilX8x0e+J+CQn2OQg2uJjXIV08dxh2UgyCYnr34G
 vcmyf6B6GugUryTb+Usgg1eTrgrVwXieXy377ayyPvTMzSzrPeAuCCLiRsc465by
 j9VcvHg2hIh9q+6f9d8Oqd53hD2p41HQWy8jL03xp/POmjrDKiWLlMlQ91eYfqIQ
 +ElNbbqq10ts63WNz2l5Zf5RmCVYYU7oxSw1NFDUc/xhEJ/l5jRuMWaiwq+thiH/
 QXE+x2JAimuDPw3a7InnT6BCVc3pPDMfYqbSQO9ctlLo666j/jLogpzOR4WbcqfJ
 8usCj5tP/y+AgEjcbyY9sS8VUugBRu3Z7pvW+APGqJAWS1C7hTr2LxXYhsg/zoyy
 8BlQxNPgTNGR9YtFaF2uNJOeGIa409uFZUj7JnIcSMOqYoxCcvPh858UZ4DwIcoo
 P3e3iccMpMhpMo4QIVpWjk0STPa4cgdi7rqG6hBAZYSSstZ7YwN0XuiRMbszuoZe
 z0OZFYw4fTRgxq9Ca0PEu/bQOXiFAv+JaVdOFLDD8S5zSW+4KTxCcY8vX9f1csZY
 mKeoPdYfdkl0k7cahlW2hO/hXbOCM2BkVnVqq7kGIBEy7glVSc6sonkJzz3B0H3K
 G14OCFA4rG1dX2q9wsN8
 =XkxE
 -----END PGP SIGNATURE-----

 --1nun08g1s3dPqW1rutFGQQGxMUnvIKo7d--

From: Robert Elz <kre@munnari.OZ.AU>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/51600 (Tracer must detect zombie before child's parent)
Date: Sat, 19 Nov 2016 12:58:28 +0700

     Date:        Sat, 19 Nov 2016 05:05:01 +0000 (UTC)
     From:        Kamil Rytarowski <n54@gmx.com>
     Message-ID:  <20161119050501.3EA5F7A30C@mollari.NetBSD.org>

   |  I will prepare a list of patches to be back-ported during weekend.

 The one that matters is kern_exit.c 1.261 -> 1.262 (Christos, 2016-11-04).

 (It would not hurt to also fix the preceding comment, which currently says
 that what is now being done (to fix the panic) is not necessary...)

 All the rest of the bugs you've been finding are either in new code in
 current (most of them), or so esoteric that they're probably not really
 worth pulling up.

 kre

From: Kamil Rytarowski <n54@gmx.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/51600 (Tracer must detect zombie before child's parent)
Date: Sat, 19 Nov 2016 16:19:17 +0100

 This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
 --UKuQdlGCp0EWXclLu4biSSBK1hWaJHrmG
 Content-Type: multipart/mixed; boundary="OBpKn1b1a69FrtqTVTll2ERoVxOpUii3N"
 From: Kamil Rytarowski <n54@gmx.com>
 To: gnats-bugs@NetBSD.org
 Message-ID: <db6c5431-d857-efc9-c444-37fccc3ece7d@gmx.com>
 Subject: Re: kern/51600 (Tracer must detect zombie before child's parent)
 References: <pr-kern-51600@gnats.netbsd.org>
  <20161105012720.757A37A2B2@mollari.NetBSD.org>
  <20161119060001.AD84B7A30B@mollari.NetBSD.org>
 In-Reply-To: <20161119060001.AD84B7A30B@mollari.NetBSD.org>

 --OBpKn1b1a69FrtqTVTll2ERoVxOpUii3N
 Content-Type: text/plain; charset=windows-1252
 Content-Transfer-Encoding: quoted-printable



 On 19.11.2016 07:00, Robert Elz wrote:
 > The following reply was made to PR kern/51600; it has been noted by GNA=
 TS.
 >=20
 > From: Robert Elz <kre@munnari.OZ.AU>
 > To: gnats-bugs@NetBSD.org
 > Cc:=20
 > Subject: Re: kern/51600 (Tracer must detect zombie before child's paren=
 t)
 > Date: Sat, 19 Nov 2016 12:58:28 +0700
 >=20
 >      Date:        Sat, 19 Nov 2016 05:05:01 +0000 (UTC)
 >      From:        Kamil Rytarowski <n54@gmx.com>
 >      Message-ID:  <20161119050501.3EA5F7A30C@mollari.NetBSD.org>
 > =20
 >    |  I will prepare a list of patches to be back-ported during weekend=
 =2E
 > =20
 >  The one that matters is kern_exit.c 1.261 -> 1.262 (Christos, 2016-11-=
 04).
 > =20
 >  (It would not hurt to also fix the preceding comment, which currently =
 says
 >  that what is now being done (to fix the panic) is not necessary...)
 > =20

 Right.

 >  All the rest of the bugs you've been finding are either in new code in=

 >  current (most of them), or so esoteric that they're probably not reall=
 y
 >  worth pulling up.
 > =20

 I'm still evaluating whether it's worth to support LLDB in -7 or -6..
 perhaps little point, while technically possible there would be rather
 needed a vendor to request/fund it. And there are more parts than
 wait(2) and ptrace(2) to make it clear (real-time signals, libpanel, new
 libstdc++ is helpful...).

 For now that single mentioned commit shall be enough.

 >  kre
 > =20
 >=20



 --OBpKn1b1a69FrtqTVTll2ERoVxOpUii3N--

 --UKuQdlGCp0EWXclLu4biSSBK1hWaJHrmG
 Content-Type: application/pgp-signature; name="signature.asc"
 Content-Description: OpenPGP digital signature
 Content-Disposition: attachment; filename="signature.asc"

 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2

 iQIcBAEBCAAGBQJYMG2DAAoJEEuzCOmwLnZssV8P+wTfNIs1SfT8pRMwH7iPX1UQ
 bv1IcS77u8tPmh+f89oe2Dgw5gpqwM+Y3oSPRLF6e9q7dsUdEWNkhmRzdTfHnTEY
 ItJ4ddT+iy/Kyc8ySRZz4QLBoYPwq9bx9FLVDAyrgq+1SbhXMn7JbM/7kBCOwqDu
 34cJJBfERewgY54xre7n60qEpFinepAEwv/d0UCFJhT+06dSBmCl7I9XmKnwgRL9
 5B4MKoLQ8aVSMzppItLnabcCyBMzazLkYuHKTtdV/XohF316xQkXjsRDuNHHXf8l
 Zk6UXX2nVz+ENYmdJ+0UKBMCqNax1COo4b06voSAHWZOZ59h7I2vlPU73vUSOcAY
 SbvmyFLgxa6uFxXzE0lK8oH8mjR7+T50UYaSyXny2kTjIDhfea68DbzrSdNMhJuF
 ip9qrtfnnf6zWgm8T4CHolXxsLdCNS94vZot3KL4U4QiKnKWcYcQTEYttQug9LdY
 Fjm9NgCG0qW/0yfbGEbJcHRdb94ixh30cQs5mHNcBXcC7rJvfagWn4L0OoxeVv63
 bEToPu2rH4Gy9Lb6p1vUfpZR+cuifFucURxpd79pJQ9fzNCm3WfjAeoQVBSN1OQM
 gGDCgPjUgjygrsRpi8IBv+4Obe5I7xn60oZImVZEew1jsXP8K0xAFsSUeCUhZ1Qv
 z0rKpj50x0t2rQ3dpPe6
 =LRXD
 -----END PGP SIGNATURE-----

 --UKuQdlGCp0EWXclLu4biSSBK1hWaJHrmG--

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