Closed UnTraDe closed 2 years ago
Thanks for the report, and the helpful testcase!
This should be fixed in this branch with this commit: https://github.com/esp-rs/rust/commit/2e592a919c28f14a0b30bcf6e25536fe25d63f13.
I have also submitted the fix upstream (see the linked PR).
This patch is now included in our 1.58 release. It's still not been accepted upstream, but hopefully it will soon!
Closing this now.
Allocating a type with alignment bigger than 4 bytes sometimes gets allocated on address which is not a multiple of that alignment, causing accesses to fail
debug_assert!
inslice::from_raw_parts_*
Note that the alignment of
Something
is 8, and sometimes the pointer is not a multiple of 8, causing a panic infor x in &mut v {
in debug builds.Happens on ESP32 with Rust STD library, using https://github.com/ivmarkov/rust-esp32-std-demo