Comments (3)
Thanks for the report!
I fixed it, and I will publish a new version soon.
from ipconfig.
Rust 1.70.0 changelog has this line which might be relevant:
- rust-lang/rust#98112 This catches undefined behavior at runtime, and may cause existing code to fail.
from ipconfig.
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 addr_of!
to navigate such issues before, perhaps that would be viable fix here? https://github.com/rust-lang/rust/blob/f91b634643de14ab5156b0c084d80bd6845fb0ae/library/std/src/sys/windows/fs.rs#L766-L778
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>(),
);
from ipconfig.
Related Issues (12)
- Support i686-pc-windows-msvc HOT 2
- Build fails on x86_64 -msvc targets because clang.dll cannot be found HOT 1
- The documentation link in the README does not work HOT 2
- On get_search_list returns extra first result HOT 4
- Panic in get_search_list when the SearchList registry key is missing HOT 1
- unix support HOT 3
- New release 0.2.1? HOT 2
- [Question] How to know which interface is the one used? HOT 5
- Consider upgrade socket2 to v0.4 HOT 1
- Can we get a new release for the winapi dep?
- Feature Request: Connection Profile HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ipconfig.