logo       

[ ghc-Bugs-1187295 ] runProcess hangs with duplicate handles: msg#00100

lang.haskell.glasgow.bugs

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

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

Category: libraries/base
Group: 6.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Roman Leshchinskiy (romanle)
Assigned to: Nobody/Anonymous (nobody)
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

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

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


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise