[erlang-bugs] Strange Memory Allocation Crash

Björn-Egil Dahlberg <>
Wed Jul 7 14:11:17 CEST 2010


The error_logger can't consume the info messages you send at the rate 
that that tight loop produces them.

erl_crash.dump:
<0.5.0>	error_logger	Garbing (limited info)	27440736	182452560	7557980

Regards,
Björn-Egil
Erlang/OTP

On 2010-07-07 13:27,  wrote:
>
>
> While try to do a quick check on which floats need to be rounded before
> trunking them to get valid results, I was able to crash the Erlang VM.  I find
> it a bit strange as it happened rather quickly into something that I thought
> shouldn't be that intensive.  I have tried this twice, and was wondering if
> this could be pointing to something else as a problem.
>
> Machine Info
> :~/sdb/work/gf_olympus/troy/trunk/tmp>  uname -a
> Linux greyowl 2.6.31.12-0.2-default #1 SMP 2010-03-16 21:25:39 +0100 x86_64
> x86_64 x86_64 GNU/Linux
> :~/sdb/work/gf_olympus/troy/trunk/tmp>  erl --version
> Erlang R14A (erts-5.8) [source] [64-bit] [smp:2:2] [rq:2] [async-threads:0]
> [hipe] [kernel-poll:false]
>
>
> ============== CODE START
>
> -module(itest).
> -export([do/0]).
>
> do() ->
>      do(0.0).
>
> do(100.0) ->
>      done;
> do(Value) ->
>      if trunc(Value * 100) =:= trunc(round(Value * 100)) ->
> 	do(Value + 0.01);
>         true ->
> 	error_logger:info_msg("Value: ~p~n", [Value]),
> 	    do(Value + 0.01)
>      end.
>
> ============== CODE END
>
> The final result.  (After 280 iterations of the function the following crash)
>
> =INFO REPORT==== 7-Jul-2010::11:33:07 ===
> Value: 2.7999999999999843
>
> Crash dump was written to: erl_crash.dump
> eheap_alloc: Cannot allocate 20672 bytes of memory (of type "heap").
> Aborted
>
>
> The code is attached
>
> I am a bit at a loss as to where to start troubleshooting this :)
>



More information about the erlang-bugs mailing list