[GHC] #229: Integer overflow in array allocation

GHC trac at galois.com
Fri Jan 13 06:38:00 EST 2006


#229: Integer overflow in array allocation
-----------------------------+----------------------------------------------
  Reporter:  josefs          |          Owner:  simonmar
      Type:  bug             |         Status:  assigned
  Priority:  lowest          |      Milestone:          
 Component:  libraries/base  |        Version:  6.4.1   
  Severity:  normal          |     Resolution:  None    
  Keywords:                  |             Os:  Unknown 
Difficulty:  Unknown         |   Architecture:  Unknown 
-----------------------------+----------------------------------------------
Changes (by simonmar):

  * architecture:  => Unknown
  * difficulty:  => Unknown
  * version:  None => 6.4.1
  * os:  => Unknown

Old description:

> {{{
> When asked to create a sufficiently large array ghci
> coredumps.
>
> \begin{code}
> import Data.Array.ST
> import Control.Monad.ST
> import GHC.Base
>
> example = runST (do arr <- newArray (minInt,maxInt)
> False
>                     go arr)
>   where go :: STArray s Int Bool -> ST s Bool
>         go arr = readArray arr 3
> \end{code}
>
> Load this into ghci and type 'example'.
> }}}

New description:

 {{{
 When asked to create a sufficiently large array ghci
 coredumps.

 \begin{code}
 import Data.Array.ST
 import Control.Monad.ST
 import GHC.Base

 example = runST (do arr <- newArray (minInt,maxInt)
 False
                     go arr)
   where go :: STArray s Int Bool -> ST s Bool
         go arr = readArray arr 3
 \end{code}

 Load this into ghci and type 'example'.
 }}}

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


More information about the Glasgow-haskell-bugs mailing list