Skip to content

Backtraces are often broken on aarch64 binaries #121817

Closed as duplicate
Closed as duplicate

Description

@wesleywiser

This seems to happen the most for -Cpanic=abort programs.

fn main() {
    foo();
}

fn foo() {
    panic!("hello world");
}
$ rustc -Cpanic=abort -Copt-level=3 -Cdebuginfo=2 --target aarch64-unknown-linux-gnu -C linker=aarch64-linux-gnu-gcc test.rs
$ qemu-aarch64 -E RUST_BACKTRACE=full -L /usr/aarch64-linux-gnu/ target/aarch64-unknown-linux-gnu/release/panic_test_abort
thread 'main' panicked at src/main.rs:8:5:
hello world
stack backtrace:
   0:       0x5500033b68 - std::backtrace_rs::backtrace::libunwind::trace::hee9690ac22774636
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:       0x5500033b68 - std::backtrace_rs::backtrace::trace_unsynchronized::ha30111b5438e6e61
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:       0x5500033b68 - std::sys_common::backtrace::_print_fmt::hc2516686a74b2a42
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:68:5
   3:       0x5500033b68 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h8984c88846573cbb
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:44:22
   4:       0x550004ecc0 - core::fmt::rt::Argument::fmt::h071bdaa21123c9ed
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/fmt/rt.rs:142:9
   5:       0x550004ecc0 - core::fmt::write::h3f4921a7ddfa57a8
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/fmt/mod.rs:1120:17
   6:       0x5500031cb0 - std::io::Write::write_fmt::h0923e211983fe028
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/io/mod.rs:1810:15
   7:       0x5500033994 - std::sys_common::backtrace::_print::h39d471a7e51d9dbd
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:47:5
   8:       0x5500033994 - std::sys_common::backtrace::print::h6306cb106d0c42e1
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:34:9
   9:       0x5500034ed0 - std::panicking::default_hook::{{closure}}::h2a94c4f92161a016
  10:       0x5500034c04 - std::panicking::default_hook::hd3c29c68b55e9f50
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:292:9
  11:       0x5500035364 - std::panicking::rust_panic_with_hook::ha00bbb72a4f1b899
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:779:13
  12:       0x55000351ec - std::panicking::begin_panic_handler::{{closure}}::had2c64361be4b07b
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:649:13
  13:       0x5500034038 - std::sys_common::backtrace::__rust_end_short_backtrace::hf92a1e94dde0ed69
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:171:18
  14:       0x5500034fb8 - rust_begin_unwind
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:645:5
  15:       0x5500009434 - core::panicking::panic_fmt::h815b849997a1324d
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:72:14
  16:       0x550000ad14 - panic_test_abort::foo::h9689b6dfc03df639
                               at /home/wesley/panic_test_abort/src/main.rs:8:5
  17:       0x550000ad14 - panic_test_abort::foo::h9689b6dfc03df639
                               at /home/wesley/panic_test_abort/src/main.rs:8:5
  18:       0x550000ad14 - panic_test_abort::foo::h9689b6dfc03df639
                               at /home/wesley/panic_test_abort/src/main.rs:8:5
...
(continues forever)

Tested on

  • rustc 1.76.0 (07dca489a 2024-02-04)

Activity

  1. added
    A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)
    C-bugCategory: This is a bug.
    WG-debuggingWorking group: Bad Rust debugging experiences
    on Feb 29, 2024
  2. self-assigned this
    on Feb 29, 2024
  3. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Feb 29, 2024
  4. wesleywiser commented on Feb 29, 2024

    @wesleywiser
    MemberAuthor

    I've got a fix but need to investigate adding regression tests a bit more.

  5. added and removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Feb 29, 2024
  6. added
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Dec 23, 2024
  7. Enselic commented on Jul 25, 2025

    @Enselic
    Member

    Triage: duplicate of #123733. See #123733 (comment) for what regression tests has been added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)C-bugCategory: This is a bug.P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.WG-debuggingWorking group: Bad Rust debugging experiences

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions