Re: [GHC] #5212: waitForProcess: does not exist (No child processes)

#5212: waitForProcess: does not exist (No child processes) ------------------------------------------+--------------------------------- Reporter: chrisdone | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Runtime System | Version: 7.4.2 Resolution: | Keywords: Os: Linux | Architecture: x86_64 (amd64) Failure: Incorrect result at runtime | Difficulty: Testcase: | Blockedby: Blocking: | Related: ------------------------------------------+--------------------------------- Changes (by chrisdone): * status: closed => new * cc: chrisdone@… (added) * component: GHC API => Runtime System * version: 6.12.3 => 7.4.2 * owner: chrisdone => * resolution: worksforme => Comment: Oddly, two years later I am experiencing the same problem. I was never able to reproduce it outside of production, which was a machine I had no control over. In the end I worked around it by running: catch (waitForProcess pid >>= return) (\_ -> return $ ExitSuccess) However, that was a workaround, not a solution. This time with a completely different codebase, XMonad, I can reproduce it in few lines of code: Here's a test-case: {{{ import Control.Concurrent import System.Process import XMonad import XMonad.Config main = do forkIO $ xmonad defaultConfig readProcess "ghc" ["--version"] "" >>= putStrLn }}} Compile and run like this (make sure you don't have xmonad already running): {{{ chris@retina:~$ ghc --make X.hs -threaded [1 of 1] Compiling Main ( X.hs, X.o ) Linking X ... chris@retina:~$ ./X X: waitForProcess: does not exist (No child processes) }}} The GHC version is 7.4.2, but it perhaps it's not so much a GHC bug but some behaviour of the runtime system and interaction with exceptions that is subtle or unclear to me. Can anyone reproduce, and if so, why does this happen? If you comment out the forkIO line, the program succeeds. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/5212#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC