
#7161: hSetNewlineMode and hSetEncoding can be performed on closed and semi-closed handles -------------------------------------+------------------------------------- Reporter: duncan | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Core Libraries | Version: 7.6.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by joeyhess): I reproduced this bug in the wild today. Here is my test case: import GHC.IO.Encoding import System.IO main = do e <- getFileSystemEncoding hClose stdin hSetEncoding stdin e ghc 8.0.1 on Linux. For me, the crash only occurs with LANG=C. With my usual locale of en_US.utf8 there is no crash. Perhaps this is why there was a problem reproducing it. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/7161#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler