-
Notifications
You must be signed in to change notification settings - Fork 23
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
Bad unsafe is caught by latest rust nightly (rustc 1.70.0-nightly (2eaeb1eee 2023-04-05)) #15
Comments
This was caught by a recent change to Rust (22a7a19f9333bc1fcba97ce444a3515cb5fb33e6) which proactively detects dereferences of unaligned pointers. Switching from a dereference to the unaligned read and write methods fixes all the tests on today's nightly. Fixes Cykooz#15.
…f6d3 Use (read|write)_unaligned for unaligned pointers (#15)
Current releases of fast_image_resize are broken on rust nightly Cykooz/fast_image_resize#15 Issue is already fixed on master branch but the new verison is not released yet So temporarly use a clone of fast_image_resize current master branch as a local submodule and add corresponding patch field in our Cargo.toml
I'm still seeing this issue on nightly even with |
I'm not sure that pull request of durin42 fixed all the bugs. I didn't check it on nightly toolchain. I only merge pull request and create 2.7.1 release. |
I have run tests on nightly toolchain and x86_64 architecture. I don't see any issues. |
I have reproduced this issue on arm64 architecture. |
I have released v2.7.2 with fixes for arm64. |
Several of the functions in simd_utils.rs are doing UB in unsafe blocks, eg
is taking a slice of [i16] which is only going to be 2-byte aligned and casting it to an *i32 which has to be 4-byte aligned. rust-lang/rust@22a7a19 Was recently added to rustc to catch this kind of UB at runtime, and it's firing in the test suite:
easy to reproduce with
cargo +nightly test
.The text was updated successfully, but these errors were encountered: