Module Name: src Committed By: kamil Date: Sun Oct 13 04:00:12 UTC 2019
Modified Files: src/tests/lib/libc/sys: t_ptrace_wait.c Log Message: Bump the number of threads in LWP t_ptrace_wait*() tests from to 100 This is a torture, but on purpose to catch LWP_CREATED and LWP_EXITED bugs. The threads do nothing other than calling sched_yield() in a loop. MAXLWP is now defined to 2048 on all ports. This change effects the following tests: - trace_thread_nolwpevents - trace_thread_lwpexit - trace_thread_lwpcreate - trace_thread_lwpcreate_and_exit To generate a diff of this commit: cvs rdiff -u -r1.134 -r1.135 src/tests/lib/libc/sys/t_ptrace_wait.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/lib/libc/sys/t_ptrace_wait.c diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.134 src/tests/lib/libc/sys/t_ptrace_wait.c:1.135 --- src/tests/lib/libc/sys/t_ptrace_wait.c:1.134 Wed Oct 2 23:15:09 2019 +++ src/tests/lib/libc/sys/t_ptrace_wait.c Sun Oct 13 04:00:12 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: t_ptrace_wait.c,v 1.134 2019/10/02 23:15:09 kamil Exp $ */ +/* $NetBSD: t_ptrace_wait.c,v 1.135 2019/10/13 04:00:12 kamil Exp $ */ /*- * Copyright (c) 2016, 2017, 2018, 2019 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: t_ptrace_wait.c,v 1.134 2019/10/02 23:15:09 kamil Exp $"); +__RCSID("$NetBSD: t_ptrace_wait.c,v 1.135 2019/10/13 04:00:12 kamil Exp $"); #include <sys/param.h> #include <sys/types.h> @@ -5455,6 +5455,8 @@ TRACEME_EXEC(traceme_signalignored_exec, /// ---------------------------------------------------------------------------- +#define TRACE_THREADS_NUM 100 + static volatile int done; static void * @@ -5463,8 +5465,8 @@ trace_threads_cb(void *arg __unused) done++; - while (done < 3) - continue; + while (done < TRACE_THREADS_NUM) + sched_yield(); return NULL; } @@ -5483,7 +5485,7 @@ trace_threads(bool trace_create, bool tr const int elen = sizeof(event); struct ptrace_siginfo info; - pthread_t t[3]; + pthread_t t[TRACE_THREADS_NUM]; int rv; size_t n; lwpid_t lid;