From nobody Fri Apr 05 14:52:58 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VB1gZ6CbNz5Gbvv; Fri, 5 Apr 2024 14:52:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VB1gZ5Swfz4Gcn; Fri, 5 Apr 2024 14:52:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712328778; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aEQHxdp/TwrgIsY2qO+Fg7GhoADxqnZDQGuq7VGb1f0=; b=Rd4B8W3lfOx4LiXliaiRHaP0n4qxCpJ5fmjzka8rpCfWuH02eEZzxeNKbKgIzqcnW5u2i4 sqtQn0zXVHTxwqNci3nEXSw4zufHwOiljp1V9kclErsNd3TpjLJcyNGHbmo6mrjCr5GYs8 NwzxA/uk8gOROf4OSwbr4gyOBeCkzP0KsbyatmDeTPkbaOEJfNLjj4cXUQW31ywt2RwtNM /2Y39PgCeW4K9cPCy9lCTUTfz/lj8Iegss8CwKgNVev2X+1kC5/WlnToQVRWlbSWJJtZxQ Rc+lsjjWf+FUiXXgWrFd8/0jY06YoznBnE0zTXbEFVxmA4DiL5D7n9xulGUFPA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712328778; a=rsa-sha256; cv=none; b=DMOXD0DUgayfx9YbwnYs9dbK4cSjcrXFvGbk8sQ6hYF3tXnHpm2dRr09Lh6f0Vbpsf9AM8 w3izjcvcO8Fd9k4XY2b6p17BfsXup7V2RbDe4hcnb3Bfx528pzdIjEv5HxK+8NxaWtkWKa wF1Aup0SuehLQ30ZsdGirVablLaSKOiKx64gWqnIQiRhZT4pG6rtOuGpV+bl7MWSsCNpSv lOCstUp83X5hL/q89TXXK9Fe/VRmDo1uwNc5S9lAE+zi+ehMBjBWY7T5igBCjkwjAdRv38 w7Mx2KR5+jvWPHfYSQST9CyyvYL+uGb0BnwULBwRYQPXBfNNQtkCqKlGqt20cQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712328778; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aEQHxdp/TwrgIsY2qO+Fg7GhoADxqnZDQGuq7VGb1f0=; b=AA+6q5nWp6P6juOhooO/3e30l7gD6DDyx+xlT9/C5lV67FWtQK+5Dc2Nh4E8sd6Gf5PmND gkbrJ+KFEADpqo2ycMPlY8Pg7mHfgQeZrA5FtiMpUMgkBINs4MbG8v7pobYJ6xNxxrPKAp cXJQOx/931CpE4xmaBmuDgjL95YpyEvoirdpIkGAAbOCMYK36t2hBvRGEXZLR8Ec73J0aE zYElO4rhie3AlBnW3O7ogH6OjrxhUoVX7K5mPoCMqSpBdsSdtre4MFFFn+6jjAF11vI0f1 EgwW55vaP/3qSAJeqpqF/BjW5b8hiYAwrDMRQn2sDYQ3lU0flEMLiHIIp1W+tw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VB1gZ510Yz14Mg; Fri, 5 Apr 2024 14:52:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 435EqwiI042337; Fri, 5 Apr 2024 14:52:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 435Eqwhs042334; Fri, 5 Apr 2024 14:52:58 GMT (envelope-from git) Date: Fri, 5 Apr 2024 14:52:58 GMT Message-Id: <202404051452.435Eqwhs042334@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 235436d6311e - main - stop_all_proc(): skip traced or signal-stoped processes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 235436d6311ea5ad00edcc1e553012f0736ea86d Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=235436d6311ea5ad00edcc1e553012f0736ea86d commit 235436d6311ea5ad00edcc1e553012f0736ea86d Author: Konstantin Belousov AuthorDate: 2024-04-04 19:24:32 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-05 14:52:39 +0000 stop_all_proc(): skip traced or signal-stoped processes Since thread_single(SINGLE_ALLPROC) ignores them since 9241ebc796c, and there is not much we can do for the debugger-controlled process. Noted by: olce Reviewed by: markj, olce Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D44638 --- sys/kern/kern_proc.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 8a396e208ff6..2ecc82026b3f 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -3477,7 +3477,8 @@ allproc_loop: LIST_REMOVE(cp, p_list); LIST_INSERT_AFTER(p, cp, p_list); PROC_LOCK(p); - if ((p->p_flag & (P_KPROC | P_SYSTEM | P_TOTAL_STOP)) != 0) { + if ((p->p_flag & (P_KPROC | P_SYSTEM | P_TOTAL_STOP | + P_STOPPED_SIG)) != 0) { PROC_UNLOCK(p); continue; } @@ -3498,6 +3499,16 @@ allproc_loop: PROC_UNLOCK(p); continue; } + if ((p->p_flag & P_TRACED) != 0) { + /* + * thread_single() below cannot stop traced p, + * so skip it. OTOH, we cannot require + * restart because debugger might be either + * already stopped or traced as well. + */ + PROC_UNLOCK(p); + continue; + } sx_xunlock(&allproc_lock); _PHOLD(p); r = thread_single(p, SINGLE_ALLPROC);