-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Miri reports stacked borrowing error in unsafe cast from element to array #24
Comments
Fixed in 1.0.4. Regarding failing to terminate, I think our tests are just slow. |
This fixes some undefined behavior, but there's probably no practical impact. See dtolnay/ryu#24 Signed-off-by: Brian Anderson <[email protected]>
Well, it violates our experimental aliasing model. This particular concern (whether that kind of restriction for raw pointers is desirable) is tracked at rust-lang/unsafe-code-guidelines#134.
Yeah, Miri is really slow, so that's probably it. I often have to reduce iteration counts with |
While testing tikv with miri I came across a report about a stacked borrowing violation in ryu, which we use via serde_json.
The error can be triggered against commit 90e4688 with miri from nightly-2020-04-17 by running:
which outputs the error
The cause seems to be this code:
which takes a pointer to the first element of an array, then later treats it as a pointer to an array.
I am not sure whether this is truly UB, but this diff silences miri:
Unfortunately, after the patch miri fails to terminate.
I am unsure if this is a bug or not. cc @RalfJung
The text was updated successfully, but these errors were encountered: