Skip to content

macOS symbolication failure #72550

Closed
rust-lang/cargo
#8329
@ehuss

Description

@ehuss

I tried this code:

fn main() {
    panic!();
}

starting with cdb50c6 (nightly-2020-03-26, 1.44), when run with:

RUST_BACKTRACE=1 cargo run

results in:

   Compiling foo v0.1.0 (/Users/eric/Proj/rust/cargo/scratch/foo)
    Finished dev [unoptimized + debuginfo] target(s) in 0.34s
     Running `target/debug/foo`
thread 'main' panicked at 'explicit panic', src/main.rs:2:5
stack backtrace:
   0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
   1: core::fmt::write
   2: std::io::Write::write_fmt
   3: std::panicking::default_hook::{{closure}}
   4: std::panicking::default_hook
   5: std::panicking::rust_panic_with_hook
   6: std::panicking::begin_panic
   7: foo::main
   8: std::rt::lang_start::{{closure}}
   9: std::rt::lang_start_internal
  10: std::rt::lang_start
  11: main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

when run with the previous commit, I correctly get the line numbers:

   Compiling foo v0.1.0 (/Users/eric/Proj/rust/cargo/scratch/foo)
    Finished dev [unoptimized + debuginfo] target(s) in 0.61s
     Running `target/debug/foo`
thread 'main' panicked at 'explicit panic', src/main.rs:2:5
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.45/src/backtrace/libunwind.rs:86
   1: backtrace::backtrace::trace_unsynchronized
             at /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.45/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:78
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:59
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1069
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1439
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:62
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:198
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:218
  10: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:511
  11: std::panicking::begin_panic
  12: foo::main
             at src/main.rs:2
  13: std::rt::lang_start::{{closure}}
             at /rustc/02046a5d402c789c006d0da7662f800fe3c45faf/src/libstd/rt.rs:67
  14: std::rt::lang_start_internal::{{closure}}
             at src/libstd/rt.rs:52
  15: std::panicking::try::do_call
             at src/libstd/panicking.rs:331
  16: std::panicking::try
             at src/libstd/panicking.rs:274
  17: std::panic::catch_unwind
             at src/libstd/panic.rs:394
  18: std::rt::lang_start_internal
             at src/libstd/rt.rs:51
  19: std::rt::lang_start
             at /rustc/02046a5d402c789c006d0da7662f800fe3c45faf/src/libstd/rt.rs:67
  20: foo::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

What's interesting, is if you directly run the executable with the metadata hash (like RUST_BACKTRACE=1 target/debug/deps/foo-f5700d28f7af5060), the backtrace looks correct. I tried adjusting the dSYM symlink to include the hash, but that didn't seem to help.

I would assume this is due to #70361. cc @tmiasko @alexcrichton

If the filename mismatch doesn't ring any bells, I can maybe try to dig in and see what changed. Although the changes to backtrace-sys look pretty huge, and I'm unfamiliar with it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsC-bugCategory: This is a bug.O-macosOperating system: macOSP-mediumMedium priorityT-libsRelevant to the library team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions