Closed encounter closed 5 months ago
Ugh looks like freebsd needs a CI fix. Let's see when I can actually fix this all up.
Hm I would have liked #604 to be a separate commit. This way it is harder to diff. Whole thing is already hairy enough.
I will merge the other one first, that will also credit the author and merges the part we know to be working. Please do me the favor and rebase on top of that.
The primary issue is that
mem::transmute
fromisize
toBox<_>
(without first casting to*mut _
) is undefined behavior.Rust Playground example (check with Tools -> Miri)
On Rust v1.78.0+, this ends up crashing with
STATUS_ILLEGAL_INSTRUCTION
whenReadDirectoryChangesW
fails and this branch is hit in release mode. One easy way to hit this branch is to attempt to create a notifier for\\wsl.localhost\...
or similar.While this could be fixed by simply adding
as *mut ReadDirectoryRequest
, this cleans up the overall unsafe logic to be more readable and idiomatic Rust.