-
Notifications
You must be signed in to change notification settings - Fork 105
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
Delayed UB instrumentation regression: slices #3881
Comments
I did some debugging. TL;DR: this upstream change rust-lang/rust#135265 causes this regression. The problem is that our delayed UB instrumentation panics if there are any reachable function pointers. Previously, this test didn't have any, but the new calls to expect introduce some. More Detail
I generated the dot graphs for both the 2/4 and 2/5 toolchains. I determined that both have this edge in their graphs:
after which point they diverge, and the 2/5 toolchain ends up encountering this problematic function pointer. I then did the following: Changed this line:
to refer to self.edges instead, so I could dump the edges flowing out of new_display , instead of the edges flowing into it.Then, I ran:
on both the 2/4 and 2/5 toolchains. These graphs shows how the slice index panic code calls this |
Thankfully, this doesn't cause unsoundness, since we panic rather than report verification success. It's a bit of a shame though, since we shouldn't actually need to investigate this panic code to find the UB. We could consider modifying this instrumentation to just report verification failure if it encounters a function pointer, instead of panicking. I think(?) that if we do that, we should be able to report the UB and then print some message like "Note that we couldn't fully investigate everything, so if we say there's UB, there's UB, but even if we didn't find UB, we failed anyway since we encountered a function pointer and therefore couldn't be sure if there was UB or not." |
Upgrade toolchain to 2/10. I **highly recommend** reviewing this PR commit-by-commit. The description in each commit message links to the upstream PRs that prompted those particular changes. ## Callouts - 2/1 had a lot of formatting changes. I split the commits for that day into formatting changes and functionality changes accordingly. - 2/5 introduced a regression in our delayed UB instrumentation, so I made a new fixme test. See #3881 for details. ## Culprit PRs: rust-lang/rust#134424 rust-lang/rust#130514 rust-lang/rust#135748 rust-lang/rust#136590 rust-lang/rust#135318 rust-lang/rust#135265 rust-lang/rust@bcb8565 rust-lang/rust#136471 rust-lang/rust#136645 Resolves #3863 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.
I tried this code:
using the following command line invocation:
or, alternatively:
with Kani version: 0.60-dev, after upgrading the toolchain to 2/5/2025.
I expected to see this happen: Verification fails with this message:
and thus the test succeeds.
Instead, this happened:
The text was updated successfully, but these errors were encountered: