From patchwork Tue Jul 15 15:45:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 2062 Received: (qmail 23537 invoked by alias); 15 Jul 2014 15:45:07 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 23521 invoked by uid 89); 15 Jul 2014 15:45:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 15 Jul 2014 15:45:05 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s6FFj2vA006121 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 15 Jul 2014 11:45:03 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s6FFj1NF028341; Tue, 15 Jul 2014 11:45:01 -0400 Message-ID: <53C54C7C.3070907@redhat.com> Date: Tue, 15 Jul 2014 16:45:00 +0100 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: GDB Patches CC: Jan Kratochvil Subject: [PATCH] Linux: Use kill_lwp/tkill instead of kill when killing a, process Another thing I noticed by inspection while fixing the recent gdbserver kill crash. Anyone know a reason we use plain "kill" here, instead of tkill like everywhere else? Passes testing on x86_64 Fedora 20 for me, at least... -------------- From 08a773214245e9d6deb5060a6025c169fa8cdc4d Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Fri, 11 Jul 2014 11:36:20 +0100 Subject: [PATCH] Linux: Use kill_lwp/tkill instead of kill when killing a process Since we use tkill everywhere, using kill to try to kill each lwp individually looks suspiciously odd. We should really be using tgkill everywhere, but at least while we don't get there this makes us consistent. gdb/gdbserver/ 2014-07-15 Pedro Alves * linux-low.c (linux_kill_one_lwp): Use kill_lwp, not kill. gdb/ 2014-07-15 Pedro Alves * linux-nat.c (kill_callback): Use kill_lwp, not kill. --- gdb/gdbserver/linux-low.c | 2 +- gdb/linux-nat.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index 0f4dbe2..521d9a2 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -895,7 +895,7 @@ linux_kill_one_lwp (struct lwp_info *lwp) everywhere. */ errno = 0; - kill (pid, SIGKILL); + kill_lwp (pid, SIGKILL); if (debug_threads) { int save_errno = errno; diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index c738abf..b50a88e 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -3704,7 +3704,7 @@ kill_callback (struct lwp_info *lp, void *data) /* PTRACE_KILL may resume the inferior. Send SIGKILL first. */ errno = 0; - kill (ptid_get_lwp (lp->ptid), SIGKILL); + kill_lwp (ptid_get_lwp (lp->ptid), SIGKILL); if (debug_linux_nat) { int save_errno = errno;