[erlang-bugs] : R12B-3: string:to_integer() sporadic failures

Raimo Niskanen <>
Tue Sep 2 11:40:55 CEST 2008

On Tue, Sep 02, 2008 at 04:23:59AM -0400, Edwin Fine wrote:
> Thanks, Dan. As a matter of interest, what was the error (executive
> summary:) ?

When the result became a bignum, a second allocation of heap
space was made - the first for the result container and the
second for the bignum; and these were in the wrong order
temporal vs pointerwise violating an essential garbage
collector assumption.

So, when the second allocation happened to allocate
a temporary heap buffer aka "heap fragment", a
subsequent garbage collect messed up ending with
the result pointing to invalid data in freed memory...

This could have lead to almost anything including
emulator crash.

> Regards,
> Edwin

> _______________________________________________
> erlang-bugs mailing list
> http://www.erlang.org/mailman/listinfo/erlang-bugs


/ Raimo Niskanen, Erlang/OTP, Ericsson AB

More information about the erlang-bugs mailing list