From owner-svn-src-head@freebsd.org Mon Nov 13 21:22:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A798DD7383; Mon, 13 Nov 2017 21:22:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 672A57ED44; Mon, 13 Nov 2017 21:22:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vADLMXu9048868; Mon, 13 Nov 2017 21:22:33 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vADLMXeE048867; Mon, 13 Nov 2017 21:22:33 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201711132122.vADLMXeE048867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 13 Nov 2017 21:22:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325778 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 325778 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Nov 2017 21:22:34 -0000 Author: jhb Date: Mon Nov 13 21:22:33 2017 New Revision: 325778 URL: https://svnweb.freebsd.org/changeset/base/325778 Log: Move loop to clear TDB_SUSPEND into PT_DETACH case. The PT_DETACH case above the sendsig: label already looped over all threads clearing flags in td_dbgflags. Reuse this loop to clear TDB_SUSPEND and move the logic out of the sendsig: block. Modified: head/sys/kern/sys_process.c Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Mon Nov 13 21:09:08 2017 (r325777) +++ head/sys/kern/sys_process.c Mon Nov 13 21:22:33 2017 (r325778) @@ -1128,8 +1128,10 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi sigqueue_delete(&td3->td_sigqueue, SIGSTOP); } - td3->td_dbgflags &= ~(TDB_XSIG | TDB_FSTP); + td3->td_dbgflags &= ~(TDB_XSIG | TDB_FSTP | + TDB_SUSPEND); } + if ((p->p_flag2 & P2_PTRACE_FSTP) != 0) { sigqueue_delete(&p->p_sigqueue, SIGSTOP); p->p_flag2 &= ~P2_PTRACE_FSTP; @@ -1169,11 +1171,6 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi */ if (data == SIGKILL) p->p_flag |= P_WKILLED; - - if (req == PT_DETACH) { - FOREACH_THREAD_IN_PROC(p, td3) - td3->td_dbgflags &= ~TDB_SUSPEND; - } /* * Unsuspend all threads. To leave a thread