We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I set up a sample panic somewhere in my code base, ran with cargo run --release, and caught it with the following custom panic handler:
cargo run --release
pub fn show_backtrace_on_panic() { std::panic::set_hook(Box::new(|panic_info| { let backtrace = std::backtrace::Backtrace::force_capture(); eprintln!("{panic_info}"); eprintln!("\nBacktrace:\n{backtrace}"); })); }
Which showed me this backtrace:
Backtrace: 0: cryfs_cli_utils::panic_handler::show_backtrace_on_panic::{{closure}} 1: std::panicking::rust_panic_with_hook 2: std::panicking::begin_panic_handler::{{closure}} 3: std::sys_common::backtrace::__rust_end_short_backtrace 4: rust_begin_unwind 5: core::panicking::panic_fmt 6: cryfs_cryfs::config::encryption::decrypt 7: cryfs_cryfs::config::loader::load_or_create 8: <cryfs_cli::cli::Cli as cryfs_cli_utils::application::Application>::main 9: cryfs_cli_utils::application::run 10: std::sys_common::backtrace::__rust_begin_short_backtrace 11: main 12: __libc_start_call_main at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16 13: __libc_start_main_impl at ./csu/../csu/libc-start.c:360:3 14: _start
Frames 0..=5 are useless here, but starting from frame 6, the frames are relevant.
0..=5
However, using human-panic, I got this backtrace, which skips frame 6:
human-panic
"backtrace" = """ 0: 0x57a214f25d51 - cryfs_cryfs::config::loader::load_or_create::h0164e15f3c7e3b2f 1: 0x57a214eba0f8 - <cryfs_cli::cli::Cli as cryfs_cli_utils::application::Application>::main::h857c34904cb9b5d6 2: 0x57a214d42d65 - cryfs_cli_utils::application::run::h524b32ee2ef4b9b3 3: 0x57a214d399c3 - std::sys_common::backtrace::__rust_begin_short_backtrace::ha12c550ae26c7977 4: 0x57a214d3a260 - main 5: 0x79c6fac2a1ca - __libc_start_call_main at ./csu/../sysdeps/nptl/libc_start_call_main.h:58 6: 0x79c6fac2a28b - __libc_start_main_impl at ./csu/../csu/libc-start.c:360 7: 0x57a214c81455 - _start 8: 0x0 - <unresolved>"""
Seems like it's skipping one frame too many.
The text was updated successfully, but these errors were encountered:
#158 made improvements to what gets skipped and has been released in v2.0.2. Could you test it out?
Sorry, something went wrong.
Thanks, confirmed this fixes it
Fix rust-cli/human-panic#155
aacb540
No branches or pull requests
I set up a sample panic somewhere in my code base, ran with
cargo run --release
, and caught it with the following custom panic handler:Which showed me this backtrace:
Frames
0..=5
are useless here, but starting from frame 6, the frames are relevant.However, using
human-panic
, I got this backtrace, which skips frame 6:Seems like it's skipping one frame too many.
The text was updated successfully, but these errors were encountered: