System.Process bugs on Unix

Simon Marlow simonmarhaskell at gmail.com
Thu Mar 29 05:55:43 EDT 2007


Bryan O'Sullivan wrote:
> John Goerzen wrote:
>>
>> And strace shows that, sure enough, read(0,...) in grep is getting
>> EAGAIN.
>>
>> Sounds like somebody forgot to take the fd out of non-blocking mode.
> 
> Yep, that looks like what's happening.  See 
> System/Process/Internals.hs:runProcessPosix.  I wonder why the 
> lower-level runProcess that it calls is written in C.

We can't just take a file descriptor out of non-blocking mode, because due to 
broken POSIX semantics that would screw up GHC's use of the file descriptor 
(there's no way to set non-blocking mode per-FD).  We can "fix" this by 
modifying the IO library to work with FDs in blocking mode, which is possible in 
the threaded RTS, but we haven't completed this yet, see

   http://hackage.haskell.org/trac/ghc/ticket/724

I've just milestoned this bug for 6.6.2, so I promise to at least try to fix it 
before then...

Cheers,
	Simon


More information about the Libraries mailing list