Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Double panic on Ctrl+C exit during block sync #1034

Closed
0x7CFE opened this issue Oct 29, 2018 · 1 comment · Fixed by #1308
Closed

Double panic on Ctrl+C exit during block sync #1034

0x7CFE opened this issue Oct 29, 2018 · 1 comment · Fixed by #1308
Labels
I3-bug The node fails to follow expected behavior. Z2-medium Can be fixed by a coder with good Rust knowledge but little knowledge of the codebase.
Milestone

Comments

@0x7CFE
Copy link
Contributor

0x7CFE commented Oct 29, 2018

Compiler: rustc 1.31.0-nightly (96064eb61 2018-10-28)

Branch: bbq-birch

commit 15e955dc652e48f3e1b13a1b6a93e555ad18203a
Author: Tomasz Drwięga <[email protected]>
Date:   Tue Oct 16 10:04:19 2018 +0200

    Longevity handling. (#903)

If I send SIGINT to the process I may get SIGILL with 20% chance.

(lldb) cont
Process 1968 resuming
thread panicked while processing panic. aborting.
Process 1968 stopped
* thread #10: tid = 1978, 0x0000555556571de4 substrate`std::panicking::rust_panic_with_hook::hcb9ad4b0875cf96f + 148 at panicking.rs:0, name = 'ImportQueue', stop reason = signal SIGILL: illegal instruction operand
    frame #0: 0x0000555556571de4 substrate`std::panicking::rust_panic_with_hook::hcb9ad4b0875cf96f + 148 at panicking.rs:0
(lldb) bt
* thread #10: tid = 1978, 0x0000555556571de4 substrate`std::panicking::rust_panic_with_hook::hcb9ad4b0875cf96f + 148 at panicking.rs:0, name = 'ImportQueue', stop reason = signal SIGILL: illegal instruction operand
  * frame #0: 0x0000555556571de4 substrate`std::panicking::rust_panic_with_hook::hcb9ad4b0875cf96f + 148 at panicking.rs:0
    frame #1: 0x0000555556571a62 substrate`std::panicking::continue_panic_fmt::hee1745c3ca8a23be + 162 at panicking.rs:390
    frame #2: 0x0000555556571946 substrate`rust_begin_unwind + 6 at panicking.rs:325
    frame #3: 0x00005555565b2bed substrate`core::panicking::panic_fmt::hbebfd4901a566206 + 61 at panicking.rs:77
    frame #4: 0x00005555565b2c63 substrate`core::option::expect_failed::h6f7158703abd4906 + 115 at option.rs:1008
    frame #5: 0x00005555565653b9 substrate`std::io::stdio::stderr::he8f02dd76dc6470d + 457 at option.rs:322
    frame #6: 0x0000555555c7c90f substrate`substrate_cli::panic_hook::panic_hook::h1e354d3aae01addd + 351 at panic_hook.rs:53
    frame #7: 0x0000555555c7c609 substrate`core::ops::function::Fn::call::hd06a29a872e1c181 + 9 at function.rs:78
    frame #8: 0x0000555556571f17 substrate`std::panicking::rust_panic_with_hook::hcb9ad4b0875cf96f + 455 at panicking.rs:480
    frame #9: 0x0000555556571a62 substrate`std::panicking::continue_panic_fmt::hee1745c3ca8a23be + 162 at panicking.rs:390
    frame #10: 0x0000555556571946 substrate`rust_begin_unwind + 6 at panicking.rs:325
    frame #11: 0x00005555565b2bed substrate`core::panicking::panic_fmt::hbebfd4901a566206 + 61 at panicking.rs:77
    frame #12: 0x00005555565b2c63 substrate`core::option::expect_failed::h6f7158703abd4906 + 115 at option.rs:1008
    frame #13: 0x00005555565653b9 substrate`std::io::stdio::stderr::he8f02dd76dc6470d + 457 at option.rs:322
    frame #14: 0x0000555555c7c90f substrate`substrate_cli::panic_hook::panic_hook::h1e354d3aae01addd + 351 at panic_hook.rs:53
    frame #15: 0x0000555555c7c609 substrate`core::ops::function::Fn::call::hd06a29a872e1c181 + 9 at function.rs:78
    frame #16: 0x0000555556571f17 substrate`std::panicking::rust_panic_with_hook::hcb9ad4b0875cf96f + 455 at panicking.rs:480
    frame #17: 0x000055555639ad38 substrate`std::panicking::begin_panic::ha9bd69c01f3c54a7 + 40 at panicking.rs:410
    frame #18: 0x000055555639a519 substrate`_$LT$slog_scope..NoGlobalLoggerSet$u20$as$u20$slog..Drain$GT$::log::h39fb4c925a1a8cb7 + 25 at lib.rs:123
    frame #19: 0x0000555555b206b0 substrate`_$LT$std..thread..local..LocalKey$LT$T$GT$$GT$::with::h0b442aec4f0882ee + 1120 at lib.rs:1675
    frame #20: 0x00005555559b20aa substrate`_$LT$substrate_client..client..Client$LT$B$C$$u20$E$C$$u20$Block$GT$$GT$::import_block::h5ae173a154b7da57 + 9818 at lib.rs:211
    frame #21: 0x000055555598b68c substrate`_$LT$substrate_client..client..Client$LT$B$C$$u20$E$C$$u20$Block$GT$$u20$as$u20$substrate_network..chain..Client$LT$Block$GT$$GT$::import::hbdd3dc4bc592ee1c + 1948 at chain.rs:90
    frame #22: 0x0000555555a609cd substrate`substrate_network::import_queue::import_thread::hc89fa5b8373db35d + 4701 at import_queue.rs:322
    frame #23: 0x0000555555b844d5 substrate`_ZN3std9panicking3try7do_call17hd5101818db596964E.llvm.12423680275706143713 + 37 at mod.rs:409
    frame #24: 0x0000555556582e0a substrate`__rust_maybe_catch_panic + 26 at lib.rs:102
    frame #25: 0x000055555594d8f6 substrate`_$LT$F$u20$as$u20$alloc..boxed..FnBox$LT$A$GT$$GT$::call_box::h15702d321c654371 + 182 at panicking.rs:289
    frame #26: 0x00005555565767be substrate`std::sys::unix::thread::Thread::new::thread_start::h407e7a774ea93e4b + 142 at boxed.rs:682
    frame #27: 0x00007ffff6d866ba libpthread.so.0`start_thread + 202
    frame #28: 0x00007ffff68a641d libc.so.6`__clone + 109
(lldb)

CPU info:

processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 142
model name      : Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
stepping        : 9
microcode       : 0x8e
cpu MHz         : 500.009
cache size      : 3072 KB
physical id     : 0
siblings        : 4
core id         : 0
cpu cores       : 2
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 22
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp flush_l1d
bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf
bogomips        : 5424.00
clflush size    : 64
cache_alignment : 64
address sizes   : 39 bits physical, 48 bits virtual
power management:
@0x7CFE 0x7CFE added the I3-bug The node fails to follow expected behavior. label Oct 29, 2018
@0x7CFE 0x7CFE added this to the As-and-when milestone Oct 29, 2018
@0x7CFE 0x7CFE added M4-core Z2-medium Can be fixed by a coder with good Rust knowledge but little knowledge of the codebase. labels Oct 29, 2018
@0x7CFE
Copy link
Contributor Author

0x7CFE commented Oct 29, 2018

Please note, that SIGILL is probably due to how rust handles paincs and is neither result of memory corruption nor the compiler bug.

For more information see rust-lang/rust#53814 and rust-lang/rfcs#1454.

So, the actual issue is double panic, not the illegal instruction.

lamafab pushed a commit to lamafab/substrate that referenced this issue Jun 16, 2020
* Add benchmarking suite to all runtimes

* Add `runtime-benchmarks` feature to `test-linux-stable`

* Update Cargo.lock

* Update Cargo.lock

* Update Cargo.lock

* "user" instead of "caller"

* undo these changes
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
I3-bug The node fails to follow expected behavior. Z2-medium Can be fixed by a coder with good Rust knowledge but little knowledge of the codebase.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant