-
Notifications
You must be signed in to change notification settings - Fork 341
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
Add option to disable alignment check #1332
Conversation
…static-morse Miri: let machine hook dynamically decide about alignment checks This is needed for rust-lang/miri#1332.
Will miri still report actual loads from unaligned addresses? Either way this is great -- it's been frustrating to disable tests for miri because they were too thorough and checked that every possible alignment and size combination didn't result in a misaligned load or OOB read. |
That is the exact check this disables. I am confused by your question.
Except for #1074, I do not know of a case where Miri is too thorough. Alignment errors otherwise are UB and indicate a bug in the program. |
I believe that's the case I mean. Basically I have code that manually aligns a pointer using pointer arithmetic. I test this with a very large number of possible input alignments and lengths to ensure it's sane, but miri assumes that any manually-aligned pointer is still invalid. As a result, I can't run my exhaustive tests under miri (and only some of the other less thorough ones). I had thought this was for disabling miri complaints about that case -- I guess it's about all cases wrt alignment. That doesn't bother me that much, since I generally have have a wrapper around ptr::read which asserts the alignment is correct for stuff like this, but yeah, I must have misunderstood. |
No. That would be resolving #1332. This does not resolve that issue, but it offers a work-around (at the expense of possibly missing bugs). |
330c1c9
to
77c0e7e
Compare
77c0e7e
to
8e73db6
Compare
@bors r+ |
📌 Commit 8e73db6 has been approved by |
Add option to disable alignment check Requires rust-lang/rust#71101 Fixes #1326
@bors retry r+ |
📌 Commit f4a1544 has been approved by |
☀️ Test successful - checks-travis, status-appveyor |
Requires rust-lang/rust#71101
Fixes #1326