From bgoodr@gmail.com Tue Oct 7 08:16:16 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-7.4 required=4.0 tests=BAYES_00,FOURLA,MDO_CABLE_TV3, RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 7 Oct 2008 15:16:16 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m97FG8UE029011 for ; Tue, 7 Oct 2008 08:16:09 -0700 Received: from mx10.gnu.org ([199.232.76.166]:59129) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1KnEFs-0005MK-Fw for emacs-pretest-bug@gnu.org; Tue, 07 Oct 2008 11:13:45 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1KnEI7-0001YH-JD for emacs-pretest-bug@gnu.org; Tue, 07 Oct 2008 11:16:05 -0400 Received: from yw-out-1718.google.com ([74.125.46.154]:57108) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KnEI6-0001X5-PQ for emacs-pretest-bug@gnu.org; Tue, 07 Oct 2008 11:16:03 -0400 Received: by yw-out-1718.google.com with SMTP id 9so559820ywk.66 for ; Tue, 07 Oct 2008 08:15:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type:content-transfer-encoding :content-disposition; bh=w5/5yt0VqUo+eVAun90vFKGN8OPIT9hZrjWaEOannrk=; b=C+Ibe6lN9QFPOrhv3OeoJENof1Fh/3O7NnQQPNlutAYsZg7CcF63zIILoR+euMoeU1 WbVIg/xIW2OomvlAvBdIPmxagFC6s1rrjkhhL2K/1mDLu+Mj4Q608H8BakJtC+xxXqCG hNwHsvRx5ut7J7E5r/Y6XClYbn6fHju5VP72Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=M0UEw8WucjuASkXTZmumVs1wFdSNnFG3vAql4XdhRbrwWYYGvqJNiSKZMc6+YJt0gU +8BBWKtLSMYdr62MM0PR8SjukPMQ6qAgoKmrvETS33n1VyA8XEfOywEXrXvz8BLVs/j5 8KvuClpElJf1RkdzDxf1R1czFTl4D6rWGsbRY= Received: by 10.90.101.17 with SMTP id y17mr7521191agb.51.1223392557590; Tue, 07 Oct 2008 08:15:57 -0700 (PDT) Received: by 10.90.50.18 with HTTP; Tue, 7 Oct 2008 08:15:57 -0700 (PDT) Message-ID: Date: Tue, 7 Oct 2008 08:15:57 -0700 From: "Brent Goodrick" To: emacs-pretest-bug@gnu.org Subject: 23.0.60; Child process not cleaned up properly MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Please write in English if possible, because the Emacs maintainers usually do not have translators to read other languages for them. Your bug report will be posted to the emacs-pretest-bug@gnu.org mailing list. Please describe exactly what actions triggered the bug and the precise symptoms of the bug: 1. M-x compile 2. Enter in: sudo apt-get install gimp-help-en 3. See the apt-get prompt: Reading package lists... 0% The following extra packages will be installed: gimp-help-common The following NEW packages will be installed: gimp-help-common gimp-help-en 0 upgraded, 2 newly installed, 0 to remove and 1 not upgraded. Need to get 15.9MB of archives. After this operation, 27.5MB of additional disk space will be used. Do you want to continue [Y/n]? 4. Kill the buffer, and expect the underlying process to die, just like you would have if you had typed the above command in a shell buffer. 5. Open up a shell, and type ps to see that the apt-get process still exists 6. Go through step 1 again and notice now that a lock is being reported by the second apt-get session because the first process was not properly torn down by the act of killing the previous compilation buffer. My assessment: The shell mode somehow works differently than the compilation mode since the compilation mode does not allow user input. Fair enough, but the two modes should work the same in terms of tearing down the two processes if the buffers are killed, and should not ever leave dormant child processes. If Emacs crashed, and you have the Emacs process in the gdb debugger, please include the output from the following gdb commands: `bt full' and `xbacktrace'. If you would like to further debug the crash, please read the file /home/brentg/emacs_from_source/install/share/emacs/23.0.60/etc/DEBUG for instructions. Emacs did not crash. In GNU Emacs 23.0.60.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.12.11) of 2008-10-03 on hungover Windowing system distributor `The X.Org Foundation', version 11.0.10402000 configured using `configure '--with-x-toolkit' '--with-xft' '--prefix=/home/brentg/emacs_from_source/install'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US.UTF-8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default-enable-multibyte-characters: t Major mode: Apropos Minor modes in effect: desktop-save-mode: t iswitchb-mode: t erc-services-mode: t erc-networks-mode: t display-time-mode: t shell-dirtrack-mode: t delete-selection-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: 1 transient-mark-mode: t Recent input: o m p i C-1 d C-x h M-P C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-a C-n C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-b C-b C-M-SPC C-z M-> C-4 M-P k i l l C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-a C-n C-n C-n C-n C-p C-p C-p C-p C-n C-f C-f C-f C-f C-f C-f C-f C-f C-f C-M-SPC C-z M-> SPC C-v C-a M-P C-a s u d i o SPC C-4 M-P C-k C-g C-v C-1 C-c d p s f C-r a p t - C-g C-g M-> a p t = g e t C-r a p t - g e t C-g C-f M-> M-x a p r o p t y t y y C-x o C-s c o m i n t C-b C-x o C-M-SPC C-z C-c d C-x h M-P SPC | SPC g r e p SPC a p t - g e t M-x M-P C-g C-4 M-p C-x o M-: C-v C-1 M-P s u d o SPC k i l l SPC a p t = - g e t 1 2 2 5 6 0 M-x a p r o e m a c s . * f b u g C-x o C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n M-x r e p o r t - e m a c s = - b u g Recent messages: Not applicable. It is repeatable. From cyd@stupidchicken.com Tue Oct 7 12:21:55 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-3.9 required=4.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1112) by emacsbugs.donarmstrong.com; 7 Oct 2008 19:21:55 +0000 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m97JLqJ2025416 for <1112@emacsbugs.donarmstrong.com>; Tue, 7 Oct 2008 12:21:53 -0700 Received: by cyd.mit.edu (Postfix, from userid 1000) id EFD3657E0BF; Tue, 7 Oct 2008 15:23:28 -0400 (EDT) From: Chong Yidong To: "Brent Goodrick" Cc: 1112@debbugs.gnu.org Subject: 23.0.60; Child process not cleaned up properly Date: Tue, 07 Oct 2008 15:23:28 -0400 Message-ID: <87hc7o9plb.fsf@cyd.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > 1. M-x compile > 2. Enter in: sudo apt-get install gimp-help-en > 4. Kill the buffer, and expect the underlying process to die > 5. Open up a shell, and type ps to see that the apt-get process still > exists I suspect Emacs may fail to kill the process due to insufficient permissions: it's a sudo process. If you run Emacs with sudo, does the same problem appear? From svenjoac@gmx.de Tue Oct 7 12:24:57 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.0 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1112) by emacsbugs.donarmstrong.com; 7 Oct 2008 19:24:57 +0000 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id m97JOrW6025445 for <1112@emacsbugs.donarmstrong.com>; Tue, 7 Oct 2008 12:24:54 -0700 Received: (qmail invoked by alias); 07 Oct 2008 19:24:47 -0000 Received: from p5486663C.dip.t-dialin.net (EHLO debian) [84.134.102.60] by mail.gmx.net (mp022) with SMTP; 07 Oct 2008 21:24:47 +0200 X-Authenticated: #28250155 X-Provags-ID: V01U2FsdGVkX19xKQUYqihxaYYLo06qTCf0K+G4VurBNqv2/1SLpO 0cbfwNobgV3gHx From: Sven Joachim To: Brent Goodrick Cc: 1112@debbugs.gnu.org Subject: Re: bug#1112: 23.0.60; Child process not cleaned up properly References: Date: Tue, 07 Oct 2008 21:24:45 +0200 In-Reply-To: (Brent Goodrick's message of "Tue, 7 Oct 2008 08:15:57 -0700") Message-ID: <87abdgmcn6.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Y-GMX-Trusted: 0 X-FuHaFi: 0.6 On 2008-10-07 17:15 +0200, Brent Goodrick wrote: > 1. M-x compile > 2. Enter in: sudo apt-get install gimp-help-en > 3. See the apt-get prompt: > Reading package lists... 0% > > The following extra packages will be installed: > gimp-help-common > The following NEW packages will be installed: > gimp-help-common gimp-help-en > 0 upgraded, 2 newly installed, 0 to remove and 1 not upgraded. > Need to get 15.9MB of archives. > After this operation, 27.5MB of additional disk space will be used. > Do you want to continue [Y/n]? > 4. Kill the buffer, and expect the underlying process to die, just > like you would have if you had typed the above command in a shell > buffer. Won't work for processes run under sudo, see below. > 5. Open up a shell, and type ps to see that the apt-get process still > exists > 6. Go through step 1 again and notice now that a lock is being > reported by the second apt-get session because the first process > was not properly torn down by the act of killing the previous > compilation buffer. > > My assessment: The shell mode somehow works differently than the > compilation mode since the compilation mode does not allow user > input. Fair enough, but the two modes should work the same in terms of > tearing down the two processes if the buffers are killed, and should > not ever leave dormant child processes. The real problem is that sudo is suid root and thus the compilation process runs with superuser rights. Emacs is simply lacking the privileges to kill it. You can try something similar in your shell: ,---- | % sudo sleep 1000 & | [1] 2186 | % kill %1 | kill: kill %1 failed: operation not permitted | % sudo kill $(pidof sleep) | [1] + 2186 terminated sudo sleep 1000 | % `---- Sven From bgoodr@gmail.com Wed Oct 8 07:54:09 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-7.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1112) by emacsbugs.donarmstrong.com; 8 Oct 2008 14:54:09 +0000 Received: from mail-gx0-f19.google.com (mail-gx0-f19.google.com [209.85.217.19]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m98Es1Jr025384 for <1112@emacsbugs.donarmstrong.com>; Wed, 8 Oct 2008 07:54:02 -0700 Received: by gxk12 with SMTP id 12so8365463gxk.1 for <1112@emacsbugs.donarmstrong.com>; Wed, 08 Oct 2008 07:53:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=awT8B7MKj8qMQ8rsr2ikL9Y6wK0ShtqiHayzG10WLes=; b=bUEuVPIc5/p3eHsR745iASfLEaD0+W+GRXrdOYcqvmhOQZMsfzgMGP6KxAlbqY5c3e wlPHdk4mztEwPU32yaYu/SQH27h64oJvTMwgwmyAAJ+yBEdfh3PTwe7b6XzLc0inTtjW fkOEtl/kDyDaEH7jS6w7jt0s+dlvxRRTOaNIo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=XD7MEb523t6MLn2sz9/6wR8XQY2QIbW+uowvdAHe4MhGthFbn8VYu+TVyD6+QpsKdv M91X22OiMRjr3t2NPpi4g0KCm3pNVN9+vzaMWu66CSCnoZFSE6iW5swqONKGyuwzLPg1 +PAKxIpC03N1p9YD77L2Ubk0NQDE5SjKTVy3Q= Received: by 10.90.98.12 with SMTP id v12mr9367169agb.23.1223477635640; Wed, 08 Oct 2008 07:53:55 -0700 (PDT) Received: by 10.90.50.18 with HTTP; Wed, 8 Oct 2008 07:53:55 -0700 (PDT) Message-ID: Date: Wed, 8 Oct 2008 07:53:55 -0700 From: "Brent Goodrick" To: "Sven Joachim" Subject: Re: bug#1112: 23.0.60; Child process not cleaned up properly Cc: 1112@debbugs.gnu.org In-Reply-To: <87abdgmcn6.fsf@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <87abdgmcn6.fsf@gmx.de> Hi Sven, I agree about the part about the process permissions: Emacs definitely cannot kill the process because it is a sudo process. However, if Emacs fails to kill the process, Emacs should emit a warning message as to the reason why the process could not be killed (e.g., "process id 12345 could not be killed: operation not permitted"). This would be appropriate in the case where the user kills the process buffer on a long running process (a process that is not attempting to read from standard input as this one is; see next paragraph). This warning is appropriate because otherwise, the user thinks that the process died on its own and will have to discover the hard way via some degree of head-scratching that the process could not be killed. There is more to this problem than process permissions. The process has opened up standard input for the Y/N prompt. When I run compilation mode on some process, I expect no user prompts (if I wanted to handle prompts,I would execute it under the ever so handy shell mode). But, when that process does read standard input for prompting, I want that process to exit immediately (and most well behaved apps do this these days, with the exception of Bourne shell scripts using the "read" operator which doesn't behave correctly IMO). As a proof of concept, when I type "sudo apt-get some_package < /dev/null" into a M-x compile prompt, I see reasonable behavior: After this operation, 27.5MB of additional disk space will be used. Do you want to continue [Y/n]? Abort. Compilation exited abnormally with code 1 at Wed Oct 8 07:18:54 So, is there any harm in having compilation mode close standard input when it spawns any and all processes (perhaps only under the direction of a customizable and properly documented defvar variable so as to avoid backlash from users expecting the existing behavior)? If so, this would fix this issue in the majority of cases. Actually, this closing of standard input should be an option on the lowest level Elisp command that compile uses to start processes, if it is not already exposed as such: I imagine that having to hack this into the compile mode Elisp code itself would be problematic given that the "< /dev/null" construct would have to vary quite a bit on the two axes of type of shell and execution platform. Thanks, Brent On Tue, Oct 7, 2008 at 12:24 PM, Sven Joachim wrote: > > On 2008-10-07 17:15 +0200, Brent Goodrick wrote: > > > 1. M-x compile > > 2. Enter in: sudo apt-get install gimp-help-en > > 3. See the apt-get prompt: > > Reading package lists... 0% > > > > The following extra packages will be installed: > > gimp-help-common > > The following NEW packages will be installed: > > gimp-help-common gimp-help-en > > 0 upgraded, 2 newly installed, 0 to remove and 1 not upgraded. > > Need to get 15.9MB of archives. > > After this operation, 27.5MB of additional disk space will be used. > > Do you want to continue [Y/n]? > > 4. Kill the buffer, and expect the underlying process to die, just > > like you would have if you had typed the above command in a shell > > buffer. > > Won't work for processes run under sudo, see below. > > > 5. Open up a shell, and type ps to see that the apt-get process still > > exists > > 6. Go through step 1 again and notice now that a lock is being > > reported by the second apt-get session because the first process > > was not properly torn down by the act of killing the previous > > compilation buffer. > > > > My assessment: The shell mode somehow works differently than the > > compilation mode since the compilation mode does not allow user > > input. Fair enough, but the two modes should work the same in terms of > > tearing down the two processes if the buffers are killed, and should > > not ever leave dormant child processes. > > The real problem is that sudo is suid root and thus the compilation > process runs with superuser rights. Emacs is simply lacking the > privileges to kill it. > > You can try something similar in your shell: > > ,---- > | % sudo sleep 1000 & > | [1] 2186 > | % kill %1 > | kill: kill %1 failed: operation not permitted > | % sudo kill $(pidof sleep) > | [1] + 2186 terminated sudo sleep 1000 > | % > `---- > > Sven From cyd@stupidchicken.com Wed Oct 29 14:45:42 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-5.0 required=4.0 tests=AWL,BAYES_00, VALID_BTS_CONTROL autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at control) by emacsbugs.donarmstrong.com; 29 Oct 2008 21:45:43 +0000 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9TLjeaG010661 for ; Wed, 29 Oct 2008 14:45:41 -0700 Received: by cyd.mit.edu (Postfix, from userid 1000) id 0BC8C57E0BE; Wed, 29 Oct 2008 17:45:46 -0400 (EDT) From: Chong Yidong To: control@debbugs.gnu.org Subject: tags 1112 wontfix Date: Wed, 29 Oct 2008 17:45:46 -0400 Message-ID: <87skqfoz1x.fsf@cyd.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii tags 1112 wontfix thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 02 12:03:49 2011 Received: (at control) by debbugs.gnu.org; 2 Aug 2011 16:03:49 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QoHRb-0002lK-W7 for submit@debbugs.gnu.org; Tue, 02 Aug 2011 12:03:49 -0400 Received: from hermes.netfonds.no ([80.91.224.195]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QoHRZ-0002lA-GX for control@debbugs.gnu.org; Tue, 02 Aug 2011 12:03:46 -0400 Received: from cm-84.215.51.58.getinternet.no ([84.215.51.58] helo=stories.gnus.org) by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1QoHR0-0004BQ-FO for control@debbugs.gnu.org; Tue, 02 Aug 2011 18:03:10 +0200 Date: Tue, 02 Aug 2011 18:02:47 +0200 Message-Id: To: control@debbugs.gnu.org From: Lars Magne Ingebrigtsen Subject: control message for bug #1112 X-MailScanner-ID: 1QoHR0-0004BQ-FO X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1312905790.67526@ajqc4p4cz5y7HZyTLLB+Cw X-Spam-Status: No X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) close 1112 From unknown Mon Aug 18 11:11:34 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 31 Aug 2011 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator