bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#15983: Fw: bug#15983: 24.3; Emacs Not Killing Child Process


From: Bozhidar Batsov
Subject: bug#15983: Fw: bug#15983: 24.3; Emacs Not Killing Child Process
Date: Thu, 19 Dec 2013 17:56:46 +0200

Forwarded message:
From: Joan Karadimov <joan.karadimov@gmail.com>
To: bug-gnu-emacs@gnu.org
Cc: sjm@sjm.io, eliz@gnu.org, Bozhidar Batsov <bozhidar.batsov@gmail.com>
Date: Thursday, December 19, 2013 at 5:44:37 PM
Subject: bug#15983: 24.3; Emacs Not Killing Child Process

> 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.


Attachment: win32-kill-children
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]