-
Notifications
You must be signed in to change notification settings - Fork 68
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
Fix miri validation errors through now stricter provenance #103
Conversation
The general causes for the miri invalidation is the prevelant use of `Box` and its references to `ErrorImpl<()>`. `mem::transmute` does not preserve the tag stack for transmuting the boxes. Additionally, having references to `ErrorImpl<()>` which has a different layout than the allocation or `ErrorImpl<E>` for some unknown `E`. This causes the new "untyped" reference to now have a provenance that includes the size of E and thus is outside the provenance.
Fixes #59 |
Remaining:
|
921ba04
to
a3ee4a9
Compare
Miri now passes The only thing which does not pass is that some of our dependencies (mainly once_cell) does not fullfill our MSRV requirement. We need to either bump our MSRV or lock once_cell, though I'dprefer that call and discussion to go in a separate PR to limit scope. @yaahc let me know when you have some time to look through this. Don't worry about being too pedantic; I am here to learn 😊 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks great. I didn't spend too much time trying to audit the correctness of the unsafe; I'm going to trust MIRI and you on that one.
As for the question about once_cell and MSRV, I have no objections to resolving that separately, though I prefer resolving that first, landing that, and then rebasing that into this PR before merging. However, I am open to other plans if you have a different one in mind.
Should we merge this and tackle the failing test that looks like something entirely different in another PR, or should we solve it here? I suppose this goes in general, do you prefer larger PRs which implement things in full, or smaller atomic PRs; as one would do on trunk based development? |
I don't have a strong preference. I don't love having CI be broken on main but it's been a while since we were in that state. I guess I'd probably lean towards atomic PRs. How about you, which do you prefer? |
I'd say I am slightly towards somewhat bigger PRs where a feature is working for the most part before being merged in, rather than merging bit by bit and feature flagging it until it is done. This way, you get a single place to refer to and have the diff gathered and duplicated (if you end up changing the same lines again in another PR) I don't prefer broken CIs either, and I will see what I can do with the remaining checks 😊 |
The new names, such as `Test Platform Matrix` which do make it easier to see which jobs failed, rather than msrv, test, and miri all being called `Test Suite`, the in-place branch protection rules wait forever until the now non-existent `Test Suite` passes
8a44070
to
b5dd86a
Compare
@yaahc CI seems to work now. Is it alright by you to merge this now? |
Miri has become even stricter with regards to pointer borrowing and stacked borrows, especially with the now default full-field-retagging