[erlang-questions] compiler crash with eheap_alloc error compiling an erlang module with R13B04

Kostis Sagonas <>
Wed Mar 24 14:50:53 CET 2010


Rick Pettit wrote:
> I am having some trouble compiling a particular erlang module for R13B04.
> 
> This particular module was coded back in the days of R11B, and has
> compiled and run fine on a number of erlang releases since then, including
> an earlier release of R13B (R13B03).
> 
> Having grabbed and built the latest R13B04 release, I am having trouble
> compiling this particular module ....
> 
> When I try to compile this module, the compiler seems to hang for a very
> long time--minutes actually. Eventually it crashes with the following
> error:
> 
>   Crash dump was written to: erl_crash.dump
>   eheap_alloc: Cannot allocate 1781763260 bytes of memory (of type "heap").
>   Abort (core dumped)
> 
> The problem is completely reproducible--this particular module just
> doesn't want to compile. But again, it compiles and runs fine on a number
> of previous erlang releases, and has run reliably in production for
> *years* now.
> 
> I would share the contents of the file with this list, but need to clear
> that with work first.

It's conceivable that somebody from the OTP team has replied to you 
already but, in case they have not, here is what you should do.

 From your description of the problem, most probably either the compiler 
is hitting some bug that causes it to go into an infinite loop 
allocating like crazy, or it triggers a bug in the garbage collector.

What you should do is try to minimize the file so that only functions 
that trigger the bad behaviour are part of the file (they may be only 
very few such functions) and send the file either to this list (a 
stripped down version of your code is for all practical purposes 
unusable for anybody other than a compiler writer) or to Bjorn Gustavsson.

Kostis


More information about the erlang-questions mailing list