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

supplied instant is later than self #86470

Closed
ghost opened this issue Jun 19, 2021 · 13 comments · Fixed by #89926
Closed

supplied instant is later than self #86470

ghost opened this issue Jun 19, 2021 · 13 comments · Fixed by #89926
Labels
A-time Area: Time C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@ghost
Copy link

ghost commented Jun 19, 2021

Meta

rustc --version --verbose:

rustc 1.52.1 (9bc8c42bb 2021-05-09)
binary: rustc
commit-hash: 9bc8c42bb2f19e745a63f3445f1ac248fb015e53
commit-date: 2021-05-09
host: x86_64-unknown-linux-gnu
release: 1.52.1
LLVM version: 12.0.0

Error output

thread 'rustc' panicked at 'supplied instant is later than self', library/std/src/time.rs:281:48
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.52.1 (9bc8c42bb 2021-05-09) running on x86_64-unknown-linux-gnu

note: compiler flags: -C opt-level=3 -C embed-bitcode=no --crate-type lib

note: some of the compiler flags provided by cargo are hidden
Backtrace

0: rust_begin_unwind
             at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/panicking.rs:493:5
   1: core::panicking::panic_fmt
             at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/core/src/panicking.rs:92:14
   2: core::option::expect_failed
             at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/core/src/option.rs:1321:5
   3: core::option::Option<T>::expect
             at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/core/src/option.rs:349:21
   4: std::time::Instant::duration_since
             at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/time.rs:281:9
   5: <std::time::Instant as core::ops::arith::Sub>::sub
             at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/time.rs:406:9
   6: std::time::Instant::elapsed
             at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/time.rs:345:9
   7: rustc_codegen_llvm::base::compile_codegen_unit
   8: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
   9: rustc_interface::passes::QueryContext::enter
  10: rustc_interface::queries::Queries::ongoing_codegen
  11: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  12: rustc_span::with_source_map
  13: rustc_interface::interface::create_compiler_and_run
  14: scoped_tls::ScopedKey<T>::set

This might be an LLVM bug, as it never occurs on Windows and occurs in every rust program that I've compiled on Linux, not when compiling, but running it.

@ghost ghost added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 19, 2021
@fee1-dead
Copy link
Member

Can you check your system clock? That might be the issue. Also did you use RUST_BACKTRACE=full to get the full backtrace?

@the8472
Copy link
Member

the8472 commented Jun 20, 2021

This usually is due to outdated kernels, hardware or hypervisor bugs (see #80674, #82606, #84448 and several others)

Can you provide the following information?

  • OS and kernel version
  • output for one core from /proc/cpuinfo
  • hypervisor if the system is virtualized
  • selected clock source (cat /sys/devices/system/clocksource/clocksource0/current_clocksource)

@tabokie
Copy link
Contributor

tabokie commented Jul 10, 2021

@the8472 We encountered the same issue in a production service (TiKV) deployed on AWS EC2.

System information as requested:

  • OS and kernel version
-bash-4.2$ cat /etc/os-release
NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2"
HOME_URL="https://amazonlinux.com/"
-bash-4.2$ uname -a
Linux ip-10-28-50-7.ap-northeast-1.compute.internal 4.14.154-128.181.amzn2.x86_64 #1 SMP Sat Nov 16 21:49:00 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
  • output for one core from /proc/cpuinfo
-bash-4.2$ cat /proc/cpuinfo
processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 79
model name  : Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz
stepping    : 1
microcode   : 0xb000038
cpu MHz     : 2700.001
cache size  : 46080 KB
physical id : 0
siblings    : 16
core id     : 0
cpu cores   : 8
apicid      : 0
initial apicid  : 0
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch cpuid_fault invpcid_single pti fsgsbase bmi1 hle avx2 smep bmi2 erms invpcid rtm rdseed adx xsaveopt
bugs        : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs taa itlb_multihit
bogomips    : 4599.99
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:
  • hypervisor if the system is virtualized
-bash-4.2$ cat /sys/hypervisor/
compilation/ guest_type   properties/  type         uuid         version/
-bash-4.2$ cat /sys/hypervisor/version/
extra  major  minor
-bash-4.2$ cat /sys/hypervisor/version/major
4
-bash-4.2$ cat /sys/hypervisor/version/minor
11
-bash-4.2$ cat /sys/hypervisor/version/extra
.amazon
  • selected clock source (cat /sys/devices/system/clocksource/clocksource0/current_clocksource
-bash-4.2$ cat /sys/devices/system/clocksource/clocksource0/current_clocksource
xen

@the8472
Copy link
Member

the8472 commented Jul 10, 2021

@tabokie thanks for the report.

4.14.154-128.181.amzn2

Looks like that does contain backported patches which query the hypervisor whether the pvclock is stable which then disables the clock monotonization in the kernel

So either the version of xen that amazon is using has a bug (advertising a stable clock when it isn't) or the backported patches are missing some critical pieces.

How reliably can you reproduce the issue? If it occurs frequently enough to make investigation easy, can you update your kernel to see if that solves it? That would indicate some incomplete backports.
If the issue persists after an update it would point at a problem at amazon, at least with that particular instance type. Based on the CPU type used I guess it's an m4 or r4 instance?

@tabokie
Copy link
Contributor

tabokie commented Jul 10, 2021

@the8472 Thanks for looking into our case, we have only experienced the panic once. Will share more information if there's progress in reproducing it.

Since it's hard for us to lock-in certain "safe" kernel/hardware to our software, or check the safety of arbitrary kernel/hardware, we are leaning towards replacing standard Instant to our own with a non-panic version of elapsed(saturating_elapsed). Do you think the standard library could use such an addition too?

@the8472
Copy link
Member

the8472 commented Jul 10, 2021

I'm primarily asking to figure out how to adjust std's built-in heuristics for the clock monotonization and where to report upstream bugs. Something is violating the posix CLOCK_MONOTONIC contract and it's hard to pinpoint the cause because the issue only affects specific hardware/software constellations.

we are leaning towards replacing standard Instant to our own with a non-panic version of elapsed(saturating_elapsed). Do you think the standard library could use such an addition too?

You can already get this with existing standard library methods via Instant::now().saturating_duration_since(old_instant). If you want a saturating_elapsed() as a shorthand that could be added to std or you could write your own extension trait for std::Instant.

@ghost
Copy link
Author

ghost commented Jul 11, 2021

For me, this error did not occur in a VM, it was on bare metal. Unfortunately said machine isn't working at the moment, but I do know the CPU was a Celeron n3060.

@frankosterfeld
Copy link

frankosterfeld commented Aug 12, 2021

I'm seeing this in a macOS Catalina (10.15.6) VM, running in virtualbox (6.1.26) on a macOS Big Sur (11.5.1) host.
When compiling https://github.com/mozilla/dump_syms and dependencies (278 steps), I get this error a few times (maybe 3-4 times in average), every time in another package.

Guest VM: Darwin [hostname removed] 19.6.0 Darwin Kernel Version 19.6.0: Thu Jun 18 20:49:00 PDT 2020; root:xnu-6153.141.1~1/RELEASE_X86_64 x86_64
Host: Darwin [hostname removed] 20.6.0 Darwin Kernel Version 20.6.0: Wed Jun 23 00:26:31 PDT 2021; root:xnu-7195.141.2~5/RELEASE_X86_64 x86_64

rustc 1.53.0

@the8472
Copy link
Member

the8472 commented Aug 12, 2021

@frankosterfeld assuming the issue doesn't occur on the host system it sounds like a bug in the way that VirtualBox provides timers to the guest.

Anyway, can you provide a backtrace?

@frankosterfeld
Copy link

frankosterfeld commented Aug 12, 2021

@the8472 Indeed, it doesn't seem to happen on the host (I built 5 times now without issue).

Googling I find (old) issues like this one: https://www.virtualbox.org/ticket/7915

Here's a backtrace:

Backtrace
thread 'rustc' panicked at 'supplied instant is later than self', library/std/src/time.rs:281:48
stack backtrace:
   0:        0x100afa88e - ::fmt::h7dac4b58aa11870a
   1:        0x100b9484e - core::fmt::write::h53badd02f711efbe
thread 'main' panicked at 'supplied instant is later than self', library/std/src/time.rs:281:48er, memoffset(build.rs)                                                                                 
stack backtrace:
   0:        0x103c6a5ce - ::fmt::h7dac4b58aa11870a
   1:        0x103caaaee - core::fmt::write::h53badd02f711efbe
   2:        0x103c65c7a - std::io::Write::write_fmt::hd02c4bbaf6463567
   3:        0x103c853df - std::panicking::default_hook::{{closure}}::ha7d22468d4529f02
   4:        0x103c84f6a - std::panicking::default_hook::hc6c5fb91e7ed228a
   5:        0x103c85950 - std::panicking::rust_panic_with_hook::h94fd567d38cd4da7
   6:        0x103c6a945 - std::panicking::begin_panic_handler::{{closure}}::h953a8f32e4882703
   7:        0x103c6a748 - std::sys_common::backtrace::__rust_end_short_backtrace::h8472811b9ff0c597
   8:        0x103c854e3 - _rust_begin_unwind
   9:        0x103d04bff - core::panicking::panic_fmt::h5a271c2839c7a480
  10:        0x103d04e9a - core::option::expect_failed::h7ae81fcabe446ed2
  11:        0x103c66772 - std::sys::unix::condvar::Condvar::wait_timeout::h0a053b632c3af75a
  12:        0x103832472 - std::sync::condvar::Condvar::wait_timeout_while::h64f3c7014de50a03
  13:        0x103628a55 - cargo::util::queue::Queue::pop::h62751c7b271dfc21
  14:        0x1036c43fb - cargo::core::compiler::job_queue::DrainState::drain_the_queue::h2cdc48f1a4c2b8d3
  15:        0x1037a75fb - std::panic::catch_unwind::h7ce81730fa67d5fb
  16:        0x103736dbf - crossbeam_utils::thread::scope::h5dd3bef14adde2e1
  17:        0x1036c233f - cargo::core::compiler::job_queue::JobQueue::execute::h7220b2748065b72a
  18:        0x10364546a - cargo::core::compiler::context::Context::compile::hd88a984ecb38f964
  19:        0x1038eaffb - cargo::ops::cargo_compile::compile_ws::hdfefe68826251154
  20:        0x1036d4083 - cargo::ops::cargo_install::install_one::hd815a53823f4cf4c
  21:        0x1036cea5b - cargo::ops::cargo_install::install::h2a5d5b9693d18de7
  22:        0x10352c6c7 - cargo::commands::install::exec::had4b593b99923474
  23:        0x1035108da - cargo::cli::main::h6d1be6cd0c776121
  24:        0x1035220ad - cargo::main::h7fb76a874797df25
  25:        0x10350bc3a - std::sys_common::backtrace::__rust_begin_short_backtrace::hcee2bb4cb8c63cbc
  26:        0x10350be1c - std::rt::lang_start::{{closure}}::haa89dd94abd14a82
  27:        0x103c8f6da - std::rt::lang_start_internal::h43b407d2a4fa0408
  28:        0x1035243c9 - _main
thread '' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', src/cargo/util/queue.rs:43:46
stack backtrace:
   0:        0x103c6a5ce - ::fmt::h7dac4b58aa11870a
   1:        0x103caaaee - core::fmt::write::h53badd02f711efbe
   2:        0x103c65c7a - std::io::Write::write_fmt::hd02c4bbaf6463567
   3:        0x103c853df - std::panicking::default_hook::{{closure}}::ha7d22468d4529f02
   4:        0x103c84f6a - std::panicking::default_hook::hc6c5fb91e7ed228a
   5:        0x103c85950 - std::panicking::rust_panic_with_hook::h94fd567d38cd4da7
   6:        0x103c6a945 - std::panicking::begin_panic_handler::{{closure}}::h953a8f32e4882703
   7:        0x103c6a748 - std::sys_common::backtrace::__rust_end_short_backtrace::h8472811b9ff0c597
   8:        0x103c854e3 - _rust_begin_unwind
   9:        0x103d04bff - core::panicking::panic_fmt::h5a271c2839c7a480
  10:        0x103d04f15 - core::result::unwrap_failed::hdc9b54af28d7ad5c
  11:        0x10362893a - cargo::util::queue::Queue::push_bounded::h7b56b7ce7acce761
  12:        0x1036c0470 - cargo::core::compiler::job_queue::JobState::stderr::h382d9befd36f7229
  13:        0x10392726e - cargo::core::compiler::on_stderr_line::h5a0db9e2e6b9f88e
  14:        0x1039c988a - cargo::core::compiler::rustc::{{closure}}::{{closure}}::had17844247424009
  15:        0x103c418c1 - cargo_util::process_builder::ProcessBuilder::exec_with_streaming::{{closure}}::{{closure}}::hd6767f2b856efd8d
  16:        0x103c3960b - cargo_util::read2::imp::read2::ha62124b9033095ba
  17:        0x103c40f14 - cargo_util::process_builder::ProcessBuilder::exec_with_streaming::h60ef7d080ecc11a6
  18:        0x10391c78b - ::exec::h509c01b15eb5a353
  19:        0x1039a836e - core::ops::function::FnOnce::call_once{{vtable.shim}}::hc603d9f174e99086
  20:        0x1039a5881 - core::ops::function::FnOnce::call_once{{vtable.shim}}::ha4f513e6806dc991
  21:        0x1039a5881 - core::ops::function::FnOnce::call_once{{vtable.shim}}::ha4f513e6806dc991
  22:        0x103739532 - core::ops::function::FnOnce::call_once{{vtable.shim}}::hc5c77f1c61817351
  23:        0x1036a43e3 - std::sys_common::backtrace::__rust_begin_short_backtrace::h47796c4d5f4f430e
  24:        0x1036ee18d - core::ops::function::FnOnce::call_once{{vtable.shim}}::hf2d6576490aa894e
  25:        0x103c66a9b - std::sys::unix::thread::Thread::new::thread_start::h26c063646f1d014f
  26:     0x7fff6ff40109 - __pthread_start
thread '' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', src/cargo/util/queue.rs:37:27
stack backtrace:
   0:        0x103c6a5ce - ::fmt::h7dac4b58aa11870a
   1:        0x103caaaee - core::fmt::write::h53badd02f711efbe
   2:        0x103c65c7a - std::io::Write::write_fmt::hd02c4bbaf6463567
   3:        0x103c853df - std::panicking::default_hook::{{closure}}::ha7d22468d4529f02
   4:        0x103c84f6a - std::panicking::default_hook::hc6c5fb91e7ed228a
   5:        0x103c85950 - std::panicking::rust_panic_with_hook::h94fd567d38cd4da7
   6:        0x103c6a945 - std::panicking::begin_panic_handler::{{closure}}::h953a8f32e4882703
   7:        0x103c6a748 - std::sys_common::backtrace::__rust_end_short_backtrace::h8472811b9ff0c597
   8:        0x103c854e3 - _rust_begin_unwind
   9:        0x103d04bff - core::panicking::panic_fmt::h5a271c2839c7a480
  10:        0x103d04f15 - core::result::unwrap_failed::hdc9b54af28d7ad5c
  11:        0x103628734 - cargo::util::queue::Queue::push::hf4c76d68a8b34f4f
  12:        0x10373b09d - core::ptr::drop_in_place::hf8b6a511468ec05f
  13:        0x103739800 - core::ops::function::FnOnce::call_once{{vtable.shim}}::hc5c77f1c61817351
  14:        0x1036a43e3 - std::sys_common::backtrace::__rust_begin_short_backtrace::h47796c4d5f4f430e
  15:        0x1036ee18d - core::ops::function::FnOnce::call_once{{vtable.shim}}::hf2d6576490aa894e
  16:        0x103c66a9b - std::sys::unix::thread::Thread::new::thread_start::h26c063646f1d014f
  17:     0x7fff6ff40109 - __pthread_start
thread panicked while panicking. aborting.

And another one:

Backtrace 2
thread 'rustc' panicked at 'supplied instant is later than self', library/std/src/time.rs:281:48
stack backtrace:
   0:        0x1007a988e - ::fmt::h7dac4b58aa11870a
   1:        0x10084384e - core::fmt::write::h53badd02f711efbe
   2:        0x1007a3aca - std::io::Write::write_fmt::hd02c4bbaf6463567
   3:        0x1007cbebf - std::panicking::default_hook::{{closure}}::ha7d22468d4529f02
   4:        0x1007cba4a - std::panicking::default_hook::hc6c5fb91e7ed228a
   5:        0x103135748 - rustc_driver::report_ice::hddaa632f5d60e0de
   6:        0x1007cc452 - std::panicking::rust_panic_with_hook::h94fd567d38cd4da7
   7:        0x1007aa485 - std::panicking::begin_panic_handler::{{closure}}::h953a8f32e4882703
   8:        0x1007a9a08 - std::sys_common::backtrace::__rust_end_short_backtrace::h8472811b9ff0c597
   9:        0x1007cbfc3 - _rust_begin_unwind
  10:        0x1008568bf - core::panicking::panic_fmt::h5a271c2839c7a480
  11:        0x100856b7a - core::option::expect_failed::h7ae81fcabe446ed2
  12:        0x10079b585 - std::time::Instant::elapsed::h66eaa7e5ce5cd27b
  13:        0x1033ddd76 - rustc_codegen_llvm::base::compile_codegen_unit::hf7f6012ae003f573
  14:        0x103376e34 - rustc_codegen_ssa::base::codegen_crate::h4a39f71ab2586f47
  15:        0x1033a6673 - ::codegen_crate::h049265f985b50098
  16:        0x1032516df - rustc_interface::passes::QueryContext::enter::h397e9c5bcf7ba8fc
  17:        0x103272ce0 - rustc_interface::queries::Queries::ongoing_codegen::h408a077800f099c5
  18:        0x10313f496 - rustc_interface::queries::::enter::h58bca51b0e877876
  19:        0x1031378d1 - rustc_span::with_source_map::hbc85b87c1f294b1d
  20:        0x10314018f - rustc_interface::interface::create_compiler_and_run::h0c3a96672037be70
  21:        0x103162506 - scoped_tls::ScopedKey::set::hf07f944fc712341d
  22:        0x103164619 - std::sys_common::backtrace::__rust_begin_short_backtrace::hacfc6003a415e17f
  23:        0x10316ea2d - core::ops::function::FnOnce::call_once{{vtable.shim}}::hd8bfde75fe9c3c41
  24:        0x1007a5aab - std::sys::unix::thread::Thread::new::thread_start::h26c063646f1d014f
  25:     0x7fff6ff40109 - __pthread_start

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/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.53.0 running on x86_64-apple-darwin

note: compiler flags: -C opt-level=3 -C embed-bitcode=no --crate-type lib

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
error: could not compile crossbeam-utils

@workingjubilee workingjubilee added the A-time Area: Time label Sep 8, 2021
olix0r added a commit to olix0r/hyper that referenced this issue Jan 31, 2022
We have reports of runtime panics (linkerd/linkerd2#7748) that sound a
lot like rust-lang/rust#86470. We don't have any evidence that these
panics originate in hyper, but hyperium#2385 reports a similar issue.

Even though this is almost definitely a bug in Rust, it seems most
prudent to actively avoid the uses of `Instant` that are prone to this
bug.

This change replaces uses of `Instant::elapsed` and `Instant::sub` with
calls to `Instant::saturating_duration_since` to prevent this class of
panic.
olix0r added a commit to tower-rs/tower that referenced this issue Jan 31, 2022
We have reports of runtime panics (linkerd/linkerd2#7748) that sound a
lot like rust-lang/rust#86470. We don't have any evidence that these
panics originate in hyper, but #2385 reports a similar issue.

Even though this is almost definitely a bug in Rust, it seems most
prudent to actively avoid the uses of `Instant` that are prone to this
bug.

This change replaces uses of `Instant::elapsed` and `Instant::sub` with
calls to `Instant::saturating_duration_since` to prevent this class of
panic. These fixes should ultimately be made in the standard library,
but this change lets us avoid this problem while we wait for those
fixes.

See also hyperium/hyper#2746
olix0r added a commit to tower-rs/tower that referenced this issue Jan 31, 2022
We have reports of runtime panics (linkerd/linkerd2#7748) that sound a
lot like rust-lang/rust#86470. We don't have any evidence that these
panics originate in tower, but we have some potentialy flawed `Instant`
arithmetic that could panic in this way.

Even though this is almost definitely a bug in Rust, it seems most
prudent to actively avoid the uses of `Instant` that are prone to this
bug.

This change replaces uses of `Instant::elapsed` and `Instant::sub` with
calls to `Instant::saturating_duration_since` to prevent this class of
panic. These fixes should ultimately be made in the standard library,
but this change lets us avoid this problem while we wait for those
fixes.

See also hyperium/hyper#2746
olix0r added a commit to tower-rs/tower that referenced this issue Jan 31, 2022
We have reports of runtime panics (linkerd/linkerd2#7748) that sound a
lot like rust-lang/rust#86470. We don't have any evidence that these
panics originate in tower, but we have some potentialy flawed `Instant`
arithmetic that could panic in this way.

Even though this is almost definitely a bug in Rust, it seems most
prudent to actively avoid the uses of `Instant` that are prone to this
bug.

This change replaces uses of `Instant::elapsed` and `Instant::sub` with
calls to `Instant::saturating_duration_since` to prevent this class of
panic. These fixes should ultimately be made in the standard library,
but this change lets us avoid this problem while we wait for those
fixes.

See also hyperium/hyper#2746
olix0r added a commit to hyperium/h2 that referenced this issue Jan 31, 2022
We have reports of runtime panics (linkerd/linkerd2#7748) that sound a
lot like rust-lang/rust#86470. We don't have any evidence that these
panics originate in h2, but there is one use of `Instant::sub` that
could panic in this way.

Even though this is almost definitely a bug in Rust, it seems most
prudent to actively avoid the uses of `Instant` that are prone to this
bug. These fixes should ultimately be made in the standard library, but
this change lets us avoid this problem while we wait for those fixes.

This change replaces uses of `Instant::elapsed` and `Instant::sub` with
calls to `Instant::saturating_duration_since` to prevent this class of
panic.

See also hyperium/hyper#2746
seanmonstar pushed a commit to hyperium/h2 that referenced this issue Feb 1, 2022
We have reports of runtime panics (linkerd/linkerd2#7748) that sound a
lot like rust-lang/rust#86470. We don't have any evidence that these
panics originate in h2, but there is one use of `Instant::sub` that
could panic in this way.

Even though this is almost definitely a bug in Rust, it seems most
prudent to actively avoid the uses of `Instant` that are prone to this
bug. These fixes should ultimately be made in the standard library, but
this change lets us avoid this problem while we wait for those fixes.

This change replaces uses of `Instant::elapsed` and `Instant::sub` with
calls to `Instant::saturating_duration_since` to prevent this class of
panic.

See also hyperium/hyper#2746
seanmonstar pushed a commit to tower-rs/tower that referenced this issue Feb 1, 2022
We have reports of runtime panics (linkerd/linkerd2#7748) that sound a
lot like rust-lang/rust#86470. We don't have any evidence that these
panics originate in tower, but we have some potentialy flawed `Instant`
arithmetic that could panic in this way.

Even though this is almost definitely a bug in Rust, it seems most
prudent to actively avoid the uses of `Instant` that are prone to this
bug.

This change replaces uses of `Instant::elapsed` and `Instant::sub` with
calls to `Instant::saturating_duration_since` to prevent this class of
panic. These fixes should ultimately be made in the standard library,
but this change lets us avoid this problem while we wait for those
fixes.

See also hyperium/hyper#2746
olix0r added a commit to tokio-rs/tokio that referenced this issue Feb 1, 2022
`Instant::duration_since`, `Instant::elapsed`, and `Instant::sub` may
panic. This is especially dangerous when `Instant::now` travels back in
time. While this isn't supposed to happen, this behavior is highly
platform-dependent (e.g., rust-lang/rust#86470).

This change modifies the behavior of `tokio::time::Instant` to prevent
this class of panic, as proposed for `std::time::Instant` in
rust-lang/rust#89926.
Darksonn pushed a commit to tokio-rs/tokio that referenced this issue Feb 6, 2022
`Instant::duration_since`, `Instant::elapsed`, and `Instant::sub` may
panic. This is especially dangerous when `Instant::now` travels back in
time. While this isn't supposed to happen, this behavior is highly
platform-dependent (e.g., rust-lang/rust#86470).

This change modifies the behavior of `tokio::time::Instant` to prevent
this class of panic, as proposed for `std::time::Instant` in
rust-lang/rust#89926.
ellenhp pushed a commit to killyourphone/tokio that referenced this issue Feb 6, 2022
`Instant::duration_since`, `Instant::elapsed`, and `Instant::sub` may
panic. This is especially dangerous when `Instant::now` travels back in
time. While this isn't supposed to happen, this behavior is highly
platform-dependent (e.g., rust-lang/rust#86470).

This change modifies the behavior of `tokio::time::Instant` to prevent
this class of panic, as proposed for `std::time::Instant` in
rust-lang/rust#89926.
@bors bors closed this as completed in 92613a2 Feb 13, 2022
@nyetwurk
Copy link

nyetwurk commented Feb 15, 2022

The CLOCK_MONOTONIC clock is not affected by discontinuous
jumps in the system time (e.g., if the system
administrator manually changes the clock), but is affected
by the incremental adjustments performed by adjtime(3) and
NTP.  This clock does not count time that the system is
suspended.  All CLOCK_MONOTONIC variants guarantee that
the time returned by consecutive calls will not go
backwards, but successive calls may—depending on the
architecture—return identical (not-increased) time values.
  1. it seems adjtime(3) can cause slew
  2. "not-increased" presumably is fine, so this is clearly from a kernel bug?
  3. perhaps CLOCK_MONOTONIC_RAW is an alternative?
CLOCK_MONOTONIC_RAW (since Linux 2.6.28; Linux-specific)
              Similar to CLOCK_MONOTONIC, but provides access to a raw
              hardware-based time that is not subject to NTP adjustments
              or the incremental adjustments performed by adjtime(3).
              This clock does not count time that the system is
              suspended.

@episage
Copy link

episage commented Feb 17, 2022

I can consistently reproduce it on a machine running 24/7 for the past month.

rustc --version --verbose

[--snip--]$ rustc --version --verbose
rustc 1.57.0 (f1edd0429 2021-11-29)
binary: rustc
commit-hash: f1edd0429582dd29cccacaf50fd134b05593bd9c
commit-date: 2021-11-29
host: x86_64-unknown-linux-gnu
release: 1.57.0
LLVM version: 13.0.0

cat /etc/os-release

[--snip--]$ cat /etc/os-release
NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2"
HOME_URL="https://amazonlinux.com/"

cat /proc/cpuinfo

[--snip--]$ cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 85
model name      : Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz
stepping        : 4
microcode       : 0x2006b06
cpu MHz         : 2499.998
cache size      : 33792 KB
physical id     : 0
siblings        : 8
core id         : 0
cpu cores       : 4
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves ida arat pku ospke
bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs taa itlb_multihit
bogomips        : 4999.99
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 85
model name      : Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz
stepping        : 4
microcode       : 0x2006b06
cpu MHz         : 2499.998
cache size      : 33792 KB
physical id     : 0
siblings        : 8
core id         : 1
cpu cores       : 4
apicid          : 2
initial apicid  : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves ida arat pku ospke
bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs taa itlb_multihit
bogomips        : 4999.99
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

processor       : 2
vendor_id       : GenuineIntel
cpu family      : 6
model           : 85
model name      : Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz
stepping        : 4
microcode       : 0x2006b06
cpu MHz         : 2499.998
cache size      : 33792 KB
physical id     : 0
siblings        : 8
core id         : 2
cpu cores       : 4
apicid          : 4
initial apicid  : 4
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves ida arat pku ospke
bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs taa itlb_multihit
bogomips        : 4999.99
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

processor       : 3
vendor_id       : GenuineIntel
cpu family      : 6
model           : 85
model name      : Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz
stepping        : 4
microcode       : 0x2006b06
cpu MHz         : 2499.998
cache size      : 33792 KB
physical id     : 0
siblings        : 8
core id         : 3
cpu cores       : 4
apicid          : 6
initial apicid  : 6
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves ida arat pku ospke
bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs taa itlb_multihit
bogomips        : 4999.99
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

processor       : 4
vendor_id       : GenuineIntel
cpu family      : 6
model           : 85
model name      : Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz
stepping        : 4
microcode       : 0x2006b06
cpu MHz         : 2499.998
cache size      : 33792 KB
physical id     : 0
siblings        : 8
core id         : 0
cpu cores       : 4
apicid          : 1
initial apicid  : 1
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves ida arat pku ospke
bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs taa itlb_multihit
bogomips        : 4999.99
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

processor       : 5
vendor_id       : GenuineIntel
cpu family      : 6
model           : 85
model name      : Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz
stepping        : 4
microcode       : 0x2006b06
cpu MHz         : 2499.998
cache size      : 33792 KB
physical id     : 0
siblings        : 8
core id         : 1
cpu cores       : 4
apicid          : 3
initial apicid  : 3
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves ida arat pku ospke
bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs taa itlb_multihit
bogomips        : 4999.99
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

processor       : 6
vendor_id       : GenuineIntel
cpu family      : 6
model           : 85
model name      : Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz
stepping        : 4
microcode       : 0x2006b06
cpu MHz         : 2499.998
cache size      : 33792 KB
physical id     : 0
siblings        : 8
core id         : 2
cpu cores       : 4
apicid          : 5
initial apicid  : 5
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves ida arat pku ospke
bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs taa itlb_multihit
bogomips        : 4999.99
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

processor       : 7
vendor_id       : GenuineIntel
cpu family      : 6
model           : 85
model name      : Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz
stepping        : 4
microcode       : 0x2006b06
cpu MHz         : 2499.998
cache size      : 33792 KB
physical id     : 0
siblings        : 8
core id         : 3
cpu cores       : 4
apicid          : 7
initial apicid  : 7
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves ida arat pku ospke
bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs taa itlb_multihit
bogomips        : 4999.99
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

cat /sys/devices/system/clocksource/clocksource0/current_clocksource

[--snip--]$ cat /sys/devices/system/clocksource/clocksource0/current_clocksource
tsc

uname -rv

[--snip--]$ uname -rv
5.10.82-83.359.amzn2.x86_64 #1 SMP Tue Nov 30 20:47:14 UTC 2021

See the stacktrace for the cargo build --release:

[--snip--]$ export RUST_BACKTRACE=full
[--snip--]$ cargo build --release
thread 'main' panicked at 'supplied instant is later than self', library/std/src/time.rs:311:48
stack backtrace:
   0:     0x559af5b0ca0c - std::backtrace_rs::backtrace::libunwind::trace::hf6a6dfd7da937cb0
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
   1:     0x559af5b0ca0c - std::backtrace_rs::backtrace::trace_unsynchronized::hc596a19e4891f7f3
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x559af5b0ca0c - std::sys_common::backtrace::_print_fmt::hb16700db31584325
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x559af5b0ca0c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h231c4190cfa75162
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x559af5b35ecc - core::fmt::write::h2a1462b5f8eea807
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/fmt/mod.rs:1163:17
   5:     0x559af5b038c5 - std::io::Write::write_fmt::h71ddfebc68685972
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/io/mod.rs:1696:15
   6:     0x559af5b0f1d0 - std::sys_common::backtrace::_print::hcc197d4bebf2b369
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x559af5b0f1d0 - std::sys_common::backtrace::print::h335a66af06738c7c
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x559af5b0f1d0 - std::panicking::default_hook::{{closure}}::h6fac9ac9c8b79e52
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:210:50
   9:     0x559af5b0ed85 - std::panicking::default_hook::h341c1030c6a1161b
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:227:9
  10:     0x559af5b0f884 - std::panicking::rust_panic_with_hook::h50680ff4b44510c6
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:624:17
  11:     0x559af5b0f360 - std::panicking::begin_panic_handler::{{closure}}::h9371c0fbb1e8465a
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:521:13
  12:     0x559af5b0ceb4 - std::sys_common::backtrace::__rust_end_short_backtrace::h9b3efa22a5768c0f
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/sys_common/backtrace.rs:139:18
  13:     0x559af5b0f2c9 - rust_begin_unwind
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:517:5
  14:     0x559af5179941 - core::panicking::panic_fmt::h23b9203e89cc61cf
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/panicking.rs:100:14
  15:     0x559af5b34091 - core::panicking::panic_display::h0b2b4cc4e8e79e2e
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/panicking.rs:64:5
  16:     0x559af517983b - core::option::expect_failed::h111c62e88059319b
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/option.rs:1638:5
  17:     0x559af5b0beab - core::option::Option<T>::expect::hc706a79e52c15325
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/option.rs:709:21
  18:     0x559af5b0beab - std::time::Instant::duration_since::hb291e035d51e9a9f
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/time.rs:311:9
  19:     0x559af5b0beab - <std::time::Instant as core::ops::arith::Sub>::sub::h1895890ba2463a9a
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/time.rs:436:9
  20:     0x559af5b0beab - std::time::Instant::elapsed::he89b003a6bece5e1
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/time.rs:375:9
  21:     0x559af558f22a - cargo::core::resolver::activate::he3073cf48b38292d
  22:     0x559af558c47d - cargo::core::resolver::activate_deps_loop::h30f2ed39d81e30b1
  23:     0x559af5588c27 - cargo::core::resolver::resolve::ha4518cd4a67a1003
  24:     0x559af5601c12 - cargo::ops::resolve::resolve_with_previous::h0569bc1629ee2886
  25:     0x559af55ff17d - cargo::ops::resolve::resolve_with_registry::ha8c1db2d89dabd63
  26:     0x559af55fde93 - cargo::ops::resolve::resolve_ws_with_opts::h54d7552e5eb48a42
  27:     0x559af5546b7e - cargo::ops::cargo_compile::create_bcx::he669e2bf2a090bf8
  28:     0x559af5545dae - cargo::ops::cargo_compile::compile_ws::h1d30b9665da49d50
  29:     0x559af5545ce6 - cargo::ops::cargo_compile::compile::h2fa80f04f6323616
  30:     0x559af51ec1c1 - cargo::commands::build::exec::h97328af9497e368f
  31:     0x559af51ab13f - cargo::cli::main::hd285ea351ad27140
  32:     0x559af51edab4 - cargo::main::h8ccca51d449430d5
  33:     0x559af51c2ba3 - std::sys_common::backtrace::__rust_begin_short_backtrace::h0157dc230135dd33
  34:     0x559af51e5549 - std::rt::lang_start::{{closure}}::h7f7be114acd6d212
  35:     0x559af5b0c6eb - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::hc56adab7a77ec6e3
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/ops/function.rs:259:13
  36:     0x559af5b0c6eb - std::panicking::try::do_call::h29f013120c5abc65
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:403:40
  37:     0x559af5b0c6eb - std::panicking::try::h86d5b2b66caec4cf
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:367:19
  38:     0x559af5b0c6eb - std::panic::catch_unwind::h7dd136d787f51397
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panic.rs:133:14
  39:     0x559af5b0c6eb - std::rt::lang_start_internal::{{closure}}::h4a199351e630a8a5
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/rt.rs:128:48
  40:     0x559af5b0c6eb - std::panicking::try::do_call::h20ceb9e5dff838c6
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:403:40
  41:     0x559af5b0c6eb - std::panicking::try::hc2abb46a5e41bd43
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:367:19
  42:     0x559af5b0c6eb - std::panic::catch_unwind::h52c3eb4408ad6dfb
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panic.rs:133:14
  43:     0x559af5b0c6eb - std::rt::lang_start_internal::hd15a47be08101c28
                               at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/rt.rs:128:20
  44:     0x559af51efd22 - main
  45:     0x7f3a01cd413a - __libc_start_main
  46:     0x559af517a161 - <unknown>

@the8472
Copy link
Member

the8472 commented Feb 17, 2022

#89926 landed recently, nightlies and 1.60 onwards will no longer panic in this situation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-time Area: Time C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants