Compiler nondeterministic behaviour
delitrem opened this issue · comments
Igor Goryachev commented
Describe the bug
Compiler sometimes generates different beams for some sources.
(It seems this behaviour is somehow related to -doc() attributes and maps in beams.)
To Reproduce
$ cd path/to/erlang/otp
$ for a in $(seq 1 10); do make; md5sum lib/ssh/ebin/ssh_sftp.beam >> ../result.txt; rm lib/ssh/ebin/ssh_sftp.beam; done
$ cat ../result.txt
186705d7c040a85b938c7871305c34fe lib/ssh/ebin/ssh_sftp.beam
186705d7c040a85b938c7871305c34fe lib/ssh/ebin/ssh_sftp.beam
d4f1dc07cd63e00170723af6e174eee2 lib/ssh/ebin/ssh_sftp.beam
186705d7c040a85b938c7871305c34fe lib/ssh/ebin/ssh_sftp.beam
186705d7c040a85b938c7871305c34fe lib/ssh/ebin/ssh_sftp.beam
186705d7c040a85b938c7871305c34fe lib/ssh/ebin/ssh_sftp.beam
186705d7c040a85b938c7871305c34fe lib/ssh/ebin/ssh_sftp.beam
186705d7c040a85b938c7871305c34fe lib/ssh/ebin/ssh_sftp.beam
186705d7c040a85b938c7871305c34fe lib/ssh/ebin/ssh_sftp.beam
186705d7c040a85b938c7871305c34fe lib/ssh/ebin/ssh_sftp.beam
Expected behavior
Compiler generates the same data.
Affected versions
OTP-27.0, git master.
Michael Truog commented
If you use the configure flag --enable-deterministic-build
that shouldn't happen.
Igor Goryachev commented
The same behaviour with ./configure --enable-deterministic-build
.
Igor Goryachev commented
After applying provided patch, then updating bootstrap, everything works as expected.
Lukas Larsson commented
Fix will be part of OTP-27.0.1.