[GHC] #8343: Interrupting readProcess doesn't work

GHC ghc-devs at haskell.org
Mon Sep 23 10:48:52 CEST 2013


#8343: Interrupting readProcess doesn't work
--------------------------+------------------------------------------------
       Reporter:  akio    |             Owner:
           Type:  bug     |            Status:  new
       Priority:  normal  |         Milestone:
      Component:          |           Version:  7.6.3
  libraries/base          |  Operating System:  Linux
       Keywords:          |   Type of failure:  Incorrect result at runtime
   Architecture:  x86_64  |         Test Case:
  (amd64)                 |          Blocking:
     Difficulty:          |
  Unknown                 |
     Blocked By:          |
Related Tickets:  #5766   |
--------------------------+------------------------------------------------
 The following program should terminate in 1 second, but it does not:

 {{{
 import System.Process
 import System.Timeout

 main = timeout 1000000 $ print =<< readProcess "sleep" ["2h"] ""
 }}}

 The problem is in the exception handler in {{{readProcess}}}. When it
 receives an asynchronous exception, it tries to clean up by closing the
 pipes. However the attempt to close {{{outh}}} blocks because the reader
 thread (reading with {{{hGetContents}}}) is blocking on the handle.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8343>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the ghc-tickets mailing list