e3prom / rVRRPd

A lightweight, fast, and highly secure VRRP daemon.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Thread panick when the Master owns the local IP address or VIP

e3prom opened this issue · comments

The worker thread trigger a panic in tokio-timer interval.rs:31 when the VRRP host owns the Virtual IP Address (VIP). This issue can be easily reproduced with the default configuration and when the group's VIP equals a locally configured IP address.

thread '<unnamed>' panicked at '`duration` must be non-zero.', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-timer-0.2.13/src/interval.rs:31:9
stack backtrace:
   0:          0x1c18fe0 - std::backtrace_rs::backtrace::libunwind::trace::h38ada28f8aa6510e
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:          0x1c18fe0 - std::backtrace_rs::backtrace::trace_unsynchronized::h36b70c2b5fb9402f
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:          0x1c18fe0 - std::sys_common::backtrace::_print_fmt::h75a9de38378fe2b2
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/sys_common/backtrace.rs:65:5
   3:          0x1c18fe0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h8899f1dc8f3e5c99
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/sys_common/backtrace.rs:44:22
   4:          0x1c3cf7e - core::fmt::write::h094021303b2105e6
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/core/src/fmt/mod.rs:1209:17
   5:          0x1c135a5 - std::io::Write::write_fmt::h5a56bdbeb0116d07
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/io/mod.rs:1682:15
   6:          0x1c18d95 - std::sys_common::backtrace::_print::h297dfecdf465761e
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/sys_common/backtrace.rs:47:5
   7:          0x1c18d95 - std::sys_common::backtrace::print::h94a1bd877d49065d
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/sys_common/backtrace.rs:34:9
   8:          0x1c1a4df - std::panicking::default_hook::{{closure}}::h93079119072659d4
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/panicking.rs:267:22
   9:          0x1c1a18d - std::panicking::default_hook::h782f6b9a3bf3f355
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/panicking.rs:286:9
  10:          0x1c1acbb - std::panicking::rust_panic_with_hook::h29eff63546532458
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/panicking.rs:688:13
  11:          0x1bbbfc8 - std::panicking::begin_panic::{{closure}}::h3ca69803906c63ed
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/panicking.rs:608:9
  12:          0x1bc2806 - std::sys_common::backtrace::__rust_end_short_backtrace::h1ccc43b0ec0b0d6e
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/sys_common/backtrace.rs:137:18
  13:          0x1bbbf00 - std::panicking::begin_panic::h77f63de955fc8724
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/panicking.rs:607:12
  14:          0x1944ccb - tokio_timer::interval::Interval::new::h86921bc64799b776
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-timer-0.2.13/src/interval.rs:31:9
  15:          0x1944d5c - tokio_timer::interval::Interval::new_interval::h3a02c5a0140da172
                               at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-timer-0.2.13/src/interval.rs:49:9
  16:          0x140b074 - rVRRPd::timers::start_timers::h832e9d455b3e11bc
                               at /var/tmp/rVRRPd/src/timers.rs:58:27
  17:          0x14f1574 - rVRRPd::fsm::fsm_run::{{closure}}::h69c272077cfce390
                               at /var/tmp/rVRRPd/src/fsm.rs:260:29
  18:          0x144f2a5 - std::sys_common::backtrace::__rust_begin_short_backtrace::h76ed9abe54d880fd
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/sys_common/backtrace.rs:121:18
  19:          0x144b606 - std::thread::Builder::spawn_unchecked_::{{closure}}::{{closure}}::h84633929044c8693
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/thread/mod.rs:551:17
  20:          0x144e2c9 - <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h44f6173f23bed303
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/core/src/panic/unwind_safe.rs:271:9
  21:          0x144ceca - std::panicking::try::do_call::h0eac242b22e06485
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/panicking.rs:483:40
  22:          0x144e21b - __rust_try
  23:          0x144c280 - std::panicking::try::h550b26d1cd843213
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/panicking.rs:447:19
  24:          0x144bb49 - std::panic::catch_unwind::h373bf8ed9236a41c
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/panic.rs:137:14
  25:          0x144af58 - std::thread::Builder::spawn_unchecked_::{{closure}}::hd1c19446f7173ae2
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/thread/mod.rs:550:30
  26:          0x147f13f - core::ops::function::FnOnce::call_once{{vtable.shim}}::hbc9d6086ed74184b
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/core/src/ops/function.rs:251:5
  27:          0x1c1d4d3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h3aa625e4f7fc532e
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/alloc/src/boxed.rs:1987:9
  28:          0x1c1d4d3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h5fe5761a69783522
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/alloc/src/boxed.rs:1987:9
  29:          0x1c1d4d3 - std::sys::unix::thread::Thread::new::thread_start::h22df23c4ce6cbb23
                               at /rustc/90743e7298aca107ddaa0c202a4d3604e29bfeb6/library/std/src/sys/unix/thread.rs:108:17
  30:        0x80222bfd6 - <unknown>

Fixed in bug-fix-timers-cancellations branch. The latter has been merged with 0.2.0-dev. The Down and Advertisement timers are now set using high, non-zero values. The tokio-timer threads are now longer panicking. When the host IP is owned, the Master behaves correctly, and uses the correct maximum priority (255), allows for preemption, and shutdown correctly (removes it's IP to avoid LAN duplicates with the new Master virtual router).