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

unexpected panic while compiling firefox on arm64 #49281

Closed
khumarahn opened this issue Mar 22, 2018 · 1 comment
Closed

unexpected panic while compiling firefox on arm64 #49281

khumarahn opened this issue Mar 22, 2018 · 1 comment
Labels
C-bug Category: This is a bug. O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@khumarahn
Copy link

khumarahn commented Mar 22, 2018

Hi, I see this strange error while trying to compile firefox-59.0.1 with rust-1.23 on arm64 laptop running gentoo linux. It says, my bug report would be appreciated. I'd also appreciate any feedback.

I would be happy to provide any additional information.

   Compiling quote v0.3.15
   Compiling peeking_take_while v0.1.2
   Compiling glob v0.2.11
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.23.0-dev running on aarch64-unknown-linux-gnu

note: run with `RUST_BACKTRACE=1` for a backtrace

thread 'rustc' panicked at 'other was less than the current instant', src/libstd/sys/unix/time.rs:284:16
stack backtrace:
   0:       0x7f9e7de973 - rust_metadata_std_5958eddae63d6947e0733521fc5435ed
   1:       0x7f9e7da9d7 - rust_metadata_std_5958eddae63d6947e0733521fc5435ed
   2:       0x7f9e7e9f3f - rust_metadata_std_5958eddae63d6947e0733521fc5435ed
   3:       0x7f9e7e9c4f - rust_metadata_std_5958eddae63d6947e0733521fc5435ed
   4:       0x7f9e7ea443 - std::panicking::rust_panic_with_hook::h22b280fc4fc0de87
   5:       0x7f9e7ea303 - rust_metadata_std_5958eddae63d6947e0733521fc5435ed
   6:       0x7f9e7d9eb7 - std::time::Instant::elapsed::hf802fe319eded9b8
   7:       0x7f9da24283 - <unknown>
   8:       0x7f9da4965b - <unknown>
   9:       0x7f9cd3199b - rust_metadata_rustc_3ea30897d9dddf7b5fa3a6c2523637e7
  10:       0x7f9cf028f7 - rust_metadata_rustc_3ea30897d9dddf7b5fa3a6c2523637e7
  11:       0x7f9cc1cd2b - rust_metadata_rustc_3ea30897d9dddf7b5fa3a6c2523637e7
  12:       0x7f9d09b153 - <unknown>
  13:       0x7f9cd31a33 - rust_metadata_rustc_3ea30897d9dddf7b5fa3a6c2523637e7
  14:       0x7f9cd320ff - rustc::ty::maps::<impl rustc::ty::maps::queries::symbol_name<'tcx>>::try_get::hf71dec19792cb774
  15:       0x7f9ce83073 - rustc::ty::maps::TyCtxtAt::symbol_name::hf81eb960dfd03136
  16:       0x7f9d0ae4f3 - rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::symbol_name::hd40df66149759931
  17:       0x7f9d984003 - <unknown>
  18:       0x7f9d9609c7 - <unknown>
  19:       0x7f9d984fc3 - <unknown>
  20:       0x7f9cd7a433 - rust_metadata_rustc_3ea30897d9dddf7b5fa3a6c2523637e7
  21:       0x7f9cf0ad07 - rust_metadata_rustc_3ea30897d9dddf7b5fa3a6c2523637e7
  22:       0x7f9cc1e81b - rust_metadata_rustc_3ea30897d9dddf7b5fa3a6c2523637e7
  23:       0x7f9d081dbb - <unknown>
  24:       0x7f9cd7a4af - rust_metadata_rustc_3ea30897d9dddf7b5fa3a6c2523637e7
  25:       0x7f9cd7a9df - rustc::ty::maps::<impl rustc::ty::maps::queries::exported_symbols<'tcx>>::try_get::h7cd7159316d987b4
  26:       0x7f9ce870e3 - rustc::ty::maps::TyCtxtAt::exported_symbols::h35b6eb150f9aa7b2
  27:       0x7f9d0af0df - rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::exported_symbols::h69dd1a8087b4ddb7
  28:       0x7f9da0be0f - <unknown>
  29:       0x7f9da0b253 - rustc_trans::back::write::start_async_translation::hd810efc5779dac71
  30:       0x7f9da4ea93 - rustc_trans::base::trans_crate::h1ab479cd2e56d359
  31:       0x7f9d9f930f - <rustc_trans::LlvmTransCrate as rustc_trans_utils::trans_crate::TransCrate>::trans_crate::hf0c11cb959ccfc0e
  32:       0x7f9e9b987f - <unknown>
  33:       0x7f9e949f1b - <unknown>
  34:       0x7f9e9a949f - <unknown>
  35:       0x7f9e9a1967 - <unknown>
  36:       0x7f9e99ed5f - <unknown>
  37:       0x7f9e910633 - <unknown>
  38:       0x7f9e9462ff - rustc_driver::driver::compile_input::h10487c1bd068aca0
  39:       0x7f9e9952bb - rustc_driver::run_compiler::h90c48c1cfea93e36
  40:       0x7f9e92682b - <unknown>
  41:       0x7f9e7f5d17 - __rust_maybe_catch_panic
  42:       0x7f9e988733 - <unknown>
  43:       0x7f9e7e8e6f - rust_metadata_std_5958eddae63d6947e0733521fc5435ed
  44:       0x7f9c3f25bb - <unknown>

error: Could not compile `glob`.
warning: build failed, waiting for other jobs to finish...
error: build failed
gmake[4]: *** [/var/tmp/portage/www-client/firefox-59.0.1/work/mozilla-release-3db9e3d52b17563efca181ccbb50deb8660c59ae/config/rules.mk:972: force-cargo-library-build] Error 101
gmake[3]: *** [/var/tmp/portage/www-client/firefox-59.0.1/work/mozilla-release-3db9e3d52b17563efca181ccbb50deb8660c59ae/config/recurse.mk:73: toolkit/library/rust/target] Error 2
gmake[2]: *** [/var/tmp/portage/www-client/firefox-59.0.1/work/mozilla-release-3db9e3d52b17563efca181ccbb50deb8660c59ae/config/recurse.mk:33: compile] Error 2
gmake[1]: *** [/var/tmp/portage/www-client/firefox-59.0.1/work/mozilla-release-3db9e3d52b17563efca181ccbb50deb8660c59ae/config/rules.mk:434: default] Error 2
gmake: *** [client.mk:168: build] Error 2
0 compiler warnings present.
@cuviper
Copy link
Member

cuviper commented Mar 22, 2018

thread 'rustc' panicked at 'other was less than the current instant', src/libstd/sys/unix/time.rs:284:16

I sometimes get messages like this on s390x too, and usually it will pass if I try again. I haven't looked into it, but if this code insists on monotonicity, it may need to use a different clock source.

