Module Name:    src
Committed By:   kamil
Date:           Thu Nov  3 18:25:54 UTC 2016

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

Log Message:
Mark ptraceme4 as expected failure, assume that Linux&FreeBSD are correct

Raising SIGCONT from a ptrace(2)d child should be catched with waidpid(2)
as WIFCONTINUED() false and WIFSTOPPED() true; not both true as it does not
make much sense.

PR kern/51596

Change requested by <kre>
Checked by <christos>

Sponsored by <The NetBSD Foundation>


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 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.

Modified files:

Index: src/tests/kernel/t_ptrace.c
diff -u src/tests/kernel/t_ptrace.c:1.4 src/tests/kernel/t_ptrace.c:1.5
--- src/tests/kernel/t_ptrace.c:1.4	Thu Nov  3 11:20:45 2016
+++ src/tests/kernel/t_ptrace.c	Thu Nov  3 18:25:54 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace.c,v 1.4 2016/11/03 11:20:45 kamil Exp $	*/
+/*	$NetBSD: t_ptrace.c,v 1.5 2016/11/03 18:25:54 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_ptrace.c,v 1.4 2016/11/03 11:20:45 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace.c,v 1.5 2016/11/03 18:25:54 kamil Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -395,6 +395,12 @@ ATF_TC_BODY(traceme4, tc)
 	const int sigval = SIGSTOP, sigsent = SIGCONT;
 	pid_t child, wpid;
 
+	/* XXX: Linux&FreeBSD and NetBSD have different behavior here.
+	 * Assume that they are right and NetBSD is wrong.
+	 * The ptrace(2) interface is out of POSIX scope so there is no
+	 * ultimate standard to verify it. */
+	atf_tc_expect_fail("PR kern/51596");
+
 	printf("1: Before forking process PID=%d\n", getpid());
 	ATF_REQUIRE((child = fork()) != -1);
 	if (child == 0) {
@@ -459,11 +465,8 @@ ATF_TC_BODY(traceme4, tc)
 		printf("1: Ensuring that the child has not been exited\n");
 		ATF_REQUIRE(!WIFEXITED(status));
 
-		/* XXX: Linux and NetBSD behavior differ here, is it a bug or
-		 * a valid result? ptrace(2) is out of POSIX scope so there is
-		 * no standard to verify it. */
-		printf("1: Ensuring that the child has been continued\n");
-		ATF_REQUIRE(WIFCONTINUED(status));
+		printf("1: Ensuring that the child has not been continued\n");
+		ATF_REQUIRE(!WIFCONTINUED(status));
 
 		printf("1: Ensuring that the child has not been terminated "
 		    "with a signal\n");

Reply via email to