#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):

  * owner:  => simonmar
  * priority:  normal => high
  * status:  new => assigned
  * milestone:  => 6.12.2


Comment:

 `Data.ByteString.Lazy.hGetContents` calls `hIsEOF` which calls
 `hLookAhead`, and `hLookAhead` reads the next `Char` from the `Handle`,
 which does Unicode decoding. Putting `stdin` into binary mode fixes the
 problem.

 After giving this a bit of thought, I think the best solution is to make
 `hIsEOF` not do any decoding, so I'll look into doing that.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3808#comment:3>
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

Reply via email to