@cuviper cuviper added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels Mar 24, 2018
@sanxiyn sanxiyn added the O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state label Aug 12, 2018
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
AGSaidi added a commit to AGSaidi/rust that referenced this issue Sep 4, 2021
While issues have been seen on arm64 platforms the Arm architecture requires
that the counter monotonically increases and that it must provide a uniform
view of system time (e.g. it must not be possible for a core to receive a
message from another core with a time stamp and observe time going backwards
(ARM DDI 0487G.b D11.1.2). While there have been a few 64bit SoCs that have
bugs (rust-lang#49281, rust-lang#56940) which cause time to not monotonically increase, these have
been fixed in the Linux kernel and we shouldn't penalize all Arm SoCs for those
who refuse to update their kernels:
SUN50I_ERRATUM_UNKNOWN1 - Allwinner A64 / Pine A64 - fixed in 5.1
FSL_ERRATUM_A008585 - Freescale LS2080A/LS1043A - fixed in 4.10
HISILICON_ERRATUM_161010101 - Hisilicon 1610 - fixed in 4.11
ARM64_ERRATUM_858921 - Cortex A73 - fixed in 4.12

255a3f3 std: Force `Instant::now()` to be monotonic added a mutex to work around
this problem and a small test program using glommio shows the majority of time spent
acquiring and releasing this Mutex. 3914a7b tries to improve this, but actually
makes it worse on big systems as for 128b atomics a ldxp/stxp pair (and
successful loop) is required which is expensive as a lock and because of how
the load/store-exclusives scale on large Arm systems is both unfair to threads
and tends to go backwards in performance.
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Oct 16, 2021
…ually-monotonic, r=yaahc

linux/aarch64 Now() should be actually_monotonic()

While issues have been seen on arm64 platforms the Arm architecture requires
that the counter monotonically increases and that it must provide a uniform
view of system time (e.g. it must not be possible for a core to receive a
message from another core with a time stamp and observe time going backwards
(ARM DDI 0487G.b D11.1.2). While there have been a few 64bit SoCs that have
bugs (rust-lang#49281, rust-lang#56940) which cause time to not monotonically increase, these have
been fixed in the Linux kernel and we shouldn't penalize all Arm SoCs for those
who refuse to update their kernels:
SUN50I_ERRATUM_UNKNOWN1 - Allwinner A64 / Pine A64 - fixed in 5.1
FSL_ERRATUM_A008585 - Freescale LS2080A/LS1043A - fixed in 4.10
HISILICON_ERRATUM_161010101 - Hisilicon 1610 - fixed in 4.11
ARM64_ERRATUM_858921 - Cortex A73 - fixed in 4.12

255a3f3 std: Force `Instant::now()` to be monotonic added a Mutex to work around
this problem and a small test program using glommio shows the majority of time spent
acquiring and releasing this Mutex. 3914a7b tries to improve this, but actually
makes it worse on big systems as for 128b atomics a ldxp/stxp pair (and successful loop)
for v8.4 systems that don't support FEAT_LSE2 is required which is expensive as a lock
and because of how the load/store-exclusives scale on large Arm systems is both unfair
to threads and tends to go backwards in performance.

A small sample program using glommio improves by 70x on a 32 core Graviton2
system with this change.
bors added a commit to rust-lang-ci/rust that referenced this issue Oct 17, 2021
…lly-monotonic, r=yaahc

linux/aarch64 Now() should be actually_monotonic()

While issues have been seen on arm64 platforms the Arm architecture requires
that the counter monotonically increases and that it must provide a uniform
view of system time (e.g. it must not be possible for a core to receive a
message from another core with a time stamp and observe time going backwards
(ARM DDI 0487G.b D11.1.2). While there have been a few 64bit SoCs that have
bugs (rust-lang#49281, rust-lang#56940) which cause time to not monotonically increase, these have
been fixed in the Linux kernel and we shouldn't penalize all Arm SoCs for those
who refuse to update their kernels:
SUN50I_ERRATUM_UNKNOWN1 - Allwinner A64 / Pine A64 - fixed in 5.1
FSL_ERRATUM_A008585 - Freescale LS2080A/LS1043A - fixed in 4.10
HISILICON_ERRATUM_161010101 - Hisilicon 1610 - fixed in 4.11
ARM64_ERRATUM_858921 - Cortex A73 - fixed in 4.12

255a3f3 std: Force `Instant::now()` to be monotonic added a Mutex to work around
this problem and a small test program using glommio shows the majority of time spent
acquiring and releasing this Mutex. 3914a7b tries to improve this, but actually
makes it worse on big systems as for 128b atomics a ldxp/stxp pair (and successful loop)
for v8.4 systems that don't support FEAT_LSE2 is required which is expensive as a lock
and because of how the load/store-exclusives scale on large Arm systems is both unfair
to threads and tends to go backwards in performance.

A small sample program using glommio improves by 70x on a 32 core Graviton2
system with this change.
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. O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants