From nobody Fri Apr 12 01:18:39 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 4VFzGl4K38z5GXj7; Fri, 12 Apr 2024 01:18:39 +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 4VFzGl3pRCz4Pln; Fri, 12 Apr 2024 01:18:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712884719; 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=I1kGUlNjbE0b2rwHbN/MO1Hh3hdw6ip6yuzf8SaG5vU=; b=exH0mGtmMeiAZKRiXJCMVlaGvA+34o5hDz/0RFFQa+ACIeRcZ9NEkN5Fl4hdkOqAUnhImy YwM2Zj+4bIEsbihAQPrNc/6de+pYZ7t+zXNW8+ZjxdalzKmrF0objcUDEQ8vVzW7ydiBCL w2iSi+gVIsr5IJ2NDrzDOh8SbbNWKaSWXRwu1tDw8KpSvd73vdNN9dcBpHR+UytAkUcWBm 30r4DQ53+hNQMjrLRr8KA1sPXX1ZNxv0KD6uqDYFskxM4Mdpi3Wa6p9z6lJaIbnsvoPcLQ mA63pArrvM1HKreGBKw7mTcbkyx7AnFXZFz6LgjoDfZpoIGZASBmvqC6V0qqhg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712884719; a=rsa-sha256; cv=none; b=H3dmhXao0uy3v0GDQKw5zYzHmmoFxO5E5xh+8PfcGJ4k+whr5vGsyy7ge/oxV+Uk3kqfbq /SCje7vxYXUxspUhovU4ZDk03YTrs+MrSDurtyx+qkmH3zF+n/fzh6xxPhPoFKjBElUkuO +WiWk+TfMs/uoakS7iApnMSG2ojdMRJuTWvdYEg44Wc06VuwyibukodFEP/dfQcPIho9hR uPILdZmxtXU4sakj6gfKrEzNNsqu5T8wmsuDQQclcNqb5iniyXBiBiPTibPk0WZRXPymYZ WZMyNPO0VDqFFrcBTo1UVPVSKZ40GgUQ4jILuBZTxr5951RBS9k+dFgfsRd+hQ== 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=1712884719; 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=I1kGUlNjbE0b2rwHbN/MO1Hh3hdw6ip6yuzf8SaG5vU=; b=NF5T6FNwM+usxAapJiQFt8DhSmakQdkJlQisEu4RuMNPushaFBRGh4tSRuMaenzYqs7O1a mvtyfKVNRWkYsPNPJV/qqRu9bhIVhRgcpYl/Fc6rYL2jOSa4uUoLy+VMJPlF7vZeCiY5Lq oOpFyN9fUZzV2eJDF+OqBvfeOMA9rBLlbCUxZp1VQ/Yvkbch9bhiT2HM971OeJu3W848wl 4dwRPgNZLuJ34SwE+DAi8sGopkBHjhNsdInitXbsEoq6VSfBd4FlHX66IKtfgh7uqfNKen T+2QNq/YZm5cruM93b8ubj+IgDPzwWYMOgf9UfWTbvDIE/ZbTZGVIE2MD4g5vQ== 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 4VFzGl3HdrzSyb; Fri, 12 Apr 2024 01:18:39 +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 43C1IdQ7050196; Fri, 12 Apr 2024 01:18:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43C1IdS8050193; Fri, 12 Apr 2024 01:18:39 GMT (envelope-from git) Date: Fri, 12 Apr 2024 01:18:39 GMT Message-Id: <202404120118.43C1IdS8050193@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: a648f68c9254 - stable/14 - 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: Sender: dev-commits-src-all+owner@freebsd.org X-BeenThere: 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/14 X-Git-Reftype: branch X-Git-Commit: a648f68c9254158af772ee589884adbc85a9a504 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a648f68c9254158af772ee589884adbc85a9a504 commit a648f68c9254158af772ee589884adbc85a9a504 Author: Konstantin Belousov AuthorDate: 2024-04-04 19:24:32 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-12 01:18:32 +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 936d410133eb..b52455f140b2 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -3479,7 +3479,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; } @@ -3500,6 +3501,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);