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

ICE: SIGILL in std::panicking::rust_panic_with_hook #72174

Closed
KenDJohnson opened this issue May 13, 2020 · 2 comments
Closed

ICE: SIGILL in std::panicking::rust_panic_with_hook #72174

KenDJohnson opened this issue May 13, 2020 · 2 comments

Comments

@KenDJohnson
Copy link

Illegal instruction executed in rust_panic_with_hook when std::fmt::Display panics. When attempting to print the backtrace it will output thread panicked while processing panic. aborting. then exits with a SIGILL.

I am working on getting together an example for this behavior. The code that caused it is quite large, and is currently proprietary. It looks like there are multiple panics happening here while trying to write the backtrace, although I can't see where the additional panics come from.

Running with cargo test 'test::format' and target/debug/deps/... 'test::format' both result in the bad instruction being executed, although if the code for this test is moved to fn main() and run as an executable, the panic unwinding and backtrace is handled properly.

LLDB backtrace:

* thread #2, name = 'parser::symbols::test::format', stop reason = EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
  * frame #0: 0x000000010074677a mycrate-eccaf1cfd7198a44`std::panicking::rust_panic_with_hook::h7967810bc33e523b at panicking.rs:0 [opt]
    frame #1: 0x00000001007463f2 mycrate-eccaf1cfd7198a44`rust_begin_unwind at panicking.rs:378:4 [opt]
    frame #2: 0x000000010077bc0f mycrate-eccaf1cfd7198a44`core::panicking::panic_fmt::h9eea9e4965bd189c at panicking.rs:85:13 [opt]
    frame #3: 0x000000010077bb15 mycrate-eccaf1cfd7198a44`core::option::expect_none_failed::ha68a01397bf24c9a at option.rs:1211:4 [opt]
    frame #4: 0x000000010073eb4b mycrate-eccaf1cfd7198a44`std::io::stdio::set_panic::ha15329fd0546b483 [inlined] core::result::Result$LT$T$C$E$GT$::expect::h6b9aa52bc2e11971 at result.rs:961:22 [opt]
    frame #5: 0x000000010073eb28 mycrate-eccaf1cfd7198a44`std::io::stdio::set_panic::ha15329fd0546b483 [inlined] core::cell::RefCell$LT$T$GT$::borrow_mut::hb3847791988a115b at cell.rs:878 [opt]
    frame #6: 0x000000010073eb28 mycrate-eccaf1cfd7198a44`std::io::stdio::set_panic::ha15329fd0546b483 [inlined] std::io::stdio::set_panic::_$u7b$$u7b$closure$u7d$$u7d$::hf4c57cc93c7a38f1 at stdio.rs:746 [opt]
    frame #7: 0x000000010073eb28 mycrate-eccaf1cfd7198a44`std::io::stdio::set_panic::ha15329fd0546b483 [inlined] std::thread::local::LocalKey$LT$T$GT$::try_with::h4cad29f71ce36c33 at local.rs:262 [opt]
    frame #8: 0x000000010073eb28 mycrate-eccaf1cfd7198a44`std::io::stdio::set_panic::ha15329fd0546b483 [inlined] std::thread::local::LocalKey$LT$T$GT$::with::h2ab8af4d3b50b8ba at local.rs:239 [opt]
    frame #9: 0x000000010073eb28 mycrate-eccaf1cfd7198a44`std::io::stdio::set_panic::ha15329fd0546b483 at stdio.rs:746 [opt]
    frame #10: 0x0000000100745e6c mycrate-eccaf1cfd7198a44`std::panicking::default_hook::hf135bc502e6f77db at panicking.rs:218:29 [opt]
    frame #11: 0x0000000100746828 mycrate-eccaf1cfd7198a44`std::panicking::rust_panic_with_hook::h7967810bc33e523b at panicking.rs:470:16 [opt]
    frame #12: 0x00000001007463f2 mycrate-eccaf1cfd7198a44`rust_begin_unwind at panicking.rs:378:4 [opt]
    frame #13: 0x000000010077bc0f mycrate-eccaf1cfd7198a44`core::panicking::panic_fmt::h9eea9e4965bd189c at panicking.rs:85:13 [opt]
    frame #14: 0x000000010077bb15 mycrate-eccaf1cfd7198a44`core::option::expect_none_failed::ha68a01397bf24c9a at option.rs:1211:4 [opt]
    frame #15: 0x000000010073eb4b mycrate-eccaf1cfd7198a44`std::io::stdio::set_panic::ha15329fd0546b483 [inlined] core::result::Result$LT$T$C$E$GT$::expect::h6b9aa52bc2e11971 at result.rs:961:22 [opt]
    frame #16: 0x000000010073eb28 mycrate-eccaf1cfd7198a44`std::io::stdio::set_panic::ha15329fd0546b483 [inlined] core::cell::RefCell$LT$T$GT$::borrow_mut::hb3847791988a115b at cell.rs:878 [opt]
    frame #17: 0x000000010073eb28 mycrate-eccaf1cfd7198a44`std::io::stdio::set_panic::ha15329fd0546b483 [inlined] std::io::stdio::set_panic::_$u7b$$u7b$closure$u7d$$u7d$::hf4c57cc93c7a38f1 at stdio.rs:746 [opt]
    frame #18: 0x000000010073eb28 mycrate-eccaf1cfd7198a44`std::io::stdio::set_panic::ha15329fd0546b483 [inlined] std::thread::local::LocalKey$LT$T$GT$::try_with::h4cad29f71ce36c33 at local.rs:262 [opt]
    frame #19: 0x000000010073eb28 mycrate-eccaf1cfd7198a44`std::io::stdio::set_panic::ha15329fd0546b483 [inlined] std::thread::local::LocalKey$LT$T$GT$::with::h2ab8af4d3b50b8ba at local.rs:239 [opt]
    frame #20: 0x000000010073eb28 mycrate-eccaf1cfd7198a44`std::io::stdio::set_panic::ha15329fd0546b483 at stdio.rs:746 [opt]
    frame #21: 0x0000000100745e6c mycrate-eccaf1cfd7198a44`std::panicking::default_hook::hf135bc502e6f77db at panicking.rs:218:29 [opt]
    frame #22: 0x0000000100746828 mycrate-eccaf1cfd7198a44`std::panicking::rust_panic_with_hook::h7967810bc33e523b at panicking.rs:470:16 [opt]
    frame #23: 0x00000001007463f2 mycrate-eccaf1cfd7198a44`rust_begin_unwind at panicking.rs:378:4 [opt]
    frame #24: 0x000000010077bc0f mycrate-eccaf1cfd7198a44`core::panicking::panic_fmt::h9eea9e4965bd189c at panicking.rs:85:13 [opt]
    frame #25: 0x000000010077bbd9 mycrate-eccaf1cfd7198a44`core::panicking::panic_bounds_check::h64467d59cd73a620 at panicking.rs:63:4 [opt]
    frame #26: 0x0000000100731041 mycrate-eccaf1cfd7198a44`_$LT$usize$u20$as$u20$core..slice..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$::index::hf47d04479a42a425(self=0, slice=&[bool] @ 0x000070000e45ec70) at mod.rs:2842:9
    frame #27: 0x0000000100730e4f mycrate-eccaf1cfd7198a44`core::slice::_$LT$impl$u20$core..ops..index..Index$LT$I$GT$$u20$for$u20$$u5b$T$u5d$$GT$::index::h9bc42169de23e7e9(self=&[bool] @ 0x000070000e45eca8, index=0) at mod.rs:2707:8
    frame #28: 0x00000001007303bb mycrate-eccaf1cfd7198a44`_$LT$alloc..vec..Vec$LT$T$GT$$u20$as$u20$core..ops..index..Index$LT$I$GT$$GT$::index::hd287d23309bad7d7(self=0x000070000e45ee58, index=0) at vec.rs:1890:8
    frame #29: 0x00000001002be994 mycrate-eccaf1cfd7198a44`_$LT$mycrate..parser..symbols..SymbolTable$u20$as$u20$core..fmt..Display$GT$::fmt::h3b3ddcbc0675bad4(self=0x000070000e45f320, f=0x000070000e45f018) at symbols.rs:131:52
    frame #30: 0x0000000100766c3e mycrate-eccaf1cfd7198a44`core::fmt::write::h9de7b13cfaa80b03 at mod.rs:1063:16 [opt]
    frame #31: 0x0000000100500519 mycrate-eccaf1cfd7198a44`std::io::Write::write_fmt::h6c51a00ff4060da6 at mod.rs:1426:14 [opt]
    frame #32: 0x000000010073f1ed mycrate-eccaf1cfd7198a44`std::io::stdio::_eprint::he02f2ef075b850b6 [inlined] std::io::impls::_$LT$impl$u20$std..io..Write$u20$for$u20$alloc..boxed..Box$LT$W$GT$$GT$::write_fmt::h4adf5d0c2ca9e2d8 at impls.rs:156:8 [opt]
    frame #33: 0x000000010073f1ab mycrate-eccaf1cfd7198a44`std::io::stdio::_eprint::he02f2ef075b850b6 [inlined] std::io::stdio::print_to::_$u7b$$u7b$closure$u7d$$u7d$::h5b99113f38314cfd at stdio.rs:797 [opt]
    frame #34: 0x000000010073f130 mycrate-eccaf1cfd7198a44`std::io::stdio::_eprint::he02f2ef075b850b6 [inlined] std::thread::local::LocalKey$LT$T$GT$::try_with::h30499295e471888e at local.rs:262 [opt]
    frame #35: 0x000000010073f116 mycrate-eccaf1cfd7198a44`std::io::stdio::_eprint::he02f2ef075b850b6 [inlined] std::io::stdio::print_to::hd516e13b802c9625 at stdio.rs:793 [opt]
    frame #36: 0x000000010073f116 mycrate-eccaf1cfd7198a44`std::io::stdio::_eprint::he02f2ef075b850b6 at stdio.rs:828 [opt]
    frame #37: 0x00000001001d59aa mycrate-eccaf1cfd7198a44`mycrate::parser::symbols::test::format::h57ee16f06e80bd5e at symbols.rs:566:8
    frame #38: 0x00000001004fad61 mycrate-eccaf1cfd7198a44`mycrate::parser::symbols::test::format::_$u7b$$u7b$closure$u7d$$u7d$::hf5b2fd21750a81ff((null)=0x000070000e45f4a0) at symbols.rs:555:4
    frame #39: 0x00000001002ee2b1 mycrate-eccaf1cfd7198a44`core::ops::function::FnOnce::call_once::hcec76ae6d3052efd((null)=closure-0 @ 0x000070000e45f4a0, (null)=<unavailable>) at function.rs:232:4
    frame #40: 0x000000010050cbee mycrate-eccaf1cfd7198a44`_$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::hc2bc258600f953aa at boxed.rs:1017:8 [opt]
    frame #41: 0x000000010074d32b mycrate-eccaf1cfd7198a44`__rust_maybe_catch_panic at lib.rs:86:7 [opt]
    frame #42: 0x0000000100526306 mycrate-eccaf1cfd7198a44`test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h6e22cb62c56ccb81 [inlined] std::panicking::try::hff2865ce1612e6d0 at panicking.rs:281:12 [opt]
    frame #43: 0x00000001005262bd mycrate-eccaf1cfd7198a44`test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h6e22cb62c56ccb81 [inlined] std::panic::catch_unwind::h45512aa3bb8061af at panic.rs:394 [opt]
    frame #44: 0x00000001005262bd mycrate-eccaf1cfd7198a44`test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h6e22cb62c56ccb81 [inlined] test::run_test_in_process::h57dcbeefa9c495e2 at lib.rs:542 [opt]
    frame #45: 0x00000001005262a6 mycrate-eccaf1cfd7198a44`test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h6e22cb62c56ccb81 at lib.rs:451 [opt]
    frame #46: 0x00000001004ffc5b mycrate-eccaf1cfd7198a44`std::sys_common::backtrace::__rust_begin_short_backtrace::h74cedaab7f8b5f1d at backtrace.rs:130:4 [opt]
    frame #47: 0x00000001005044db mycrate-eccaf1cfd7198a44`std::panicking::try::do_call::hc4d037f2a5ec4c80 [inlined] std::thread::Builder::spawn_unchecked::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::h7dc6455f557903b1 at mod.rs:475:16 [opt]
    frame #48: 0x00000001005044c6 mycrate-eccaf1cfd7198a44`std::panicking::try::do_call::hc4d037f2a5ec4c80 [inlined] _$LT$std..panic..AssertUnwindSafe$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$$LP$$RP$$GT$$GT$::call_once::h49266aee50f28d37 at panic.rs:318 [opt]
    frame #49: 0x00000001005044c6 mycrate-eccaf1cfd7198a44`std::panicking::try::do_call::hc4d037f2a5ec4c80 at panicking.rs:303 [opt]
    frame #50: 0x000000010074d32b mycrate-eccaf1cfd7198a44`__rust_maybe_catch_panic at lib.rs:86:7 [opt]
   frame #52: 0x0000000100504f8b mycrate-eccaf1cfd7198a44`core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::hc11cf9c53fe71d17 [inlined] std::panic::catch_unwind::h8c6ad728301d6a42 at panic.rs:394 [opt]
    frame #53: 0x0000000100504f8b mycrate-eccaf1cfd7198a44`core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::hc11cf9c53fe71d17 [inlined] std::thread::Builder::spawn_unchecked::_$u7b$$u7b$closure$u7d$$u7d$::h1f2ac55a2d4ac202 at mod.rs:474 [opt]
    frame #54: 0x0000000100504f57 mycrate-eccaf1cfd7198a44`core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::hc11cf9c53fe71d17 at function.rs:232 [opt]
    frame #55: 0x000000010073855e mycrate-eccaf1cfd7198a44`_$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h9a0848a2221632a4 at boxed.rs:1017:8 [opt]
    frame #56: 0x000000010074c9db mycrate-eccaf1cfd7198a44`std::sys::unix::thread::Thread::new::thread_start::h9f834bdc6e39a9b2 [inlined] _$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h1e1b030eaddd7101 at boxed.rs:1017:8 [
opt]
    frame #57: 0x000000010074c9cf mycrate-eccaf1cfd7198a44`std::sys::unix::thread::Thread::new::thread_start::h9f834bdc6e39a9b2 [inlined] std::sys_common::thread::start_thread::h16c47390370e9263 at thread.rs:13 [opt]
    frame #58: 0x000000010074c94e mycrate-eccaf1cfd7198a44`std::sys::unix::thread::Thread::new::thread_start::h9f834bdc6e39a9b2 at thread.rs:80 [opt]
    frame #59: 0x00007fff6cdff2eb libsystem_pthread.dylib`_pthread_body + 126
    frame #60: 0x00007fff6ce02249 libsystem_pthread.dylib`_pthread_start + 66
    frame #61: 0x00007fff6cdfe40d libsystem_pthread.dylib`thread_start + 13

LLDB Disassembly

mycrate-eccaf1cfd7198a44`std::panicking::rust_panic_with_hook::h7967810bc33e523b:
    0x100746700 <+0>:   push   rbp
    0x100746701 <+1>:   mov    rbp, rsp
    0x100746704 <+4>:   push   r15
    0x100746706 <+6>:   push   r14
    0x100746708 <+8>:   push   r13
    0x10074670a <+10>:  push   r12
    0x10074670c <+12>:  push   rbx
    0x10074670d <+13>:  sub    rsp, 0x98
    0x100746714 <+20>:  mov    r14, rsi
    0x100746717 <+23>:  mov    r12, rdi
    0x10074671a <+26>:  lea    rdi, [rip + 0x1373c7]     ; std::panicking::update_panic_count::PANIC_COUNT::__getit::__KEY::hf2959909424e4d31
    0x100746721 <+33>:  call   qword ptr [rdi]
    0x100746723 <+35>:  cmp    qword ptr [rax], 0x1
    0x100746727 <+39>:  jne    0x10074677c               ; <+124> [inlined] core::intrinsics::copy_nonoverlapping::h40951cde43ef2b49 at mod.rs:411
    0x100746729 <+41>:  lea    rdi, [rip + 0x1373b8]     ; std::panicking::update_panic_count::PANIC_COUNT::__getit::__KEY::hf2959909424e4d31
    0x100746730 <+48>:  call   qword ptr [rdi]
    0x100746732 <+50>:  mov    rbx, qword ptr [rax + 0x8]
    0x100746736 <+54>:  inc    rbx
    0x100746739 <+57>:  mov    qword ptr [rax + 0x8], rbx
    0x10074673d <+61>:  cmp    rbx, 0x2
    0x100746741 <+65>:  jbe    0x100746794               ; <+148> [inlined] core::panic::PanicInfo::internal_constructor::h09024b85a2db5e9f at panicking.rs:458
    0x100746743 <+67>:  lea    rax, [rip + 0x132236]     ; log::LOG_LEVEL_NAMES::ha11ffed51e925dcb + 5432
    0x10074674a <+74>:  mov    qword ptr [rbp - 0x60], rax
    0x10074674e <+78>:  mov    qword ptr [rbp - 0x58], 0x1
    0x100746756 <+86>:  mov    qword ptr [rbp - 0x50], 0x0
    0x10074675e <+94>:  lea    rax, [rip + 0xed1a3]      ; str.0 + 824
    0x100746765 <+101>: mov    qword ptr [rbp - 0x40], rax
    0x100746769 <+105>: mov    qword ptr [rbp - 0x38], 0x0
    0x100746771 <+113>: lea    rdi, [rbp - 0x60]
    0x100746775 <+117>: call   0x100745570               ; std::sys_common::util::dumb_print::h5f56c1b2aa1f46e3 at util.rs:6
->  0x10074677a <+122>: ud2
    0x10074677c <+124>: lea    rdi, [rip + 0x137365]     ; std::panicking::update_panic_count::PANIC_COUNT::__getit::__KEY::hf2959909424e4d31
    0x100746783 <+131>: call   qword ptr [rdi]
    0x100746785 <+133>: movaps xmm0, xmmword ptr [rip + 0xd88c4] ; str.1 + 288
    0x10074678c <+140>: movups xmmword ptr [rax], xmm0
    0x10074678f <+143>: mov    ebx, 0x1
    0x100746794 <+148>: lea    r13, [rip + 0xed16d]      ; str.0 + 824
    0x10074679b <+155>: mov    qword ptr [rbp - 0x80], r13
    0x10074679f <+159>: lea    rax, [rip + 0x131692]     ; log::LOG_LEVEL_NAMES::ha11ffed51e925dcb + 2544
    0x1007467a6 <+166>: mov    qword ptr [rbp - 0x78], rax
    0x1007467aa <+170>: mov    qword ptr [rbp - 0x70], rdx
    0x1007467ae <+174>: mov    qword ptr [rbp - 0x68], rcx
    0x1007467b2 <+178>: lea    rdi, [rip + 0x137107]     ; std::panicking::HOOK_LOCK::h88b6859f4558adf6
    0x1007467b9 <+185>: call   0x10077c44e               ; symbol stub for: pthread_rwlock_rdlock
    0x1007467be <+190>: mov    dword ptr [rbp - 0x2c], eax
    0x1007467c1 <+193>: test   eax, eax
    0x1007467c3 <+195>: je     0x1007467eb               ; <+235> [inlined] std::sys::unix::rwlock::RWLock::read::h3a08af9f48bda2f8 + 57 at rwlock.rs:26
    0x1007467c5 <+197>: cmp    eax, 0xb
    0x1007467c8 <+200>: je     0x1007468c1               ; <+449> [inlined] std::sys::unix::rwlock::RWLock::read::h3a08af9f48bda2f8 + 144 at rwlock.rs:26
    0x1007467ce <+206>: cmp    eax, 0x23
    0x1007467d1 <+209>: jne    0x10074682d               ; <+301> at panicking.rs
    0x1007467d3 <+211>: lea    rdi, [rip + 0xee1b6]      ; str.1 + 1424
    0x1007467da <+218>: lea    rdx, [rip + 0x13236f]     ; log::LOG_LEVEL_NAMES::ha11ffed51e925dcb + 5896
    0x1007467e1 <+225>: mov    esi, 0x24
    0x1007467e6 <+230>: call   0x10077ba10               ; std::panicking::begin_panic::hc31d5034796a8de1 at panicking.rs:392
    0x1007467eb <+235>: cmp    byte ptr [rip + 0x13719e], 0x0 ; std::panicking::HOOK_LOCK::h88b6859f4558adf6 + 207
    0x1007467f2 <+242>: jne    0x1007468b5               ; <+437> [inlined] std::sys::unix::rwlock::RWLock::raw_unlock::hf6155ef3d725c085 at rwlock.rs:46
    0x1007467f8 <+248>: lock
    0x1007467f9 <+249>: inc    qword ptr [rip + 0x137188] ; std::panicking::HOOK_LOCK::h88b6859f4558adf6 + 200
    0x100746800 <+256>: mov    r15, qword ptr [rip + 0x137fc9] ; std::panicking::HOOK::hf4af601710e91f4d + 8
    0x100746807 <+263>: test   r15, r15
    0x10074680a <+266>: jne    0x1007468d9               ; <+473> at panicking.rs:472:25
    0x100746810 <+272>: mov    rdi, r12
    0x100746813 <+275>: call   qword ptr [r14 + 0x20]
    0x100746817 <+279>: mov    qword ptr [rbp - 0x80], rax
    0x10074681b <+283>: mov    qword ptr [rbp - 0x78], rdx
    0x10074681f <+287>: lea    rdi, [rbp - 0x80]
    0x100746823 <+291>: call   0x100745c00               ; std::panicking::default_hook::hf135bc502e6f77db at panicking.rs:176
    0x100746828 <+296>: jmp    0x100746905               ; <+517> [inlined] core::sync::atomic::atomic_sub::h104cb79f795a91e2 at atomic.rs:1654
    0x10074682d <+301>: lea    rax, [rbp - 0x2c]
    0x100746831 <+305>: mov    qword ptr [rbp - 0x90], rax
    0x100746838 <+312>: lea    rax, [rip + 0x68a99]      ; str.2 + 1000
    0x10074683f <+319>: mov    qword ptr [rbp - 0x98], rax
    0x100746846 <+326>: lea    rax, [rbp - 0x90]
    0x10074684d <+333>: mov    qword ptr [rbp - 0xb8], rax
    0x100746854 <+340>: lea    rax, [rip - 0x1315b]      ; _$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$::fmt::h4eee5f03cec67fe0 at mod.rs:1959
    0x10074685b <+347>: mov    qword ptr [rbp - 0xb0], rax
    0x100746862 <+354>: lea    rcx, [rbp - 0x98]
    0x100746869 <+361>: mov    qword ptr [rbp - 0xa8], rcx
    0x100746870 <+368>: mov    qword ptr [rbp - 0xa0], rax
    0x100746877 <+375>: lea    rax, [rip + 0x13158a]     ; log::LOG_LEVEL_NAMES::ha11ffed51e925dcb + 2496
    0x10074687e <+382>: mov    qword ptr [rbp - 0x60], rax
    0x100746882 <+386>: mov    qword ptr [rbp - 0x58], 0x3
    0x10074688a <+394>: mov    qword ptr [rbp - 0x50], 0x0
    0x100746892 <+402>: lea    rax, [rbp - 0xb8]
    0x100746899 <+409>: mov    qword ptr [rbp - 0x40], rax
    0x10074689d <+413>: mov    qword ptr [rbp - 0x38], 0x2
    0x1007468a5 <+421>: lea    rsi, [rip + 0x1322d4]     ; log::LOG_LEVEL_NAMES::ha11ffed51e925dcb + 5944
    0x1007468ac <+428>: lea    rdi, [rbp - 0x60]
    0x1007468b0 <+432>: call   0x10077b9d0               ; std::panicking::begin_panic_fmt::h7bfa08c927336073 at panicking.rs:326
    0x1007468b5 <+437>: lea    rdi, [rip + 0x137004]     ; std::panicking::HOOK_LOCK::h88b6859f4558adf6
    0x1007468bc <+444>: call   0x10077c45a               ; symbol stub for: pthread_rwlock_unlock
    0x1007468c1 <+449>: lea    rdi, [rip + 0xee109]      ; str.1 + 1489
    0x1007468c8 <+456>: lea    rdx, [rip + 0x132299]     ; log::LOG_LEVEL_NAMES::ha11ffed51e925dcb + 5920
  0x1007468cf <+463>: mov    esi, 0x29
    0x1007468d4 <+468>: call   0x10077ba10               ; std::panicking::begin_panic::hc31d5034796a8de1 at panicking.rs:392
    0x1007468d9 <+473>: mov    rax, qword ptr [rip + 0x137ee8] ; std::panicking::HOOK::hf4af601710e91f4d
    0x1007468e0 <+480>: mov    qword ptr [rbp - 0x88], rax
    0x1007468e7 <+487>: mov    rdi, r12
    0x1007468ea <+490>: call   qword ptr [r14 + 0x20]
    0x1007468ee <+494>: mov    qword ptr [rbp - 0x80], rax
    0x1007468f2 <+498>: mov    qword ptr [rbp - 0x78], rdx
    0x1007468f6 <+502>: lea    rsi, [rbp - 0x80]
    0x1007468fa <+506>: mov    rdi, qword ptr [rbp - 0x88]
    0x100746901 <+513>: call   qword ptr [r15 + 0x18]
    0x100746905 <+517>: lock
    0x100746906 <+518>: dec    qword ptr [rip + 0x13707b] ; std::panicking::HOOK_LOCK::h88b6859f4558adf6 + 200
    0x10074690d <+525>: lea    rdi, [rip + 0x136fac]     ; std::panicking::HOOK_LOCK::h88b6859f4558adf6
    0x100746914 <+532>: call   0x10077c45a               ; symbol stub for: pthread_rwlock_unlock
    0x100746919 <+537>: cmp    rbx, 0x1
    0x10074691d <+541>: jbe    0x100746951               ; <+593> at panicking.rs:492:4
    0x10074691f <+543>: lea    rax, [rip + 0x13206a]     ; log::LOG_LEVEL_NAMES::ha11ffed51e925dcb + 5448
    0x100746926 <+550>: mov    qword ptr [rbp - 0x60], rax
    0x10074692a <+554>: mov    qword ptr [rbp - 0x58], 0x1
    0x100746932 <+562>: mov    qword ptr [rbp - 0x50], 0x0
    0x10074693a <+570>: mov    qword ptr [rbp - 0x40], r13
    0x10074693e <+574>: mov    qword ptr [rbp - 0x38], 0x0
    0x100746946 <+582>: lea    rdi, [rbp - 0x60]
    0x10074694a <+586>: call   0x100745570               ; std::sys_common::util::dumb_print::h5f56c1b2aa1f46e3 at util.rs:6
    0x10074694f <+591>: ud2
    0x100746951 <+593>: mov    rdi, r12
    0x100746954 <+596>: mov    rsi, r14
    0x100746957 <+599>: call   0x100746960               ; rust_panic at panicking.rs:519
    0x10074695c <+604>: nop    dword ptr [rax]

rustc version

rustc 1.43.1 (8d69840ab 2020-05-04)
binary: rustc
commit-hash: 8d69840ab92ea7f4d323420088dd8c9775f180cd
commit-date: 2020-05-04
host: x86_64-apple-darwin
release: 1.43.1
LLVM version: 9.0

Backtrace

The backtrace when this is run from main instead of a test:

thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd/src/libcore/slice/mod.rs:2842:10                                                                                                      [0/9904]
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.44/src/backtrace/libunwind.rs:86
   1: backtrace::backtrace::trace_unsynchronized
             at /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.44/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:1063
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1426
   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:204
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:224
  10: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:470
  11: rust_begin_unwind
             at src/libstd/panicking.rs:378
  12: core::panicking::panic_fmt
             at src/libcore/panicking.rs:85
  13: core::panicking::panic_bounds_check
             at src/libcore/panicking.rs:63
  14: <usize as core::slice::SliceIndex<[T]>>::index
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd/src/libcore/slice/mod.rs:2842
  15: core::slice::<impl core::ops::index::Index<I> for [T]>::index
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd/src/libcore/slice/mod.rs:2707
  16: <alloc::vec::Vec<T> as core::ops::index::Index<I>>::index
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd/src/liballoc/vec.rs:1890
  17: <mycrate::parser::symbols::SymbolTable as core::fmt::Display>::fmt
             at src/parser/symbols.rs:131
  18: core::fmt::write
             at src/libcore/fmt/mod.rs:1063
  19: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1426
  20: <std::io::stdio::Stderr as std::io::Write>::write_fmt
             at src/libstd/io/stdio.rs:706
  21: std::io::stdio::print_to::{{closure}}
             at src/libstd/io/stdio.rs:800
  22: std::thread::local::LocalKey<T>::try_with
             at src/libstd/thread/local.rs:262
  23: std::io::stdio::print_to
             at src/libstd/io/stdio.rs:793
  24: std::io::stdio::_eprint
             at src/libstd/io/stdio.rs:828
  25: testing::main
             at bin/test.rs:49
  26: std::rt::lang_start::{{closure}}
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd/src/libstd/rt.rs:67
  27: std::rt::lang_start_internal::{{closure}}
             at src/libstd/rt.rs:52
  28: std::panicking::try::do_call
             at src/libstd/panicking.rs:303
  29: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:86
  30: std::panicking::try
             at src/libstd/panicking.rs:281
  31: std::panic::catch_unwind
             at src/libstd/panic.rs:394
  32: std::rt::lang_start_internal
             at src/libstd/rt.rs:51
  33: std::rt::lang_start
             at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd/src/libstd/rt.rs:67
  34: testing::main
@ehuss
Copy link
Contributor

ehuss commented May 13, 2020

I think this is a duplicate of #69558, which should be fixed on 1.44 (beta). Can you try it on beta?

@KenDJohnson
Copy link
Author

Aha, looks like I missed that one in my search, sorry about that. Confirmed the issue is fixed in 1.44 beta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants