You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When compiling the following code with any erlc from OTP 24.3.x (tested with 24.3.4.17) the resulting .beam file reports corrupted binary padding when executed on an x86_64 linux machine with either of OTP24/OTP25/OTP26/OTP27
To Reproduce
Save the attached erlang code as binary_error.erl and execute the corruption demo:
# Using OTP24 on linux x86_64
erlc binary_error.erl
# Using either of OTP24/25/26/27
erl -eval "binary_error:demo()"
Erlang/OTP 24 [erts-12.3.2.17] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit]
Eshell V12.3.2.17 (abort with ^G)
1> Error <<0,0,0,0,0,0,0,0,0,0,0,0,191,26,214,52,25,183,242,40,245,124,0,0,232,0, 0,0,0,0,0,0>> != <<0,0,0,0,0,0,0,0,0,0,0,0,46,39,82,188,226,30,28,247, 217,209,255,170,91,199,135,225,44,86,233,52>>...<snip>...Done found 37 errors in 10000 iterations
Using the same OTP24 pre compiled .beam file with OTP27 (27.0.1):
Describe the bug
When compiling the following code with any erlc from OTP 24.3.x (tested with 24.3.4.17) the resulting .beam file reports corrupted binary padding when executed on an x86_64 linux machine with either of OTP24/OTP25/OTP26/OTP27
To Reproduce
Save the attached erlang code as binary_error.erl and execute the corruption demo:
Using the same OTP24 pre compiled .beam file with OTP27 (27.0.1):
Expected behavior
It is expected that the padding result of
<<0:96/unsigned-integer, Hash:20/binary>>
always retains the same 20 bytes ofHash
as postfix.Affected versions
Compiler of OTP24 (24.3.4.17) is causing this issue.
Runtimes of OTP24/25/26/27 are all affected if the compiled .beam file of OTP24 is used.
Additional context
binary_error.erl
The text was updated successfully, but these errors were encountered: