GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2019-07-07T18:41:32Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/9172integer overflow in allocate()2019-07-07T18:41:32Zrwbartoninteger overflow in allocate()```
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://w...```
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;
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------- |
| Version | 7.8.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Runtime System |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | simonmar |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"integer overflow in allocate()","status":"New","operating_system":"","component":"Runtime System","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"OwnedBy","contents":"rwbarton"},"version":"7.8.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":["simonmar"],"type":"Bug","description":"{{{\r\nPrelude> Data.Array.array (0,2^61 * 1024 `div` 1025) []\r\narray (0,<interactive>: internal error: evacuate: strange closure type 2131681697\r\n (GHC version 7.8.1 for x86_64_unknown_linux)\r\n Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\nAborted\r\n}}}\r\nYou 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:\r\n{{{\r\n W_ req_blocks = (W_)BLOCK_ROUND_UP(n*sizeof(W_)) / BLOCK_SIZE;\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->7.8.3rwbartonrwbarton