Skip to content
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

backtrace printing regression on FreeBSD #73091

Closed
xanderio opened this issue Jun 7, 2020 · 3 comments
Closed

backtrace printing regression on FreeBSD #73091

xanderio opened this issue Jun 7, 2020 · 3 comments
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows C-bug Category: This is a bug. O-freebsd Operating system: FreeBSD T-libs Relevant to the library team, which will review and decide on the PR/issue.

Comments

@xanderio
Copy link

xanderio commented Jun 7, 2020

When a rust program panics and RUST_BACKTRACE is set the process is killed with a SIGBUS. This regression accord between rust stable version 1.43.0 and 1.44.0.

Is there anything else that i can provide?

debugger backtrace of the crash

(lldb) thread backtrace 
error: need to add support for DW_TAG_base_type '()' encoded with DW_ATE = 0x7, bit_size = 0
* thread #1, name = 'clacks', stop reason = signal SIGBUS: hardware error
  * frame #0: 0x00000000017922d0 clacks`elf_open_debugfile_by_debuglink + 736
    frame #1: 0x000000000178f0bf clacks`elf_add + 4831
    frame #2: 0x000000000179020f clacks`phdr_callback + 159
    frame #3: 0x0000000801822c7d ld-elf.so.1`dl_iterate_phdr(callback=(clacks`phdr_callback), param=0x00007fffffffb6a8) at rtld.c:3862:11
    frame #4: 0x000000000178dd55 clacks`__rdos_backtrace_initialize + 181
    frame #5: 0x000000000178d888 clacks`fileline_initialize + 520
    frame #6: 0x000000000178d908 clacks`__rdos_backtrace_syminfo + 40
    frame #7: 0x000000000178d470 clacks`backtrace::symbolize::libbacktrace::resolve::h3a61dabe094b7206 at libbacktrace.rs:469:9
    frame #8: 0x000000000178712f clacks`std::sys_common::backtrace::_print_fmt::_$u7b$$u7b$closure$u7d$$u7d$::h0677b5fd3830b218 [inlined] backtrace::symbolize::resolve_frame_unsynchronized::hef7e032eccfafb7f at mod.rs:178:5
    frame #9: 0x0000000001787119 clacks`std::sys_common::backtrace::_print_fmt::_$u7b$$u7b$closure$u7d$$u7d$::h0677b5fd3830b218 at backtrace.rs:85
    frame #10: 0x000000000178d143 clacks`backtrace::backtrace::libunwind::trace::trace_fn::h1daeb1a8d375438a [inlined] core::ops::function::impls::_$LT$impl$u20$core..ops..function..FnMut$LT$A$GT$$u20$for$u20$$RF$mut$u20$F$GT$::call_mut::hf60d687950595125 at function.rs:274:13
    frame #11: 0x000000000178d135 clacks`backtrace::backtrace::libunwind::trace::trace_fn::h1daeb1a8d375438a at libunwind.rs:98
    frame #12: 0x0000000801ed2385 libgcc_s.so.1`_Unwind_Backtrace(callback=(clacks`backtrace::backtrace::libunwind::trace::trace_fn::h1daeb1a8d375438a at libunwind.rs:88), ref=0x00007fffffffbbf8) at UnwindLevel1-gcc-ext.c:176:14
    frame #13: 0x0000000001786a5e clacks`_$LT$std..sys_common..backtrace.._print..DisplayBacktrace$u20$as$u20$core..fmt..Display$GT$::fmt::h0106ee1a603cd0b6 [inlined] backtrace::backtrace::libunwind::trace::he1e5a89a15469bef at libunwind.rs:86:5
    frame #14: 0x0000000001786a4a clacks`_$LT$std..sys_common..backtrace.._print..DisplayBacktrace$u20$as$u20$core..fmt..Display$GT$::fmt::h0106ee1a603cd0b6 [inlined] backtrace::backtrace::trace_unsynchronized::h05dfb6367fe3fba1 at mod.rs:66
    frame #15: 0x0000000001786a4a clacks`_$LT$std..sys_common..backtrace.._print..DisplayBacktrace$u20$as$u20$core..fmt..Display$GT$::fmt::h0106ee1a603cd0b6 [inlined] std::sys_common::backtrace::_print_fmt::hea538625ddec6cab at backtrace.rs:78
    frame #16: 0x0000000001786950 clacks`_$LT$std..sys_common..backtrace.._print..DisplayBacktrace$u20$as$u20$core..fmt..Display$GT$::fmt::h0106ee1a603cd0b6 at backtrace.rs:59
    frame #17: 0x00000000017aad6e clacks`core::fmt::write::h0f679dccd2cd93ed at mod.rs:1069:17
    frame #18: 0x0000000001784aa0 clacks`std::io::Write::write_fmt::h8e3cd870123d8365 at mod.rs:1504:15
    frame #19: 0x0000000001788bcd clacks`std::panicking::default_hook::_$u7b$$u7b$closure$u7d$$u7d$::h44b6384f03479f7d [inlined] std::sys_common::backtrace::_print::h4b166ab90c3c0d05 at backtrace.rs:62:5
    frame #20: 0x0000000001788b7c clacks`std::panicking::default_hook::_$u7b$$u7b$closure$u7d$$u7d$::h44b6384f03479f7d [inlined] std::sys_common::backtrace::print::h3c809c44af998731 at backtrace.rs:49
    frame #21: 0x0000000001788b6f clacks`std::panicking::default_hook::_$u7b$$u7b$closure$u7d$$u7d$::h44b6384f03479f7d at panicking.rs:198
    frame #22: 0x0000000001788899 clacks`std::panicking::default_hook::h40bc46c2d48b32f1 at panicking.rs:218:9
    frame #23: 0x0000000001789223 clacks`std::panicking::rust_panic_with_hook::h2373a0c0dc922484 at panicking.rs:511:17
    frame #24: 0x0000000001788e1c clacks`rust_begin_unwind at panicking.rs:419:5
    frame #25: 0x00000000017a94d0 clacks`core::panicking::panic_fmt::hc6bd8eedc6415ac1 at panicking.rs:111:14
    frame #26: 0x00000000017a9428 clacks`core::panicking::panic::h0897295336700263 at panicking.rs:54:5
    frame #27: 0x000000000135d0b8 clacks`core::option::Option$LT$T$GT$::unwrap::h9d2227361a73b518(self=Option<clacks::surface::Surface> @ 0x00007fffffffc820) at mod.rs:34:9
    frame #28: 0x00000000012ece70 clacks`clacks::main::_$u7b$$u7b$closure$u7d$$u7d$::hff644ca7ed799dc5((null)=0x0000000802e338e8, id=1, (null)=0x00007fffffffcef0, data=0x00007fffffffde50) at main.rs:30:13
    frame #29: 0x00000000012eb0de clacks`_$LT$core..cell..RefCell$LT$calloop..sources..Dispatcher$LT$Data$C$S$C$F$GT$$GT$$u20$as$u20$calloop..sources..EventDispatcher$LT$Data$GT$$GT$::process_events::_$u7b$$u7b$closure$u7d$$u7d$::h681570a23534e463(event=1, meta=0x00007fffffffcef0) at mod.rs:123:63
    frame #30: 0x0000000001357bda clacks`_$LT$calloop..sources..timer..Timer$LT$T$GT$$u20$as$u20$calloop..sources..EventSource$GT$::process_events::_$u7b$$u7b$closure$u7d$$u7d$::hf669e66fa4b13270((null)=<unavailable>, (null)=0x00007fffffffcda0) at timer.rs:133:21
    frame #31: 0x000000000130d500 clacks`_$LT$calloop..sources..ping..PingSource$u20$as$u20$calloop..sources..EventSource$GT$::process_events::_$u7b$$u7b$closure$u7d$$u7d$::h7307de8c6ce23969((null)=(readable = true, writable = false, error = false), (null)=0x0000000802e338f0) at ping.rs:82:21
    frame #32: 0x000000000132c630 clacks`_$LT$calloop..sources..generic..Generic$LT$F$GT$$u20$as$u20$calloop..sources..EventSource$GT$::process_events::h944c23cb209ef4ae(self=0x0000000802e338f0, readiness=(readable = true, writable = false, error = false), (null)=(id = 3, sub_id = 0), callback=closure-0 @ 0x00007fffffffcdf0) at generic.rs:72:9
    frame #33: 0x000000000130d329 clacks`_$LT$calloop..sources..ping..PingSource$u20$as$u20$calloop..sources..EventSource$GT$::process_events::haaebdc129a410678(self=0x0000000802e338f0, readiness=(readable = true, writable = false, error = false), token=(id = 3, sub_id = 0), callback=<unavailable>) at ping.rs:61:9
    frame #34: 0x0000000001357a7f clacks`_$LT$calloop..sources..timer..Timer$LT$T$GT$$u20$as$u20$calloop..sources..EventSource$GT$::process_events::hf09f7bc170b0563d(self=0x0000000802e338e8, readiness=(readable = true, writable = false, error = false), token=(id = 3, sub_id = 0), callback=closure-0 @ 0x00007fffffffcee0) at timer.rs:124:9
    frame #35: 0x00000000013357fa clacks`_$LT$core..cell..RefCell$LT$calloop..sources..Dispatcher$LT$Data$C$S$C$F$GT$$GT$$u20$as$u20$calloop..sources..EventDispatcher$LT$Data$GT$$GT$::process_events::h403953587e6701d2(self=0x0000000802e338e0, readiness=(readable = true, writable = false, error = false), token=(id = 3, sub_id = 0), data=0x00007fffffffde50) at mod.rs:123:9
    frame #36: 0x0000000001354068 clacks`calloop::loop_logic::EventLoop$LT$Data$GT$::dispatch_events::h613992ee94e72d1c(self=0x00007fffffffdcb0, timeout=Option<core::time::Duration> @ 0x00007fffffffd5b0, data=0x00007fffffffde50) at loop_logic.rs:268:17
    frame #37: 0x0000000001354ea0 clacks`calloop::loop_logic::EventLoop$LT$Data$GT$::dispatch::h3028638452db4e2d(self=0x00007fffffffdcb0, timeout=<unavailable>, data=0x00007fffffffde50) at loop_logic.rs:312:9
    frame #38: 0x000000000130c8f7 clacks`clacks::main::h267e80c9cfe3770b at main.rs:37:9
    frame #39: 0x000000000135323e clacks`std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::hf558f6e5c37d6284 at rt.rs:67:34
    frame #40: 0x0000000001789662 clacks`std::rt::lang_start_internal::h718e9650bea5ab3e [inlined] std::rt::lang_start_internal::_$u7b$$u7b$closure$u7d$$u7d$::haf0a2cd12284040c at rt.rs:52:13
    frame #41: 0x0000000001789657 clacks`std::rt::lang_start_internal::h718e9650bea5ab3e [inlined] std::panicking::try::do_call::hbf7addf0f21316e7 at panicking.rs:331
    frame #42: 0x0000000001789657 clacks`std::rt::lang_start_internal::h718e9650bea5ab3e [inlined] std::panicking::try::h0c7bca60f996c7b7 at panicking.rs:274
    frame #43: 0x0000000001789657 clacks`std::rt::lang_start_internal::h718e9650bea5ab3e [inlined] std::panic::catch_unwind::h2eb406bb8ef4b25e at panic.rs:394
    frame #44: 0x0000000001789657 clacks`std::rt::lang_start_internal::h718e9650bea5ab3e at rt.rs:51
    frame #45: 0x0000000001353222 clacks`std::rt::lang_start::h76e9fa17a5ad4e33(main=(clacks`clacks::main::h267e80c9cfe3770b at main.rs:10), argc=1, argv=0x00007fffffffe4b0) at rt.rs:67:5
    frame #46: 0x000000000130ca1b clacks`main + 43
    frame #47: 0x00000000012ea7f2 clacks`_start(ap=<unavailable>, cleanup=<unavailable>) at crt1.c:76:7
@jonas-schievink jonas-schievink added A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows C-bug Category: This is a bug. T-libs Relevant to the library team, which will review and decide on the PR/issue. O-freebsd Operating system: FreeBSD labels Jun 7, 2020
@cemeyer
Copy link

cemeyer commented Jan 1, 2021

I'm getting traces collected with nightly 1.49.0.20201121 on FreeBSD, but rust cannot resolve the addresses to symbols despite opt-level 0 and debug 2.

Edit: #78184 looks like my issue.

@asomers
Copy link
Contributor

asomers commented Sep 4, 2021

I can reproduce this problem with Rustc 1.46.0, but not 1.47.0. I guess it's already fixed.

@xanderio
Copy link
Author

xanderio commented Sep 4, 2021

Just tested it. It works again

@xanderio xanderio closed this as completed Sep 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows C-bug Category: This is a bug. O-freebsd Operating system: FreeBSD T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants