Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/kern



This caused regressions in t_ptrace_wait* tests and random
hangs/timeouts/failures.

If I revert the pipe(2) changes on top of NetBSD-current, the test is no
longer racy again.

http://netbsd.org/~kamil/patch-00249-pipe-revert.txt

Reproducer:

cd /usr/tests/lib/libc/sys
./t_ptrace_waitpid  tracer_sysctl_lookup_without_duplicates


It fails in a non-deterministic number of iterations:

[ 126.7088900] sorry, pid 20803 was killed: orphaned traced process
failed: /usr/src/tests/lib/libc/sys/t_ptrace_topology_wait.h:191:
msg_read_child("tracer ready" " from parent " "parent_tracer",
&parent_tracer, &msg, sizeof(msg)) == 0: Undefined error: 0

With this patch it is easier to reproduce the race:

Index: t_ptrace_topology_wait.h
===================================================================
RCS file: /cvsroot/src/tests/lib/libc/sys/t_ptrace_topology_wait.h,v
retrieving revision 1.1
diff -u -r1.1 t_ptrace_topology_wait.h
--- t_ptrace_topology_wait.h	5 May 2020 00:33:37 -0000	1.1
+++ t_ptrace_topology_wait.h	6 May 2020 10:32:37 -0000
@@ -248,7 +248,7 @@
 ATF_TC(tracer_sysctl_lookup_without_duplicates);
 ATF_TC_HEAD(tracer_sysctl_lookup_without_duplicates, tc)
 {
-	atf_tc_set_md_var(tc, "timeout", "15");
+//	atf_tc_set_md_var(tc, "timeout", "15");
 	atf_tc_set_md_var(tc, "descr",
 	    "Assert that await_zombie() in attach1 always finds a single "
 	    "process and no other error is reported");
@@ -269,11 +269,13 @@
 	start = time(NULL);
 	while (true) {
 		DPRINTF("Step: %lu\n", N);
+		if (N % 100 == 0)
+			printf("Step: %lu\n", N);
 		tracer_sees_terminaton_before_the_parent_raw(true, false,
 		                                             false);
 		end = time(NULL);
 		diff = difftime(end, start);
-		if (diff >= 5.0)
+		if (diff >= 30.0)
 			break;
 		++N;
 	}


Can you have a look?

On 26.04.2019 19:20, Michael van Elst wrote:
> Module Name:	src
> Committed By:	mlelstv
> Date:		Fri Apr 26 17:20:49 UTC 2019
> 
> Modified Files:
> 	src/sys/kern: sys_pipe.c
> 
> Log Message:
> Clean up pipe structure before recycling it.
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.146 -r1.147 src/sys/kern/sys_pipe.c
> 
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
> 
> 
> Modified files:
> 
> Index: src/sys/kern/sys_pipe.c
> diff -u src/sys/kern/sys_pipe.c:1.146 src/sys/kern/sys_pipe.c:1.147
> --- src/sys/kern/sys_pipe.c:1.146	Sun Jun 10 17:54:51 2018
> +++ src/sys/kern/sys_pipe.c	Fri Apr 26 17:20:49 2019
> @@ -1,4 +1,4 @@
> -/*	$NetBSD: sys_pipe.c,v 1.146 2018/06/10 17:54:51 jdolecek Exp $	*/
> +/*	$NetBSD: sys_pipe.c,v 1.147 2019/04/26 17:20:49 mlelstv Exp $	*/
>  
>  /*-
>   * Copyright (c) 2003, 2007, 2008, 2009 The NetBSD Foundation, Inc.
> @@ -68,7 +68,7 @@
>   */
>  
>  #include <sys/cdefs.h>
> -__KERNEL_RCSID(0, "$NetBSD: sys_pipe.c,v 1.146 2018/06/10 17:54:51 jdolecek Exp $");
> +__KERNEL_RCSID(0, "$NetBSD: sys_pipe.c,v 1.147 2019/04/26 17:20:49 mlelstv Exp $");
>  
>  #include <sys/param.h>
>  #include <sys/systm.h>
> @@ -1331,6 +1331,8 @@ pipeclose(struct pipe *pipe)
>      free_resources:
>  	pipe->pipe_pgid = 0;
>  	pipe->pipe_state = PIPE_SIGNALR;
> +	pipe->pipe_peer = NULL;
> +	pipe->pipe_lock = NULL;
>  	pipe_free_kmem(pipe);
>  	if (pipe->pipe_kmem != 0) {
>  		pool_cache_put(pipe_rd_cache, pipe);
> 


Attachment: signature.asc
Description: OpenPGP digital signature



Home | Main Index | Thread Index | Old Index