From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 87686 invoked by alias); 18 May 2016 12:10:32 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 87670 invoked by uid 89); 18 May 2016 12:10:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=H*MI:sk:1463003, H*M:aeca, hear, desire 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; Wed, 18 May 2016 12:10:30 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D51F17F6B1; Wed, 18 May 2016 12:10:28 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4ICARBh012142; Wed, 18 May 2016 08:10:28 -0400 Subject: Re: [PATCH] [GDBServer] Send SIGINT using process group ID To: Jim Chen , gdb-patches@sourceware.org References: <1463003507-13094-1-git-send-email-nchen@mozilla.com> <1463003507-13094-2-git-send-email-nchen@mozilla.com> From: Pedro Alves Message-ID: Date: Wed, 18 May 2016 12:10:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <1463003507-13094-2-git-send-email-nchen@mozilla.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-05/txt/msg00295.txt.bz2 On 05/11/2016 10:51 PM, Jim Chen wrote: > Hi, > > linux_request_interrupt is supposed to send SIGINT to the process group, > but it passes the process ID to kill() instead of the process group ID, > which may not be the same as the process ID. > The patch calls getpgid > first to get the process group ID. > > Patch tested on arm-linux. Can you expand on the use case you see this happening on, please? I can imagine some, but I'd like to hear it from you. Some have expressed desire to _not_ send the SIGINT to the whole process group, which may make sense when you're attached to a process rather than having started it. IIRC, there's a bug filed in bugzilla about this. Looking at the code, not-sending-to-process-group-when-attached is what native GNU/Linux does too (inflow.c:pass_signal). Seems like "c&" -> "interrupt" doesn't consider "attach" either, as inf-ptrace.c:inf_ptrace_interrupt sends the SIGINT to the process, and like gdbserver, assumes the inferior's PID is the process group id. Thanks, Pedro Alves