[erlang-questions] 1PB of arg_reg - wait what?

Simon MacMullen simon@REDACTED
Tue May 8 16:30:11 CEST 2012


We've just had a report of a Rabbit broker dying trying to allocate 
approximately 1PB of memory:

http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/2012-May/019896.html

Slogan: std_alloc: Cannot allocate 1124304355803072 bytes of memory (of 
type "arg_reg").

Which is unfortunate enough in itself - but arg_reg? My understanding of 
beam internals is not great, but that looks to be something like a stack 
frame. A 1PB stack frame?

As far as I can see "arg_reg" memory is only allocated in one place, 
around line 3100 of beam_emu.c:

https://github.com/erlang/otp/blob/maint/erts/emulator/beam/beam_emu.c#L3157

...where size is set to c_p->arity * sizeof(c_p->arg_reg[0]).

process.arg_reg is an Eterm*, so sizeof(Eterm) *cannot* be huge, so it 
must be the arity which is ~10^15. We have some excessive arities in 
RabbitMQ, but not quite to that extent.

Does anyone have any idea how this could arise, or can it just be 
chalked up to cosmic rays?

Cheers, Simon

-- 
Simon MacMullen
RabbitMQ, VMware



More information about the erlang-questions mailing list