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

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

Open
umanwizard opened this Issue Sep 21, 2018 · 5 comments

Comments

Projects
None yet
3 participants
@umanwizard
Copy link

umanwizard commented Sep 21, 2018

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
@umanwizard

This comment has been minimized.

Copy link

umanwizard commented Sep 21, 2018

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

@umanwizard umanwizard changed the title backtraces have <unknown> instead of function names on FreeBSD backtraces have blank lines and <unknown> instead of function names on FreeBSD Sep 21, 2018

@estebank

This comment has been minimized.

Copy link
Contributor

estebank commented Sep 21, 2018

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)

@tromey

This comment has been minimized.

Copy link
Contributor

tromey commented Sep 24, 2018

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).

@umanwizard

This comment has been minimized.

Copy link

umanwizard commented Sep 24, 2018

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.

@tromey

This comment has been minimized.

Copy link
Contributor

tromey commented Sep 26, 2018

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.

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