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

thread 'rustc' panicked at 'other was less than the current instant' #48514

Closed
plavcik opened this issue Feb 24, 2018 · 3 comments
Closed

thread 'rustc' panicked at 'other was less than the current instant' #48514

plavcik opened this issue Feb 24, 2018 · 3 comments
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@plavcik
Copy link

plavcik commented Feb 24, 2018

I created hello.rs file with copy of example on https://www.rust-lang.org/en-US/
then

rustc hello.rs
error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.20.0 running on x86_64-unknown-openbsd

thread 'rustc' panicked at 'other was less than the current instant', /usr/obj/ports/rust-1.20.0/rustc-1.20.0-src/src/libstd/sys/unix/time.rs:276:16
note: Run with RUST_BACKTRACE=1 for a backtrace.

I'm on OpenBSD 6.2 amd64 with rust-1.20.0

@retep998
Copy link
Member

This sounds like another case of faulty hardware/OS causing Instant to not actually be monotonic. This happened once before, but on Windows. #47684

Could you provide details on what your exact CPU is?

@pietroalbini pietroalbini added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ C-bug Category: This is a bug. labels Feb 27, 2018
@plavcik
Copy link
Author

plavcik commented Feb 28, 2018 via email

@jonathanstrong
Copy link

In my experience, Instant is relatively easy to trigger a panic with. Perhaps a good solution would be to add to its public api so that failure can be handled. It would be very nice to have a saturating_sub fn, for instance.

alexcrichton added a commit to alexcrichton/rust that referenced this issue Jan 7, 2019
This commit is an attempt to force `Instant::now` to be monotonic
through any means possible. We tried relying on OS/hardware/clock
implementations, but those seem buggy enough that we can't rely on them
in practice. This commit implements the same hammer Firefox recently
implemented (noted in rust-lang#56612) which is to just keep whatever the lastest
`Instant::now()` return value was in memory, returning that instead of
the OS looks like it's moving backwards.

Closes rust-lang#48514
Closes rust-lang#49281
cc rust-lang#51648
cc rust-lang#56560
Closes rust-lang#56612
Closes rust-lang#56940
bors added a commit that referenced this issue Jan 8, 2019
std: Force `Instant::now()` to be monotonic

This commit is an attempt to force `Instant::now` to be monotonic
through any means possible. We tried relying on OS/hardware/clock
implementations, but those seem buggy enough that we can't rely on them
in practice. This commit implements the same hammer Firefox recently
implemented (noted in #56612) which is to just keep whatever the lastest
`Instant::now()` return value was in memory, returning that instead of
the OS looks like it's moving backwards.

Closes #48514
Closes #49281
cc #51648
cc #56560
Closes #56612
Closes #56940
bors added a commit that referenced this issue Jan 8, 2019
std: Force `Instant::now()` to be monotonic

This commit is an attempt to force `Instant::now` to be monotonic
through any means possible. We tried relying on OS/hardware/clock
implementations, but those seem buggy enough that we can't rely on them
in practice. This commit implements the same hammer Firefox recently
implemented (noted in #56612) which is to just keep whatever the lastest
`Instant::now()` return value was in memory, returning that instead of
the OS looks like it's moving backwards.

Closes #48514
Closes #49281
cc #51648
cc #56560
Closes #56612
Closes #56940
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

4 participants