[GHC] #15174: got internal error when running a simple but computationally intensive loop

GHC ghc-devs at haskell.org
Tue May 22 05:41:40 UTC 2018


#15174: got internal error when running a simple but computationally intensive loop
-------------------------------+---------------------------------
           Reporter:  rgrover  |             Owner:  (none)
               Type:  bug      |            Status:  new
           Priority:  normal   |         Milestone:  8.6.1
          Component:  GHCi     |           Version:  8.2.2
           Keywords:           |  Operating System:  Linux
       Architecture:  ia64     |   Type of failure:  None/Unknown
          Test Case:           |        Blocked By:
           Blocking:           |   Related Tickets:
Differential Rev(s):           |         Wiki Page:
-------------------------------+---------------------------------
 Got the following on the GHCi prompt:
 {{{
 λ> main
 <interactive>: internal error: Unable to commit 1048576 bytes of memory
     (GHC version 8.2.2 for x86_64_unknown_linux)
     Please report this as a GHC bug:
 http://www.haskell.org/ghc/reportabug
 Aborted (core dumped)
 }}}

 The program being run:

 {{{#!hs
 gaussian mean sigma x =
     exp (-0.5 * (x - mean) ^ 2 / sigma ^ 2) / (sigma * sqrt (2 * pi))

 integrate :: (Double -> Double) -> (Double, Double) -> Double -> Double
 integrate f (low, high) step = step * sum values
     where xs = [low, low+step .. high]
           values = f <$> xs

 main = print $ integrate (gaussian 100 10) (-1 * 1e5, 1e5) 0.001
 }}}

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15174>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list