unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Sven Joachim <svenjoac@gmx.de>
To: Brent Goodrick <bgoodr@gmail.com>
Cc: 1112@emacsbugs.donarmstrong.com
Subject: bug#1112: 23.0.60; Child process not cleaned up properly
Date: Tue, 07 Oct 2008 21:24:45 +0200	[thread overview]
Message-ID: <87abdgmcn6.fsf@gmx.de> (raw)
In-Reply-To: <mailman.474.1223398646.25473.bug-gnu-emacs@gnu.org> (Brent Goodrick's message of "Tue, 7 Oct 2008 08:15:57 -0700")

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%
>    <snip>
>    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






       reply	other threads:[~2008-10-07 19:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.474.1223398646.25473.bug-gnu-emacs@gnu.org>
2008-10-07 19:24 ` Sven Joachim [this message]
2008-10-08 14:53   ` bug#1112: 23.0.60; Child process not cleaned up properly Brent Goodrick
2008-10-07 19:23 Chong Yidong
  -- strict thread matches above, loose matches on Subject: below --
2008-10-07 15:15 Brent Goodrick

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87abdgmcn6.fsf@gmx.de \
    --to=svenjoac@gmx.de \
    --cc=1112@emacsbugs.donarmstrong.com \
    --cc=bgoodr@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).