From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Hannu Koivisto Newsgroups: gmane.emacs.bugs,gmane.emacs.pretest.bugs Subject: bug#4437: 23.1.50; Quitting gdb leaves a process behind Date: Fri, 18 Sep 2009 15:44:10 +0300 Message-ID: <83zl8se82t.fsf@kalahari.s2.org> References: <83ab0xfdrb.fsf@kalahari.s2.org> <19120.18090.883591.554535@totara.tehura.co.nz> Reply-To: Hannu Koivisto , 4437@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1253281656 32468 80.91.229.12 (18 Sep 2009 13:47:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 18 Sep 2009 13:47:36 +0000 (UTC) Cc: 4437@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org To: nickrob@snap.net.nz (Nick Roberts) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 18 15:47:29 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Modo9-0008NO-1d for geb-bug-gnu-emacs@m.gmane.org; Fri, 18 Sep 2009 15:47:29 +0200 Original-Received: from localhost ([127.0.0.1]:48320 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Modo8-0005Ex-J6 for geb-bug-gnu-emacs@m.gmane.org; Fri, 18 Sep 2009 09:47:28 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ModB8-0000Kx-TK for bug-gnu-emacs@gnu.org; Fri, 18 Sep 2009 09:07:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ModB3-0000Fa-UH for bug-gnu-emacs@gnu.org; Fri, 18 Sep 2009 09:07:09 -0400 Original-Received: from [199.232.76.173] (port=43157 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ModB3-0000F5-Cl for bug-gnu-emacs@gnu.org; Fri, 18 Sep 2009 09:07:05 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:45009) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1ModB2-0004Pv-Iu for bug-gnu-emacs@gnu.org; Fri, 18 Sep 2009 09:07:05 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8ID71fY018199; Fri, 18 Sep 2009 06:07:02 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n8ICo5wG015058; Fri, 18 Sep 2009 05:50:05 -0700 Resent-Date: Fri, 18 Sep 2009 05:50:05 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Hannu Koivisto Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Fri, 18 Sep 2009 12:50:05 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 4437 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 4437-submit@emacsbugs.donarmstrong.com id=B4437.125327785514244 (code B ref 4437); Fri, 18 Sep 2009 12:50:05 +0000 Original-Received: (at 4437) by emacsbugs.donarmstrong.com; 18 Sep 2009 12:44:15 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from kalahari.s2.org (Debian-exim@s2.org [195.197.64.39]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8ICiDZJ014239 for <4437@emacsbugs.donarmstrong.com>; Fri, 18 Sep 2009 05:44:14 -0700 Original-Received: from azure by kalahari.s2.org with local (Exim 4.69) (envelope-from ) id 1Mocos-0004hU-Cd; Fri, 18 Sep 2009 15:44:10 +0300 In-Reply-To: <19120.18090.883591.554535@totara.tehura.co.nz> (Nick Roberts's message of "Wed, 16 Sep 2009 14:00:10 +1200") User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: azure@iki.fi X-SA-Exim-Scanned: No (on kalahari.s2.org); SAEximRunCond expanded to false X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Fri, 18 Sep 2009 09:07:09 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:31215 gmane.emacs.pretest.bugs:25063 Archived-At: nickrob@snap.net.nz (Nick Roberts) writes: > > Start emacs with -q option, start gdb to debug any program > > (M-x gdb RET C-a gdb -i=mi ./some-program), quit immediately by typing > > quit RET to gdb command line (and answer "yes" to the question > > whether to kill the process associated to the buffer) and finally list > > processes with M-x list-processes RET. > > > > Expected result: no processes. > > Actual result: > > > > Proc Status Buffer Tty Command > > ---- ------ ------ --- ------- > > gdb-inferior run (Killed) /dev/pts/15 > > > > If I start gdb again after this, I get a new gdb-inferior<1> > > process which again is left running when I quit gdb. > > If you want to run the same, but possibly newly compiled executable it's > generally best not to quit GDB. GDB will automatically load the new code > and it has the advantage of keeping shell history, breakpoints etc. You > may need to change the line numbers on some breakpoints if the surrounding > code has changed. Did you mean to give this advice as a workaround for the leakage problem? Sure. I can even restart Emacs, I have no problem living with the problem till it gets fixed. As a general comment to this history stuff, it wouldn't be a bad feature if Emacs could provide history and breakpoint persistence over gud/gdb sessions. > If you want to run a different executable then it's best to kill the GUD > buffer before starting a new session. > > I've also seen cases where "quit" command to gdb does absolutely > > nothing. In at least some sub-cases, if I then say M-x list-processes > > RET, _then_ I get the question whether to kill the process associated to > > the buffer and if I say "yes", the debugger quits and I get "Debugger > > finished" in the gdb buffer. > > Similar problems were reported as part of bug#4375. I'm still looking in > to it. I read through that bug entry some time ago (after I got your mail) and I think I saw the process leakage being mentioned there, but I don't think I saw this particular quit problem. There were some other quit problems, though, and maybe many of these are related. For what it's worth, I now know how to reproduce this one. All I need to do in addition to what I did to reproduce the leakage problem is to set a temporary breakpoint to main function and "run" to it before invoking quit. I forgot to mention that I'm using gdb 6.8. -- Hannu