From nobody Wed Apr 17 08:13:38 2024 X-Original-To: dev-commits-src-all@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 4VKDFG60h5z5J6kV; Wed, 17 Apr 2024 08:13:38 +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 4VKDFG5Pxpz49Ph; Wed, 17 Apr 2024 08:13:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713341618; 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=79DNWynvSbUkSLOXJmTgCbWFl/vBzJb0PpogRAF/YX8=; b=RuXoYWS8fSofGbKFl+oA/0nWnm4THe+iA6cnPXKG4uL68EGneCPuGUwlNrmkXsnT3KKgjd hoBDHFyM5I7vbEMyLHAq+H3XMhx6wHi3ajh9SnwJ66Df6h7zx+o5hvMvD45fgbq3hNvfuI gz6FUvhCzqxkveydjwzHrtT00+Uj7PVkj37kxYME5tTTTYd1wTuA/nE5i4VmfULlZGt10M E18zKQyizhRsURNgbIcZ21V1oyRb7aOs8sBNStnE2UZ3ZGOfneWTooJ5KyXu2eXB+qHkrp zPcf2UTzEX/MWMwyH1oQ1iWvuxLUMhx6EG2BAf7sh/tSd8ce6B/DwD+gqMKqMQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713341618; a=rsa-sha256; cv=none; b=WKNstft1rxhXxQRWDk9leXB5DTBw4YhCMJjN6EuxBH/D/6Alr1B9yh28+xb7LGC6zdmkFn OR5yeexhaEzACJEyDZQ52sjGXZfIyDgss2CZU8+ZbcJ+JJnvvMtBM2cHtCiURZndJfiFku lPO+yJ4WEMRHUU+4HZ3I5XaFLznM7kY9yWDscCc2sA6V/HW2MW4+zopMrN7zvbsnz72Euu Y9y/fk0jkDz0bne7fJvxH/iiUeaXQW6bzcWPBV8vCL2LOHirGTAEwCf3bTUOthEqd8keeM SR8d+RKuHzmnBnVE6ROa5wuomRlQmcoXFM4rtgNIK2CIc94XcB9s4xmuexOQ5g== 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=1713341618; 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=79DNWynvSbUkSLOXJmTgCbWFl/vBzJb0PpogRAF/YX8=; b=EuCxE0sGTaL4Rhfxv5BZrTuavWA6TZYKOlJnM+C22aCNiLyVFdQiUeI874iP0giogYEg55 GjgLF8U0d/dJmZUCHE6JY//sCAJvKKQYP8f+c6Cf8UKUCwZh73poqtjYRlUa1qYuwKJeOU kaSphCeODWx9yBmv61mV8ZzZLip4gdqtbP7ujtPvWt2SaucJN6ZoQfMT8WdR4gUosNgjSq oPBMj9gUyshdVG3QdbA1btSPStGS5EqCwFuhzFm2CLZ7Hj+LkS6Jlsw8DvHsLBbrEKF/bP OO41T+EEK2s4MIna+3DmGPT7g3uczAtde/kw8oNe/OkY9FBxJtVOP6cOHDKeLw== 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 4VKDFG51CpzJsQ; Wed, 17 Apr 2024 08:13:38 +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 43H8Dcr9062222; Wed, 17 Apr 2024 08:13:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43H8Dcjm062219; Wed, 17 Apr 2024 08:13:38 GMT (envelope-from git) Date: Wed, 17 Apr 2024 08:13:38 GMT Message-Id: <202404170813.43H8Dcjm062219@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: a6caa7bc5423 - stable/13 - stop_all_proc(): skip traced or signal-stoped processes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/stable/13 X-Git-Reftype: branch X-Git-Commit: a6caa7bc54235cdc1599038fe4164015c2931545 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a6caa7bc54235cdc1599038fe4164015c2931545 commit a6caa7bc54235cdc1599038fe4164015c2931545 Author: Konstantin Belousov AuthorDate: 2024-04-04 19:24:32 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-17 08:13:17 +0000 stop_all_proc(): skip traced or signal-stoped processes (cherry picked from commit 235436d6311ea5ad00edcc1e553012f0736ea86d) --- 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 61c389f0b345..23d2856a3d32 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -3385,7 +3385,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; } @@ -3406,6 +3407,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);