Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler nondeterministic behaviour #8579

Closed
delitrem opened this issue Jun 13, 2024 · 4 comments
Closed

Compiler nondeterministic behaviour #8579

delitrem opened this issue Jun 13, 2024 · 4 comments
Labels
bug Issue is reported as a bug team:VM Assigned to OTP team VM
Milestone

Comments

@delitrem
Copy link
Contributor

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.

@delitrem delitrem added the bug Issue is reported as a bug label Jun 13, 2024
@okeuday
Copy link
Contributor

okeuday commented Jun 14, 2024

If you use the configure flag --enable-deterministic-build that shouldn't happen.

@delitrem
Copy link
Contributor Author

The same behaviour with ./configure --enable-deterministic-build.

@delitrem delitrem reopened this Jun 14, 2024
@IngelaAndin IngelaAndin added the team:VM Assigned to OTP team VM label Jun 16, 2024
@delitrem
Copy link
Contributor Author

delitrem commented Jun 16, 2024

After applying provided patch, then updating bootstrap, everything works as expected.

@garazdawi garazdawi added this to the OTP-27.0.1 milestone Jun 20, 2024
@garazdawi
Copy link
Contributor

Fix will be part of OTP-27.0.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is reported as a bug team:VM Assigned to OTP team VM
Projects
None yet
Development

No branches or pull requests

4 participants