
#10484: hPutBuf crashes when trying to write a large string to stdout (resource exhausted) -------------------------------------+------------------------------------- Reporter: bayloff | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: | Version: 7.8.3 libraries/base | Operating System: Windows Keywords: | Type of failure: Runtime crash Architecture: | Blocked By: Unknown/Multiple | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- The following program crashes when I try to write a byte string larger than 61kb to stdout: {{{#!hs import qualified Data.ByteString.Char8 as BS main = BS.putStrLn $ BS.replicate (62 * 1024) 'x' }}} When I run the above, I get the following runtime error: {{{ <stdout>: hPutBuf: resource exhausted (Not enough space) }}} GHC versions tested: 7.6.3 and 7.8.3 (both 32 and 64 bit) OS: Windows 7 and Windows Server 20008R2 The issue is not reproducible with the Linux version of GHC. It is also not reproducible if I use the Lazy variant of the byte strings. Note: The Linux version of the program was tested with GHC 7.6.3 because this is the one I have on my Ubuntu machine. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10484 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler