-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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/interpreter debugging tweaks #96160
Conversation
Some changes occured to the CTFE / Miri engine cc @rust-lang/miri Some changes occured to the CTFE / Miri engine cc @rust-lang/miri |
364dc10
to
21f9fde
Compare
21f9fde
to
f3bdcfb
Compare
@@ -509,6 +509,9 @@ impl<Tag: Copy, Extra> Allocation<Tag, Extra> { | |||
if Tag::ERR_ON_PARTIAL_PTR_OVERWRITE { | |||
return Err(AllocError::PartialPointerOverwrite(first)); | |||
} | |||
warn!( | |||
"Partial pointer overwrite! De-initializing memory at offsets {first:?}..{start:?}." | |||
); |
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.
I have RUSTC_LOG=warn
set in my zshrc I believe. This will cause be rather noisy I think.
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.
We kind of emit warn and error unconditionally, or at least used to at some point.
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.
They alsodon't get optimized out, so nightly will have them
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.
At least warn is only emitted when using RUSTC_LOG=warn
.
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.
I have RUSTC_LOG=warn set in my zshrc I believe. This will cause be rather noisy I think.
Note that this is never printed by rustc, since ERR_ON_PARTIAL_PTR_OVERWRITE
is true there.
Only Miri can ever trigger this.
They alsodon't get optimized out, so nightly will have them
This is a very cold path, so that's fine. We have info!
for each statement and terminator we run (also exists on nightly), this is at least as important as that.
When this triggers, it can cause subtly wrong execution later in the program, where memory is uninit that should be init -- so there should be a good way to figure out if this triggered.
We kind of emit warn and error unconditionally, or at least used to at some point.
This is definitely not printed by default, I verified that.
@bors r+ rollup |
📌 Commit f3bdcfb has been approved by |
Miri/interpreter debugging tweaks Some changes I made to make debugging Miri with trace logging less terrible. r? `@oli-obk`
Rollup of 6 pull requests Successful merges: - rust-lang#93313 (Check if call return type is visibly uninhabited when building MIR) - rust-lang#96160 (Miri/interpreter debugging tweaks) - rust-lang#96167 (Replace sys/unix/weak AtomicUsize with AtomicPtr) - rust-lang#96168 (Improve AddrParseError description) - rust-lang#96206 (Use sys::unix::locks::futex* on wasm+atomics.) - rust-lang#96234 (remove_dir_all_recursive: treat ELOOP the same as ENOTDIR) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Some changes I made to make debugging Miri with trace logging less terrible.
r? @oli-obk