-
Notifications
You must be signed in to change notification settings - Fork 343
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
Directly implement native exception raise methods in miri #3319
Conversation
I was confused by the context here, since it's unclear what issue you are fixing, and what "old custom ABI" is. After reading the PR code and mulling over this for a bit, I think "old custom ABI" is the |
My bad. I was indeed referring to |
tests/pass/panic/unwind_dwarf.rs
Outdated
// M O Z \0 R U S T -- vendor, language | ||
0x4d4f5a_00_52555354 |
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.
Maybe set this to something else since we're testing the unwinder mechanism in general, not specifically Rust panics?
For miri_start_panic we have some interesting tests: miri_bad_start_panic, unwind_panic_abort. We probably want to have similar tests for this as well. Other than that, LGTM. |
@rustbot author |
@bjorn3 what is the status of this? This seems basically done, just needs more tests. |
☔ The latest upstream changes (presumably #3557) made this pull request unmergeable. Please resolve the merge conflicts. |
Windows still needs the old custom ABI as SEH unwinding isn't supported by miri. Unlike DWARF unwinding it preserves all stack frames until right after the do_catch function has executed. Because of this panic_unwind stack allocates the exception object. Miri can't currently model unwinding without destroying stack frames and as such will report a use-after-free of the exception object.
- share implementation with miri_starting_unwind - make test use a custom unwinding class - extend comments - use NeedsUnwind more consistently
I did a bit of refactoring to finish the PR. Thanks for the initial idea! |
☀️ Test successful - checks-actions |
Use the native unwind function in miri where possible Continuation of rust-lang/miri#3319 cc `@RalfJung`
Rollup merge of rust-lang#127214 - bjorn3:miri_native_unwind, r=oli-obk Use the native unwind function in miri where possible Continuation of rust-lang/miri#3319 cc `@RalfJung`
Use the native unwind function in miri where possible Continuation of #3319 cc `@RalfJung`
This implements the
_Unwind_RaiseException
function used on pretty much every unix system for starting unwinding. This allows removing the miri special case from libpanic_unwind for unix.Windows still needs
miri_start_unwind
as SEH unwinding isn't supported by miri. Unlike DWARF unwinding, SEH preserves all stack frames until right after the do_catch function has executed. Because of this panic_unwind stack allocates the exception object. Miri can't currently model unwinding without destroying stack frames and as such will report a use-after-free of the exception object.