-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Please default "force-unwind-tables" to "yes" on Linux, so that unwind tables are present even if panic = "abort" #94815
Comments
@jrmuizel suggested I answer the following questions, to allow for a more informed decision:
|
This is needed since Sui has panic = 'abort'. It should be another piece that helps us to get more complete stack trace in profiles. More background at rust-lang/rust#94815
This is needed since Sui has panic = 'abort'. It should be another piece that helps us to get more complete stack trace in profiles. More background at rust-lang/rust#94815
This is needed since Sui has panic = 'abort'. It should be another piece that helps us to get more complete stack trace in profiles. More background at rust-lang/rust#94815
Repeating my comment from the linked issue right above this post because it shows some more motivation for this. stable-x86_64-unknown-linux-gnu Consider the following rust program: fn main() {
foo();
}
fn foo() {
bar();
}
fn bar() {
assert_eq!(false, true);
} This program panics. The call stack at the panic is I am going to run this program while varying the
With
With
Now I am going to change the assert!(false == true, "expected {} == {} but they weren't", false, true); With
With
The part of the backtrace that is meaningful is the |
On Linux, binaries need to contain unwind tables if one wants to get useful and accurate stack traces in profilers, debuggers and crash reports,. This requirement is mostly due to the fact that the Rust compiler, by default, does not use frame pointers on Linux.
When
panic
is set to"unwind"
(the default), the Rust compiler emits unwind tables for all functions. This is good.However, when building with
panic = "abort"
, the Rust compiler currently does not emit unwind tables for many functions. For example, a Linux x86_64 build of dump_syms withpanic = "abort"
has unwind tables for 5017 functions with the default settings, and for 9204 functions with-C force-unwind-tables=yes
. The generated code for both builds is identical.I think
force-unwind-tables=yes
would be a better default. It does not make the generated code any less efficient; it only generates extra information on the side. People who are concerned about binary size and who do not need useful stack traces can still make the trade-off and set-C force-unwind-tables=no
.This problem was also encountered in rust-lang/backtrace-rs#397 and in #81902.
The text was updated successfully, but these errors were encountered: