Skip to content

Panic due to overflow in _cycles_per_sec() #5

@Stypox

Description

@Stypox

I got this crash earlier, in the _cycles_per_sec() function, and I can sometimes reproduce it randomly and rarely. Apparently tsc2 < tsc1, which should be impossible...

If you also can't reproduce feel free to close this issue, I'm reporting it just in case it can help.

thread '<unnamed>' panicked at /home/USER/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/fastant-0.1.10/src/tsc_now.rs:170:34:
attempt to subtract with overflow
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread '<unnamed>' panicked at library/core/src/panicking.rs:218:5:
panic in a function that cannot unwind
stack backtrace:
   0:     0x560ec098623a - std::backtrace_rs::backtrace::libunwind::trace::h88deb10bd0145eb8
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/std/src/../../backtrace/src/backtrace/libunwind.rs:116:5
   1:     0x560ec098623a - std::backtrace_rs::backtrace::trace_unsynchronized::he1036f5481c14dff
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x560ec098623a - std::sys::backtrace::_print_fmt::hecc345b6e70c4b20
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/std/src/sys/backtrace.rs:66:9
   3:     0x560ec098623a - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::he089f96442833f67
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/std/src/sys/backtrace.rs:39:26
   4:     0x560ec09a5573 - core::fmt::rt::Argument::fmt::h1f77cded99c71a14
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/core/src/fmt/rt.rs:177:76
   5:     0x560ec09a5573 - core::fmt::write::h2f210ed4c94745cb
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/core/src/fmt/mod.rs:1440:21
   6:     0x560ec09837e3 - std::io::Write::write_fmt::h7de08171ab770fb2
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/std/src/io/mod.rs:1887:15
   7:     0x560ec0986082 - std::sys::backtrace::BacktraceLock::print::h810fbd31421329e6
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/std/src/sys/backtrace.rs:42:9
   8:     0x560ec0987220 - std::panicking::default_hook::{{closure}}::hbaad47ed9dc6356d
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/std/src/panicking.rs:295:22
   9:     0x560ec0987000 - std::panicking::default_hook::h24e207139139d40a
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/std/src/panicking.rs:322:9
  10:     0x560ec0987892 - std::panicking::rust_panic_with_hook::ha9131beeb2ddc506
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/std/src/panicking.rs:828:13
  11:     0x560ec09876f6 - std::panicking::begin_panic_handler::{{closure}}::h1bba0eaeb6da506f
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/std/src/panicking.rs:694:13
  12:     0x560ec0986739 - std::sys::backtrace::__rust_end_short_backtrace::h1d1ca3eade483f4c
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/std/src/sys/backtrace.rs:168:18
  13:     0x560ec09873bd - rust_begin_unwind
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/std/src/panicking.rs:692:5
  14:     0x560ec089796d - core::panicking::panic_nounwind_fmt::runtime::hdd2d1a56a8b6cee7
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/core/src/panicking.rs:117:22
  15:     0x560ec089796d - core::panicking::panic_nounwind_fmt::h0d5ff668f956fac4
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/core/src/intrinsics/mod.rs:3869:9
  16:     0x560ec0897a02 - core::panicking::panic_nounwind::h385b7d9bda51382d
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/core/src/panicking.rs:218:5
  17:     0x560ec0897b65 - core::panicking::panic_cannot_unwind::h757b6ea37bf9b60a
                               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/core/src/panicking.rs:307:5
  18:     0x560ec0898161 - fastant::tsc_now::___init___ctor::___init___ctor::h46fb9483f0334d4a
                               at /home/USER/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/fastant-0.1.10/src/tsc_now.rs:24:1
  19:     0x7f191a20b5c4 - __libc_start_main
  20:     0x560ec0898195 - _start
  21:                0x0 - <unknown>
thread caused non-unwinding panic. aborting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions