[erlang-bugs] bug in binary_to_term

Bjorn Gustavsson bjorn@REDACTED
Thu Nov 22 14:40:35 CET 2007


"Joe Armstrong" <erlang@REDACTED> writes:

> -module(bug).
> 
> -compile(export_all).
> 
> %% If you do B = term_to_binary(Term)
> %% and then concatinate some extra data to the end of
> %% B then binary_to_term of the new binary succeeds
> %% It should fail.

It is not a bug, it is a feature.

It is implemented that way for historical reasons, long ago by someone
at the CS lab. It can't be changed now, because there is code that depends
on the old behaviour, for instance, the distribution in the emulator itself
and dets (including dets files).

We have actually made an attempt to fix this "bug", but failed miserably
because too much code depended on it.

/Bjorn
-- 
Björn Gustavsson, Erlang/OTP, Ericsson AB



More information about the erlang-bugs mailing list