[GHC] #9135: readProcessWithExitCode leaks when the program does not exist

GHC ghc-devs at haskell.org
Thu May 22 15:47:06 UTC 2014


#9135: readProcessWithExitCode leaks when the program does not exist
-------------------------------------+-------------------------------------
       Reporter:  luite              |             Owner:
           Type:  bug                |            Status:  new
       Priority:  normal             |         Milestone:
      Component:  libraries/process  |           Version:  7.8.2
       Keywords:                     |  Operating System:  Unknown/Multiple
   Architecture:  Unknown/Multiple   |   Type of failure:  None/Unknown
     Difficulty:  Unknown            |         Test Case:
     Blocked By:                     |          Blocking:
Related Tickets:                     |
-------------------------------------+-------------------------------------
 {{{#!haskell
 import Control.Monad
 import System.Process
 import qualified Control.Exception as C

 try' :: IO a -> IO (Either C.SomeException a)
 try' = C.try

 main = replicateM_ 1000 $ do
   try'           (readProcessWithExitCode "doesnotexist" [] "")
   print =<< try' (readProcessWithExitCode "/bin/echo" ["it works"] "")
 }}}

 This eventually runs out of file descriptors and fails to start the
 existing process.

 Tested with process 1.2.0.0 and GHC 7.8.2 on OS X

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


More information about the ghc-tickets mailing list