Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: GDB Patches <gdb-patches@sourceware.org>
Cc: Jan Kratochvil <jan.kratochvil@redhat.com>
Subject: [PATCH] Linux: Use kill_lwp/tkill instead of kill when killing a, process
Date: Tue, 15 Jul 2014 15:55:00 -0000	[thread overview]
Message-ID: <53C54C7C.3070907@redhat.com> (raw)

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 <palves@redhat.com>
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  <palves@redhat.com>

	* linux-low.c (linux_kill_one_lwp): Use kill_lwp, not kill.

gdb/
2014-07-15  Pedro Alves  <palves@redhat.com>

	* 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;
-- 
1.9.3


             reply	other threads:[~2014-07-15 15:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-15 15:55 Pedro Alves [this message]
2014-07-15 19:33 ` Jan Kratochvil
2014-07-15 21:03   ` Stan Shebs
2014-07-16 21:58     ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53C54C7C.3070907@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox