From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7389 invoked by alias); 23 Feb 2011 20:27:21 -0000 Mailing-List: contact archer-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: List-Id: Received: (qmail 7380 invoked by uid 22791); 23 Feb 2011 20:27:20 -0000 X-SWARE-Spam-Status: No, hits=-4.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: Roland McGrath To: Jan Kratochvil Cc: Oleg Nesterov , archer@sourceware.org Subject: Re: [patch] Re: [BUG] gdb: quit hangs after step into signal handler In-Reply-To: Jan Kratochvil's message of Wednesday, 23 February 2011 21:24:54 +0100 <20110223202454.GA4687@host1.dyn.jankratochvil.net> References: <20100920211715.GA10574@redhat.com> <20100921235356.BB1F340614@magilla.sf.frob.com> <20110223202454.GA4687@host1.dyn.jankratochvil.net> Message-Id: <20110223202710.6B8AE1800B4@magilla.sf.frob.com> Date: Wed, 23 Feb 2011 20:27:00 -0000 X-SW-Source: 2011-q1/txt/msg00103.txt.bz2 > On Wed, 22 Sep 2010 01:53:56 +0200, Roland McGrath wrote: > > Even if you were paranoid about some old kernel where PTRACE_KILL might work > > better (dubious if there are any such, but that's why it's paranoia), you > > could do this before PTRACE_KILL and it should certainly be fine everywhere. > > Problem is the inferior will start running after PTRACE_KILL. Current GDB: > > Quit anyway? (y or n) y > > > read(0, "y\n", 1024) = 2 > ptrace(PTRACE_KILL, 32336, 0, 0) = 0 > wait4(32336, > > Before kill (SIGKILL) gets applied the code may do something unexpected. > Why do you consider SIGKILL first, PTRACE_KILL second as worse? What I recommended is kill/SIGKILL first, PTRACE_KILL second. That's not worse than anything else.