-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
miri: add miri_spin_loop to make hint::spin_loop work consistently
#150088
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
base: main
Are you sure you want to change the base?
Conversation
|
The Miri subtree was changed cc @rust-lang/miri |
This comment has been minimized.
This comment has been minimized.
4fbc49f to
7f022df
Compare
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.
Thanks! Just some minor suggestions.
| this.write_int(if success { 0 } else { needed_size }, dest)?; | ||
| } | ||
| // Hint that a loop is spinning indefinitely. | ||
| "miri_spin_loop" => { |
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.
Please also add this function in tests/utils/miri_extern.rs inside Miri, with a suitable doc comment.
| } | ||
| // Hint that a loop is spinning indefinitely. | ||
| "miri_spin_loop" => { | ||
| // To maximize the chance of finding actual bugs, try to find another thread to |
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.
| // To maximize the chance of finding actual bugs, try to find another thread to | |
| let [] = this.check_shim_sig_lenient(abi, CanonAbi::Rust, link_name, args)?; | |
| // To maximize the chance of finding actual bugs, try to find another thread to |
| // consistent behavior across targets, this custom function is used. To maximize the | ||
| // likelihood of finding actual issues, it will attempt to find another thread to run. |
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.
| // consistent behavior across targets, this custom function is used. To maximize the | |
| // likelihood of finding actual issues, it will attempt to find another thread to run. | |
| // consistent behavior across targets, this custom function is used. |
What that function does is Miri's choice and maybe we'll change it in the future.
|
Reminder, once the PR becomes ready for a review, use |
fixes #150050
Always use the same implementation when running miri (regardless of target, for consistency). This implementation yields the current thread to try find actual bugs.
r? RalfJung