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

Is a stacked borrows error in iced-x86 a problem? #3082

Closed
LunNova opened this issue Sep 24, 2023 · 2 comments
Closed

Is a stacked borrows error in iced-x86 a problem? #3082

LunNova opened this issue Sep 24, 2023 · 2 comments

Comments

@LunNova
Copy link

LunNova commented Sep 24, 2023

Is the stacked borrows error: Undefined Behavior: trying to retag from <2907067> for SharedReadOnly permission at alloc355283[0x1], but that tag does not exist in the borrow stack for this location error described in more detail at icedland/iced#455 due to a bug in iced-x86?

@saethlin
Copy link
Member

It's nice to hear about people using Miri on iced, I've used that crate as a stress test.

I think you are asking about rust-lang/unsafe-code-guidelines#134 or rust-lang/unsafe-code-guidelines#256 (those issues are about the same situation but have slightly different discussion).

The fact that Stacked Borrows does not accommodate the &Header pattern is generally accepted as a problem with the model. There is an alternative model available in Miri via MIRIFLAGS=-Zmiri-tree-borrows which permits the &Header pattern but it is still somewhat under-construction, #3067 for example.

I would have more confidence in my code being well-behaved if it is accepted by Stacked Borrows. But if you can get Miri to execute more of your code by turning on Tree Borrows instead, that's a good practical option.

@LunNova
Copy link
Author

LunNova commented Sep 26, 2023

Closing as your answer explains why it failed and it looks like there's existing in progress work. Thanks for the help!

@LunNova LunNova closed this as not planned Won't fix, can't repro, duplicate, stale Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants