-
Notifications
You must be signed in to change notification settings - Fork 13
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
Heads-up: UB due to misuse of mem::uninitialized will soon lead to panic #25
Comments
Any movement in #26? I am receiving complaints of build errors for one of our production dependencies. @zslayton: I understand that you had an experimental branch that might resolve this issue, though it has not been pushed to github. If you do not have the time to maintain this crate any further, please by all means let us know. I'd be happy to assist with maintaining the crate as we rely on it and will for quite some time. 😄 |
Hi all, thanks for the nudge. I'll try to find some time to address this in the next few days. I also appreciate the offers to help! I've been experimenting with a branch that exposes an API similar to the one described in this comment. I think it's more flexible and am thinking I'd like to move in that direction before a 1.0 is released. Any input from |
@bbqsrc @antonok-edm: I've published this fix as part of the new |
Here, this crate causes UB by "Producing an invalid value". Concretely, it produces a value of an arbitrary type
T
withmem::uninitialized()
. In the near future the call tomem::uninitialized()
will panic to avoid UB, and our crater run determined that this crate will be affected.mem::uninitialized()
is deprecated since Rust 1.39. The intended replacement isMaybeUninit
, which tracks the possibility of uninitialized values at the type level to make sure the compiler does not make any false assumptions. I see you are usingManuallyDrop
; likely the fix will involve replacing that byMaybeUninit
.The text was updated successfully, but these errors were encountered: