-
Notifications
You must be signed in to change notification settings - Fork 13.3k
UB in arc_from_vec_opt test #104565
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
Comments
Probably what happens is that in Miri, In fact, it might be the case that even if The fix is easy -- just do |
Yeah, the C standard is quite explicit about this, so for now we should follow suit. Opened #104568. |
Might it be a good idea to I did suspect that other platforms might not have this behaviour - #104563 seems to show this. It might be best to feature gate the test and opt to only platforms with allocators that work like this. |
Yes, but to be clear there are two bugs here:
|
Is the
With that in mnd though, I'm wondering if this opt should just be removed entirely. The perf wins I got in testing were pretty small for the amount of maintenance headache this seems likely to cause |
|
Revert Vec/Rc storage reuse opt Remove the optimization for using storage added by rust-lang#104205. The perf wins were pretty small, and it relies on non-guarenteed behaviour. On platforms that don't implement shrinking in place, the performance will be significantly worse. While it could be gated to platforms that do this (such as GNU), I don't think it's worth the overhead of maintaining it for very small gains. (rust-lang#104565, rust-lang#104563) cc `@RalfJung` `@matthiaskrgr` Fixes rust-lang#104565 Fixes rust-lang#104563
Miri reports UB in the new
arc_from_vec_opt
test:On first sight, the error seems legitimate.
That test got added in #104205.
Cc @clubby789
The text was updated successfully, but these errors were encountered: