Skip to content

backtraces have blank lines and <unknown> instead of function names on FreeBSD #54434

Closed
rust-lang/backtrace-rs
#294

Description

@umanwizard

Note that I am using rustup, not the FreeBSD lang/rust port.

$ cat test.rs
fn main() {
    panic!();
}
$ rustc test.rs && RUST_BACKTRACE=1 ./test                                                                                        
thread 'main' panicked at 'explicit panic', test.rs:2:5
stack backtrace:
   0: <std::thread::local::AccessError as core::fmt::Debug>::fmt
   1: <std::ffi::c_str::NulError as core::fmt::Debug>::fmt
   2: <std::ffi::c_str::NulError as core::fmt::Debug>::fmt
   3: <std::ffi::c_str::NulError as core::fmt::Debug>::fmt
   4: <std::ffi::c_str::NulError as core::fmt::Debug>::fmt
   5: 
   6: 
   7: 
   8: <std::ffi::c_str::NulError as core::fmt::Debug>::fmt
   9: <std::ffi::c_str::NulError as core::fmt::Debug>::fmt
  10: 
  11: 
  12: 
  13: 
  14: <unknown>
$ rustc --version --verbose
rustc 1.29.0 (aa3ca1994 2018-09-11)
binary: rustc
commit-hash: aa3ca1994904f2e056679fce1f185db8c7ed2703
commit-date: 2018-09-11
host: x86_64-unknown-freebsd
release: 1.29.0
LLVM version: 7.0
$ freebsd-version
11.2-RELEASE-p3

Activity

  1. umanwizard commented on Sep 21, 2018

    @umanwizard
    ContributorAuthor

    Output for the same code on macOS -- notice that test::main appears on frame 6, as expected.

    ~ ❯❯❯ RUST_BACKTRACE=1 ./test                                            ✘ 101 
    thread 'main' panicked at 'explicit panic', test.rs:2:5
    stack backtrace:
       0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
       1: std::sys_common::backtrace::print
       2: std::panicking::default_hook::{{closure}}
       3: std::panicking::default_hook
       4: std::panicking::rust_panic_with_hook
       5: std::panicking::begin_panic
       6: test::main
       7: std::rt::lang_start::{{closure}}
       8: std::panicking::try::do_call
       9: __rust_maybe_catch_panic
      10: std::rt::lang_start_internal
      11: std::rt::lang_start
      12: main
    
  2. changed the title [-]backtraces have <unknown> instead of function names on FreeBSD[/-] [+]backtraces have blank lines and <unknown> instead of function names on FreeBSD[/+] on Sep 21, 2018
  3. estebank commented on Sep 21, 2018

    @estebank
    Contributor

    There's a downstream patch for this https://reviews.freebsd.org/D11574 (found through https://svnweb.freebsd.org/ports/head/lang/rust/files/)

    Upstreamed path to gcc: https://gcc.gnu.org/ml/gcc-patches/2018-03/msg00068.html (don't know how to tell if it's been merged)

  4. added
    A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)
    O-freebsdOperating system: FreeBSD
    on Sep 21, 2018
  5. tromey commented on Sep 24, 2018

    @tromey
    Contributor

    Upstreamed path to gcc: https://gcc.gnu.org/ml/gcc-patches/2018-03/msg00068.html (don't know how to tell if it's been merged)

    I looked at gcc git and that patch is not there. It also isn't in https://github.com/ianlancetaylor/libbacktrace (I'm not sure anymore if one repository is canonical or if merges are done both ways).

  6. umanwizard commented on Sep 24, 2018

    @umanwizard
    ContributorAuthor

    By the way, mounting /proc fixes this. But mounting /proc is considered a Linuxism so it would be best if this weren't necessary on FreeBSD.

  7. tromey commented on Sep 26, 2018

    @tromey
    Contributor

    I'd suggest sending the patch as a PR to the aforementioned libbacktrace repository, then once it lands, also update the libbacktrace in rust-lang-nursery.

  8. added a commit that references this issue on Mar 24, 2020
    f823290
  9. added a commit that references this issue on Mar 25, 2020
    761511a
  10. added 2 commits that reference this issue on Mar 25, 2020
    bcef8a3
    3cced91
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)O-freebsdOperating system: FreeBSD

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions