-
Notifications
You must be signed in to change notification settings - Fork 15
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
misaligned pointer dereference #53
Comments
Rust 1.70.0 changelog has this line which might be relevant:
|
Ouch, yeah we don't test Windows targets in crater and I don't test them personally. It looks to me like Windows is returning a pointer that is not sufficiently aligned. The standard library has used let (name, is_directory, next_entry) = unsafe {
let info = buffer.as_ptr().cast::<c::FILE_ID_BOTH_DIR_INFO>();
// While this is guaranteed to be aligned in documentation for
// https://docs.microsoft.com/en-us/windows/win32/api/winbase/ns-winbase-file_id_both_dir_info
// it does not seem that reality is so kind, and assuming this
// caused crashes in some cases (https://github.com/rust-lang/rust/issues/104530)
// presumably, this can be blamed on buggy filesystem drivers, but who knows.
let next_entry = ptr::addr_of!((*info).NextEntryOffset).read_unaligned() as usize;
let length = ptr::addr_of!((*info).FileNameLength).read_unaligned() as usize;
let attrs = ptr::addr_of!((*info).FileAttributes).read_unaligned();
let name = from_maybe_unaligned(
ptr::addr_of!((*info).FileName).cast::<u16>(),
length / size_of::<u16>(),
); |
Thanks for the report! |
I'm seeing this in our GitHub Actions failing. Tests worked with Rust 1.69.0 using
stable-i686-pc-windows-msvc
toolchain, but seems to fail with Rust 1.70.0 with same toolchain.Affected function:
ipconfig/src/adapter.rs
Lines 289 to 301 in f6d918f
The text was updated successfully, but these errors were encountered: