You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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
The text was updated successfully, but these errors were encountered:
Illegal instruction executed in
rust_panic_with_hook
whenstd::fmt::Display
panics. When attempting to print the backtrace it will outputthread 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'
andtarget/debug/deps/... 'test::format'
both result in the bad instruction being executed, although if the code for this test is moved tofn main()
and run as an executable, the panic unwinding and backtrace is handled properly.LLDB backtrace:
LLDB Disassembly
rustc version
Backtrace
The backtrace when this is run from main instead of a test:
The text was updated successfully, but these errors were encountered: