GNU bug report logs - #15983
24.3; Emacs Not Killing Child Process

Previous Next

Package: emacs;

Reported by: sjm <at> sjm.io

Date: Wed, 27 Nov 2013 17:50:02 UTC

Severity: minor

Found in version 24.3

Full log


Message #14 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Joan Karadimov <joan.karadimov <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Cc: Bozhidar Batsov <bozhidar.batsov <at> gmail.com>, eliz <at> gnu.org, sjm <at> sjm.io
Subject: bug#15983: 24.3; Emacs Not Killing Child Process
Date: Thu, 19 Dec 2013 17:44:37 +0200
[Message part 1 (text/plain, inline)]
> Emacs on Windows can only monitor and kill its immediate subprocesses,
> it cannot monitor, let alone kill, any of their descendant processes,> because it has no idea about them.  And the OS doesn't automatically> kill all the processes in the subprocess tree, and there's no way to> send a signal to them all, as on Posix platforms.  If killing the> immediate child process doesn't cause some of its children to exit or> abort, then those grandchildren will be left orphaned.
Windows NT does have the concept of parent processes, but an API call
wasn't exposed in win32 until XP. I wrote a small patch that uses that
and kills all child processes (as long as pid<0). I did some sanity
testing and it works.

There are a few things that this patch leaves unaddressed:- there is
no error handling
- there is no OS detection - this will get ugly on Windows 9x and
NT4/5.0- performance: 3 API calls are made for each descendant
process. This can be reduced to a total 3 calls (regardless of the
child process count)

I'll fix these (and any other issues) if this fix is of any interest.
[Message part 2 (text/html, inline)]
[win32-kill-children (application/octet-stream, attachment)]

This bug report was last modified 11 years and 174 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.