id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,os,architecture,failure,difficulty,testcase,blockedby,blocking,related
3317,Ctrl-C is not received during a call to runProcess,judah,igloo,"The following program runs `cat` as an external process, and tries to kill it if an exception such as ctrl-c is received.

{{{
module Main where

import System.Process
import Control.Exception (finally)

main = do
    pid <- runProcess ""cat"" [] Nothing Nothing Nothing Nothing Nothing
    waitForProcess pid `finally` do
        putStrLn ""killing""
        terminateProcess pid
    print ""Done!""
}}}
With ghc-6.8.3, the subprocess is killed when ctrl-c is pressed.  However, with ghc-6.10.3 the program acts oddly:

{{{
$ ./raw 
^C^C
$ cat: stdin: Input/output error

}}}

The first time that ctrl-c is pressed, it is ignored.  The second time, it kills the program (without calling the handler set by `finally`) but the cat program is still running.

I ran into this bug because it makes custom Cabal `Setup.hs` scripts unkillable by ctrl-c.",merge,closed,normal,6.10.4,libraries/process,6.10.3,fixed,,,MacOS X,x86,,Unknown,,,,
