-
Notifications
You must be signed in to change notification settings - Fork 408
Move panic payload state from Machine to Thread #1532
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
Conversation
|
Thanks, this is a great catch! I am wondering now, presumably |
|
Good call about |
| if let Some(errno_place) = this.active_thread_ref().last_error { | ||
| Ok(errno_place) | ||
| } else { | ||
| let errno_layout = this.machine.layouts.u32; |
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.
| let errno_layout = this.machine.layouts.u32; | |
| // Allocate new place, set initial value to 0. | |
| let errno_layout = this.machine.layouts.u32; |
|
This looks great, thanks. :) Please fix the last comment nit and squash the "Commit missing new file" commit, then we can land this. |
5080bb5 to
a6746ad
Compare
|
@bors r+ |
|
📌 Commit a6746ad has been approved by |
|
☀️ Test successful - checks-travis, status-appveyor |
This PR moves the panic payload storage from the
Machinestate to per-thread state. Prior to this change, if one thread panicked while another was still unwinding, Miri would fail withthread 'rustc' panicked at 'the panic runtime should avoid double-panics', src/shims/panic.rs:51:9. I ran into this issue while prototyping a round-robin scheduler, but it's also reachable with the current scheduler and contrived programs that use blocking API calls to cause thread switching during unwinding. I wrote a test case along those lines for this change.