[ ghc-Bugs-1187295 ] runProcess hangs with duplicate handles

SourceForge.net noreply at sourceforge.net
Wed Jul 6 08:26:14 EDT 2005


Bugs item #1187295, was opened at 2005-04-21 11:11
Message generated for change (Comment added) made by simonmar
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1187295&group_id=8032

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: libraries/base
Group: 6.4
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Roman Leshchinskiy (romanle)
Assigned to: Simon Marlow (simonmar)
Summary: runProcess hangs with duplicate handles

Initial Comment:
runProcess doesn't seem to allow the same handle to be
used for redirecting stdout and stderr. Thus,

main = 
  do
    h  <- openFile "output" WriteMode
    ph <- runProcess "/bin/ls" [] Nothing Nothing
               Nothing (Just h) (Just h)
    waitForProcess ph
    return ()

hangs in ghci and aborts with "thread blocked
indefinitely" if compiled.   This isn't documented and
I hope this is not the intended behaviour as
redirecting stdout and stderr (and stdin in the case of
ptys) to the same file/pipe is quite common.

System is Linux 2.4.20-8 #1 Thu Mar 13 17:54:28 EST
2003 i686
ghc is vanilla 6.4

----------------------------------------------------------------------

>Comment By: Simon Marlow (simonmar)
Date: 2005-07-06 12:26

Message:
Logged In: YES 
user_id=48280

Fixed, thanks.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1187295&group_id=8032



More information about the Glasgow-haskell-bugs mailing list