-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Transforming &[u8; 16] to [u64; 2] using transmute_copy causes Bus errors on aarch64 #55044
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
Comments
It's definitely UB somewhere: try running this with MIRI https://play.rust-lang.org/?version=stable&mode=debug&edition=2015&gist=794f6a68cf5009fe2c9c8c1277fd42f0. |
Looks like replacing |
newpavlov
added a commit
to newpavlov/rust
that referenced
this issue
Oct 13, 2018
Closes: rust-lang#55044 This change could result in performance regression on non-x86 platforms. Alternative would be to update `transmute_copy` with alignment requirements.
bors
added a commit
that referenced
this issue
Nov 13, 2018
Use read_unaligned instead of read in transmute_copy Closes: #55044 This change could result in performance regression on non-x86 platforms. (but it also can fix some of UB which lurks in existing programs) An alternative would be to update `transmute_copy` documentation with alignment requirements.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See this issue: RustCrypto/stream-ciphers#5
The line in question is here. Does it contain UB or is it a miscompilation? If it's the former, then I think
transmute_copy
documentation should be updated accordingly.The text was updated successfully, but these errors were encountered: