Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFC] [PATCH] Kill processes, not process groups
@ 2015-05-14  7:59 Daniel Colascione
  2015-05-14  8:17 ` pinskia
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Colascione @ 2015-05-14  7:59 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 1201 bytes --]

Killing process groups for interruption doesn't make any sense. Say we
have a two-process group [A B], where A is the leader.  If we attach to
A and use "interrupt", we accidentally kill B. If we attach to B,
"interrupt" does nothing. Why wouldn't we just signal A?

This problem is worse in the gdbserver case. Locally, we use
pass_signal, not interrupt, for C-c, and pass_signal does the right
thing. But in the remote case, we have nothing but interrupt, and that
doesn't seem to do users intend.

commit 8d096e713e46f00bc8bf55743288a24f6222021f
Author: Daniel Colascione <dancol@dancol.org>
Date:   Wed May 13 23:58:24 2015 -0700

    Kill the process we're dealing with, not the whole group

diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index 4da11c6..8a725fa 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -4904,7 +4904,7 @@ linux_request_interrupt (void)

   /* Send a SIGINT to the process group.  This acts just like the user
      typed a ^C on the controlling terminal.  */
-  kill (-signal_pid, SIGINT);
+  kill (signal_pid, SIGINT);
 }

 /* Copy LEN bytes from inferior's auxiliary vector starting at OFFSET


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC] [PATCH] Kill processes, not process groups
  2015-05-14  7:59 [RFC] [PATCH] Kill processes, not process groups Daniel Colascione
@ 2015-05-14  8:17 ` pinskia
  2015-05-14  8:18   ` Daniel Colascione
  0 siblings, 1 reply; 3+ messages in thread
From: pinskia @ 2015-05-14  8:17 UTC (permalink / raw)
  To: Daniel Colascione; +Cc: gdb-patches





> On May 14, 2015, at 12:59 AM, Daniel Colascione <dancol@dancol.org> wrote:
> 
> Killing process groups for interruption doesn't make any sense. Say we
> have a two-process group [A B], where A is the leader.  If we attach to
> A and use "interrupt", we accidentally kill B. If we attach to B,
> "interrupt" does nothing. Why wouldn't we just signal A?
> 
> This problem is worse in the gdbserver case. Locally, we use
> pass_signal, not interrupt, for C-c, and pass_signal does the right
> thing. But in the remote case, we have nothing but interrupt, and that
> doesn't seem to do users intend.
> 
> commit 8d096e713e46f00bc8bf55743288a24f6222021f
> Author: Daniel Colascione <dancol@dancol.org>
> Date:   Wed May 13 23:58:24 2015 -0700
> 
>    Kill the process we're dealing with, not the whole group
> 
> diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
> index 4da11c6..8a725fa 100644
> --- a/gdb/gdbserver/linux-low.c
> +++ b/gdb/gdbserver/linux-low.c
> @@ -4904,7 +4904,7 @@ linux_request_interrupt (void)
> 
>   /* Send a SIGINT to the process group.  This acts just like the user
>      typed a ^C on the controlling terminal.  */
> -  kill (-signal_pid, SIGINT);
> +  kill (signal_pid, SIGINT);

Your patch did not update the comment though. So it raises the question which is the correct behavior. 

Thanks,
Andrew

> }
> 
> /* Copy LEN bytes from inferior's auxiliary vector starting at OFFSET
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC] [PATCH] Kill processes, not process groups
  2015-05-14  8:17 ` pinskia
@ 2015-05-14  8:18   ` Daniel Colascione
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Colascione @ 2015-05-14  8:18 UTC (permalink / raw)
  To: pinskia; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 257 bytes --]

On 05/14/2015 01:17 AM, pinskia@gmail.com wrote:
> Your patch did not update the comment though. So it raises the question which is the correct behavior. 


It also doesn't fix any tests or fix inf-ptrace.c. I wanted to get a bit
of feedback first.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-05-14  8:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-14  7:59 [RFC] [PATCH] Kill processes, not process groups Daniel Colascione
2015-05-14  8:17 ` pinskia
2015-05-14  8:18   ` Daniel Colascione

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox