Skip to content
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

Closed
RalfJung opened this issue Feb 17, 2020 · 4 comments · Fixed by #26 or #27
Closed

Heads-up: UB due to misuse of mem::uninitialized will soon lead to panic #25

RalfJung opened this issue Feb 17, 2020 · 4 comments · Fixed by #26 or #27

Comments

@RalfJung
Copy link

Here, this crate causes UB by "Producing an invalid value". Concretely, it produces a value of an arbitrary type T with mem::uninitialized(). In the near future the call to mem::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 is MaybeUninit, 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 using ManuallyDrop; likely the fix will involve replacing that by MaybeUninit.

@bbqsrc
Copy link

bbqsrc commented Nov 19, 2020

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. 😄

@antonok-edm
Copy link

@zslayton @bbqsrc we're also using this in production, and will need to be able to build on arm64 macOS quite soon - please let me know if there's anything I can do to assist with this effort 😃

@zslayton
Copy link
Owner

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 lifeguard users would be great.

@zslayton
Copy link
Owner

@bbqsrc @antonok-edm: I've published this fix as part of the new v0.6.1 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants