[GHC] #9172: integer overflow in allocate()
GHC
ghc-devs at haskell.org
Thu Jun 5 05:27:58 UTC 2014
#9172: integer overflow in allocate()
------------------------------------+-------------------------------------
Reporter: rwbarton | Owner: rwbarton
Type: bug | Status: new
Priority: normal | Milestone:
Component: Runtime System | Version: 7.8.1
Keywords: | Operating System: Unknown/Multiple
Architecture: Unknown/Multiple | Type of failure: None/Unknown
Difficulty: Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: |
------------------------------------+-------------------------------------
{{{
Prelude> Data.Array.array (0,2^61 * 1024 `div` 1025) []
array (0,<interactive>: internal error: evacuate: strange closure type
2131681697
(GHC version 7.8.1 for x86_64_unknown_linux)
Please report this as a GHC bug:
http://www.haskell.org/ghc/reportabug
Aborted
}}}
You can get a variety of other errors too. The array size is chosen so
that the total size (in words) passed to `allocate` is just a bit over
2^61^. The computation of `req_blocks` overflows:
{{{
W_ req_blocks = (W_)BLOCK_ROUND_UP(n*sizeof(W_)) / BLOCK_SIZE;
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9172>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list