#3808: piping binary files sometimes fail
-------------------------------+--------------------------------------------
Reporter: paolino | Owner: simonmar
Type: bug | Status: assigned
Priority: high | Milestone: 6.12.2
Component: Compiler | Version: 6.12.1
Keywords: pipe binary IO | Difficulty:
Os: Linux | Testcase:
Architecture: x86_64 (amd64) | Failure: Runtime crash
-------------------------------+--------------------------------------------
Changes (by simonmar):
* cc: d...@… (added)
Comment:
It's not so easy. Bytestring also calls `hWaitForInput`, which does
decoding because it only returns when there is at least one full character
to read, not a partial byte sequence. This is the only sensible semantics
for `hWaitForInput`, so I'm afraid we have to take a different approach: I
suggest ByteString stops using `hWaitForInput` (I can fix `hIsEOF` as
described above).
I looked at the code for `DB.Lazy.hGetContents`, and as far as I can tell
it should be possible to use a blocking read rather than the
`hGetNonBlocking`, `hIsEOF`, `hWaitForInput` combination that is used now.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3808#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs