-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
std: Avoid panics in rust_eh_personality #42487
Conversation
r? @aturon (rust_highfive has picked a reviewer for you, use r? to override) |
r? @vadimcn |
Looks good! @bors: r+ |
📌 Commit 28682bc has been approved by |
⌛ Testing commit 28682bc with merge 4946653... |
💔 Test failed - status-appveyor |
x86_64-pc-windows-gnu build failure. error[E0308]: mismatched types
--> src\libpanic_unwind\seh64_gnu.rs:131:9
|
131 | EHAction::None => None,
| ^^^^^^^^^^^^^^ expected enum `core::result::Result`, found enum `dwarf::eh::EHAction`
|
= note: expected type `core::result::Result<dwarf::eh::EHAction, ()>`
found type `dwarf::eh::EHAction` |
This commit removes a few calls to panic and/or assert in `rust_eh_personality`. This function definitely can't itself panic (that'd probably segfault or do something else weird) and I was also noticing that a `pub extern fn foo() {}` cdylib was abnormally large. Turns out all that size was the panicking machinery brought in by the personality function! The change here is to return a `Result` internally so we can bubble up the fatal error, eventually translating to the appropriate error code for the libunwind ABI.
28682bc
to
52805d2
Compare
@bors: r=vadimcn |
📌 Commit 52805d2 has been approved by |
…=vadimcn std: Avoid panics in rust_eh_personality This commit removes a few calls to panic and/or assert in `rust_eh_personality`. This function definitely can't itself panic (that'd probably segfault or do something else weird) and I was also noticing that a `pub extern fn foo() {}` cdylib was abnormally large. Turns out all that size was the panicking machinery brought in by the personality function! The change here is to return a `Result` internally so we can bubble up the fatal error, eventually translating to the appropriate error code for the libunwind ABI.
std: Avoid panics in rust_eh_personality This commit removes a few calls to panic and/or assert in `rust_eh_personality`. This function definitely can't itself panic (that'd probably segfault or do something else weird) and I was also noticing that a `pub extern fn foo() {}` cdylib was abnormally large. Turns out all that size was the panicking machinery brought in by the personality function! The change here is to return a `Result` internally so we can bubble up the fatal error, eventually translating to the appropriate error code for the libunwind ABI.
☀️ Test successful - status-appveyor, status-travis |
This commit removes a few calls to panic and/or assert in
rust_eh_personality
.This function definitely can't itself panic (that'd probably segfault or do
something else weird) and I was also noticing that a
pub extern fn foo() {}
cdylib was abnormally large. Turns out all that size was the panicking machinery
brought in by the personality function!
The change here is to return a
Result
internally so we can bubble up the fatalerror, eventually translating to the appropriate error code for the libunwind
ABI.