[GHC] #9647: allocation of 10790760 bytes too large

GHC ghc-devs at haskell.org
Mon Sep 29 19:16:13 UTC 2014


#9647: allocation of 10790760 bytes too large
-------------------------------------+-------------------------------------
              Reporter:  mirko       |            Owner:
                  Type:  bug         |           Status:  new
              Priority:  normal      |        Milestone:
             Component:  Compiler    |          Version:  7.8.3
            Resolution:              |         Keywords:  run time
      Operating System:  Windows     |  insufficient memory
       Type of failure:  Incorrect   |     Architecture:  x86_64 (amd64)
  warning at compile-time            |       Difficulty:  Unknown
             Test Case:              |       Blocked By:
              Blocking:              |  Related Tickets:
Differential Revisions:              |
-------------------------------------+-------------------------------------
Description changed by mirko:

Old description:

> Here is the error message first, followed
> by my description of what happened.
>
> hs> ghc -o void void.hs -rtsopts
> [1 of 1] Compiling Main ( void.hs, void.o )
> Linking void.exe ...
>
> hs> void +RTS -K400M -RTS > void.txt
> void: internal error: allocation of 10790760 bytes too large
> (GHC should have complained at compile-time)
>
>     (GHC version 7.8.3 for x86_64_unknown_mingw32)
>     Please report this as a GHC bug:
> http://www.haskell.org/ghc/reportabug
>
> hs> void +RTS -K40000M -RTS > void.txt
> void: internal error: allocation of 10790760 bytes too large
> (GHC should have complained at compile-time)
>
>     (GHC version 7.8.3 for x86_64_unknown_mingw32)
>     Please report this as a GHC bug:
> http://www.haskell.org/ghc/reportabug
>
> Description of what happened:
> I gave my program really large numbers.
> It contains the following line:
>
> rr = (of40)*(r3041)
>
> where of40 is an integer which has about 2 515 968
> (that is two million+) decimal digits (explicitly
> written out and initialized in the .hs file).
> In addition, of40 is multiplied by (r to the power or 3041),
> where r is a 250-digit number so (r to the power or 3041)
> has about 760 250 (seven hundred sixty thousand+) decimal digits.
> This makes the product
>
> rr = (of40)*(r3041)
>
> to have more than 3 000 000 (three million+) decimal digits.
>
> I tried to compile it three times, twice unsuccessful
> (insufficient amount of memory during compilation),
> and the third time successful, after 12 hours work by
> the compiler, and me increasing the paging file to
> initial size 49152 Mb, max size 196608 Mb.
> (At the end of compilation the Paging file reported as:
> Recommended 24574 Mb, Currently allocated: 163765 Mb.)
> I run a Hewlett-Packard HPE 500y, upgraded to 16 Gb RAM,
> Windows 7, AMD Phenom(tm) II X6 1045T Processor 2.70 GHz (6 core).
> The compiler produced a big exe file:
> 09/27/2014 09:38 PM 20,602,960 void.exe
> When I tried to run the exe file I got the error messages
> as already enclosed at the beginning of this description.
> Most of the time during compilation the computer used
> all of the available memory.
>
> Note that I gave the options -rtsopts to the compiler,
> and the option +RTS -K400M -RTS when I tried
> to execute the compiled program (I believe this is
> some kind of a request for more memory), and one more
> attempt with +RTS -K40000M -RTS, both versions generated
> the error messages shown above.
>
> P.S. Thanks to Richard Eisenberg and Herbert Valerio Riedel
> for replying to my email, after BotScout kept me from
> submitting my report. Apparently I passed the
> evaluation-captcha (on my second attempt) but
> nevertheless BotScout insisted I was spam.

New description:

 Here is the error message first, followed
 by my description of what happened.

 hs> ghc -o void void.hs -rtsopts
 [1 of 1] Compiling Main ( void.hs, void.o )
 Linking void.exe ...

 hs> void +RTS -K400M -RTS > void.txt
 void: internal error: allocation of 10790760 bytes too large
 (GHC should have complained at compile-time)

     (GHC version 7.8.3 for x86_64_unknown_mingw32)
     Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug

 hs> void +RTS -K40000M -RTS > void.txt
 void: internal error: allocation of 10790760 bytes too large
 (GHC should have complained at compile-time)

     (GHC version 7.8.3 for x86_64_unknown_mingw32)
     Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug

 Description of what happened:
 I gave my program really large numbers.
 It contains the following line:

 rr = (of40)*(r^3041)

 where of40 is an integer which has about 2 515 968
 (that is two million+) decimal digits (explicitly
 written out and initialized in the .hs file).
 In addition, of40 is multiplied by (r to the power or 3041),
 where r is a 250-digit number so (r to the power or 3041)
 has about 760 250 (seven hundred sixty thousand+) decimal digits.
 This makes the product

 rr = (of40)*(r^3041)

 to have more than 3 000 000 (three million+) decimal digits.

 I tried to compile it three times, twice unsuccessful
 (insufficient amount of memory during compilation),
 and the third time successful, after 12 hours work by
 the compiler, and me increasing the paging file to
 initial size 49152 Mb, max size 196608 Mb.
 (At the end of compilation the Paging file reported as:
 Recommended 24574 Mb, Currently allocated: 163765 Mb.)
 I run a Hewlett-Packard HPE 500y, upgraded to 16 Gb RAM,
 Windows 7, AMD Phenom(tm) II X6 1045T Processor 2.70 GHz (6 core).
 The compiler produced a big exe file:
 09/27/2014 09:38 PM 20,602,960 void.exe
 When I tried to run the exe file I got the error messages
 as already enclosed at the beginning of this description.
 Most of the time during compilation the computer used
 all of the available memory.

 Note that I gave the options -rtsopts to the compiler,
 and the option +RTS -K400M -RTS when I tried
 to execute the compiled program (I believe this is
 some kind of a request for more memory), and one more
 attempt with +RTS -K40000M -RTS, both versions generated
 the error messages shown above.

 P.S. Thanks to Richard Eisenberg and Herbert Valerio Riedel
 for replying to my email, after BotScout kept me from
 submitting my report. Apparently I passed the
 evaluation-captcha (on my second attempt) but
 nevertheless BotScout insisted I was spam.

--

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


More information about the ghc-tickets mailing list