How to reliably terminate a process
s.clover at gmail.com
Tue Nov 25 18:15:06 EST 2008
Due to the way which runInteractiveCommand works (through spawning a shell),
it is impossible to consistently terminate a process launched using it. If
the process tries to read from stdin, then it will die properly -- however,
last I checked, processes blocking on reading stdin from within
runInteractiveCommand will cause bizarre memory leaks.
runInteractiveProcess will work as you expect.
For more information, see the bug report here:
On Tue, Nov 25, 2008 at 4:09 PM, Bernd Holzmüller <
bernd.holzmueller at ics-ag.de> wrote:
> I am writing an application on Windows XP using ghc 6.10.1 that manages
> test cases (same applies to ghc 6.8.3). For each selected test case, the
> application runs an executable associated with the test case using
> System.Process.runInteractiveCommand. These processes have to be aborted in
> some cases, for example, when their specified termination time is up. As I
> realized, however, aborting these processes using terminateProcess is not
> reliable. Most often, the processes do not terminate correctly but have to
> be killed from the Windows Task Manager. In some cases, the process still
> produces output - in particular if I apply getProcessExitCode on the process
> just killed. By the way: calling and killing the process from the shell with
> Ctrl-C successfully kills the process.
> Any advice on how to reliably terminate a process on Windows?
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Glasgow-haskell-users