bytecodealliance / bytecodealliance/rustix
Eliminate integer-to-pointer casts in futex for compatibility with Miri?
Open
- Dominant language
- Rust
- Stars
- 2.1k
- Forks
- 294
- Avg merge
- 4h 7m
- Merged PRs (30d)
- 2
Description
In one of my projects [this line](https://github.com/bytecodealliance/rustix/blob/main/src/backend/libc/thread/syscalls.rs#L477) is the only place where Miri complains (warning by default, hard error with `-Zmiri-strict-provenance`).
The cast itself looks pretty suspicious to me and the quoted text is no longer present in the linked man page. Ideally, it would be nice to eliminate it completely, but as a quick and dirty workaround checking for zero and returning `ptr::null()` gated behind `#[cfg(miri)]` would work in most cases as well.
Contributor guide
Assessment
This issue has not been assessed yet.