From nobody Sat Mar 30 14:50:34 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 4V6KvZ2CtQz5Fmbn; Sat, 30 Mar 2024 14:50:34 +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 4V6KvZ1lD0z49jC; Sat, 30 Mar 2024 14:50:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711810234; 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=283eW5lKuHoTFxp+E3gkPRAMofUWdK7CMCsd3xodDXk=; b=aodQWKNNu3XTg0S/naf/0thq7kkZrN1KMkYmLUfR8swWHChWtqQFGOx3JwxEg4EPSXwhlR BX6AFofPv/yb5rC00qF5JjWeiqCkxTz3MXZ5ikDYazHTPlbbKWt/UlZWHitNZYHKbAME43 rarHHjSXYVpXz2BO3USLU4rlwF+jAYyrI6+svXTSmJsHv34g98L8e7t9MI5oU9Y774gnF5 NqIFpmBylTbIrv2B00Nu/u0HoiXwctLU+lIsSIlnkryVeYfbVIbIf+m/3y2u/udGuOzrQf pfy7jNzLFUej4Ohyjh8SEGEIQVUkMn6m/qBdy/CzMgMfAFkiCvEuoWEuWEZuVw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711810234; a=rsa-sha256; cv=none; b=C2nksULnrUIHd8Per7Hdj93d4VhrzpDstym4/JZ09Nw0/lPvxokz7Ku226OZGq6mJHVecb REUiU0vS3akjoFICIJw03HfTwkjg+8V8/BsMPS5jbjFcZDMp7J/+jvKD4aE5ahpXsrY6Wp UF3lnCttEj8fSkDum8+WZHrM1hmJzG172b5QVuphhDMq2wZEdpFopHcx7SVIYsQAC65ala Ez9oeB7OpV1Vm9yodKrg7dclyn0d8bh/IRuL0Qbw0E8NfwC8t5udYyJY5Z9By92OXYfN+A Wfgd31YgfZnST2J8nl7zhKBrJbMS1UcP2aAhSolqFLlETzHuDRYSw6iGl+762A== 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=1711810234; 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=283eW5lKuHoTFxp+E3gkPRAMofUWdK7CMCsd3xodDXk=; b=Go7Sq+MLXHiFN2vJ4mqfpeUl6BW6O1TZ24Lak0s01GHjos8SgrV9ZNx/RkjMv/u8vtPHR8 I1HLbRBEHDa1B+HCr5uqrqkwRfY2r2MlZhwvErzshqUXt3rqDd07rs4hY7MVUzL+BnMn4s b/+vzm5RB23vCn7PKAFjEjoOXFzFmETR0ZyYLf/HS28jhmraWH/PbBXWalbD7jUzpXQdV6 4mo6puW5HsiP1qJtWK3+hpFbZkjYSFVu/KG1zJ6lDlBRyI4ZKjwlfyLlD+zcg178nEcyxw BeC4Ce/rRGoxUSj2bIYAWtbEMr3PpRuRWh5/krkdSlP80gyxNvOccifO51xV8w== 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 4V6KvZ1HX7zy69; Sat, 30 Mar 2024 14:50:34 +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 42UEoYqR077630; Sat, 30 Mar 2024 14:50:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42UEoYRE077627; Sat, 30 Mar 2024 14:50:34 GMT (envelope-from git) Date: Sat, 30 Mar 2024 14:50:34 GMT Message-Id: <202403301450.42UEoYRE077627@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: 9241ebc796c1 - main - thread_single(9): decline external requests for traced or debugger-stopped procs 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: owner-dev-commits-src-all@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/main X-Git-Reftype: branch X-Git-Commit: 9241ebc796c11cf133c550f188f324bd2c12d89a Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9241ebc796c11cf133c550f188f324bd2c12d89a commit 9241ebc796c11cf133c550f188f324bd2c12d89a Author: Konstantin Belousov AuthorDate: 2024-03-27 12:29:25 +0000 Commit: Konstantin Belousov CommitDate: 2024-03-30 14:43:52 +0000 thread_single(9): decline external requests for traced or debugger-stopped procs Debugger has the powers to cause unbound delay in single-threading, which then blocks the threaded taskqueue. The reproducer is `truss -f timeout 2 sleep 10`. Reported by: mjg Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D44523 --- sys/kern/kern_thread.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index 5847d5ceab59..0bcd5c2f2add 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -1248,6 +1248,9 @@ thread_single(struct proc *p, int mode) return (1); msleep(&p->p_flag, &p->p_mtx, PCATCH, "thrsgl", 0); } + if ((p->p_flag & (P_STOPPED_SIG | P_TRACED)) != 0 || + (p->p_flag2 & P2_WEXIT) != 0) + return (1); } else if ((p->p_flag & P_HADTHREADS) == 0) return (0); if (p->p_singlethread != NULL && p->p_singlethread != td)