[erlang-bugs] Seg fault in binary_to_term on bad data

Matthew Dempsky <>
Mon Apr 14 19:18:12 CEST 2008


Calling binary_to_term can cause a segmentation fault.  The binary
below is an EXPORT_EXT encoding, but with the Module, Function, and
Arity parts all set to SMALL_INTEGER_EXT encoding for 13.  I expect
binary_to_term to instead just raise an exception in the calling
process.

:~$ erl
Erlang (BEAM) emulator version 5.6.2 [source] [64-bit]
[async-threads:0] [kernel-poll:false]

Eshell V5.6.2  (abort with ^G)
1> binary_to_term(<<131,113,97,13,97,13,97,13>>).
Segmentation fault (core dumped)



More information about the erlang-bugs mailing list