[GHC] #15500: internal error: Unable to commit 1048576 bytes of memory. Deepseq

#15500: internal error: Unable to commit 1048576 bytes of memory. Deepseq --------------------------------------+---------------------------------- Reporter: alxdb | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Keywords: memory deepseq | Operating System: Linux Architecture: x86_64 (amd64) | Type of failure: Runtime crash Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: --------------------------------------+---------------------------------- the following code is a (nearly) minimal working example that causes the aforementioned internal error. {{{#!hs module Main where import Control.DeepSeq myfunc :: Int -> Int myfunc x = sum . take x $ [0..] logiter :: (NFData a) => Int -> (a -> a) -> a -> IO a logiter iter f x | iter >= 0 = do let y = f x deepseq y print $ "iter " ++ show iter if iter == 0 then return y else logiter (iter - 1) f y | otherwise = error "no negative iter!" main :: IO () main = do print "start" print . show $ myfunc 2000000 print "done" print "start" res <- logiter 5 myfunc 2000000 print "done" print . show $ res }}} Perhaps this is an issue with deepseq, however it the message does say to come and report the bug, so that's what I'm doing. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15500 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15500: internal error: Unable to commit 1048576 bytes of memory. Deepseq ----------------------------------+-------------------------------------- Reporter: alxdb | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Resolution: invalid | Keywords: memory deepseq Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ----------------------------------+-------------------------------------- Changes (by alxdb): * status: new => closed * resolution: => invalid Comment: I've just realised now, that this is likely due to the fact that I'm asking for the sum of several trillion numbers, recursion eh... I guess this is expected behaviour? perhaps the error message should be something a bit more informative, i.e. you've just run out of memory, rather than stating that this is an internal compiler error? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15500#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC