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

rustc panicked at Box<Any> #6592

Closed
tobin-crypto opened this issue Jan 15, 2021 · 4 comments
Closed

rustc panicked at Box<Any> #6592

tobin-crypto opened this issue Jan 15, 2021 · 4 comments
Labels
I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@tobin-crypto
Copy link

Reporting this because its requested in the error output, I do not know what to make of it and cannot reproduce it locally (CI runs on Azure). A second run of CI jobs did not hit this same error. This is the output, please feel free to just close this issue if this is not useful. Thanks for your work on Clippy, I use this tool all day every day :)

cargo +nightly clippy -Zunstable-options
  cargo +nightly clippy -Zunstable-options
  shell: /bin/bash -e {0}
  env:
    RUSTC_WRAPPER: /home/azureuser/.cargo/bin/sccache
    SSH_AUTH_SOCK: /tmp/ssh-lXe0OO2kTAaT/agent.8976
    SSH_AGENT_PID: 8977
    Checking untrusted v0.1.0 (/home/azureuser/runners/actions-runner/_work/sgx-comm/sgx-comm/untrusted)
error: internal compiler error: compiler/rustc_metadata/src/rmeta/decoder.rs:1189:17: get_optimized_mir: missing MIR for `DefId(41:7238 ~ tokio[4eeb]::sync::mutex::{impl#6}::lock::{closure#0})`

thread 'rustc' panicked at 'Box<Any>', compiler/rustc_errors/src/lib.rs:958:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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

note: we would appreciate a bug report: https://github.com/rust-lang/rust-clippy/issues/new

note: Clippy version: clippy 0.1.51 (a62a760 2021-01-13)

query stack during panic:
#0 [optimized_mir] optimizing MIR for `tokio::sync::Mutex::<T>::lock::{closure#0}`
#1 [layout_raw] computing layout of `[static generator@tokio::sync::Mutex<bool>::lock::{closure#0} for<'r, 's> {std::future::ResumeTy, &'r tokio::sync::Mutex<bool>, impl futures::Future, ()}]`
end of query stack
error: aborting due to previous error

error: could not compile `untrusted`

To learn more, run the command again with --verbose.
Error: Process completed with exit code 101.
@HCastano
Copy link

I'm also running into something similar.

My toolchain:

❯ rustc +nightly -V
rustc 1.51.0-nightly (c97f11af7 2021-01-10)

❯ cargo +nightly clippy -V
clippy 0.1.51 (c97f11af 2021-01-10)

To reproduce:

git clone https://github.com/paritytech/parity-bridges-common.git
cd relays/header-relay
RUST_BACKTRACE=1 cargo +nightly clippy

The error output:

❯ RUST_BACKTRACE=1 cargo +nightly clippy
    Checking headers-relay v0.1.0 (/Users/hcastano/Workspace/parity-tech/parity-bridges-common/relays/headers-relay)
error: internal compiler error: compiler/rustc_traits/src/normalize_erasing_regions.rs:43:32: could not fully normalize `std::collections::HashMap<<P as sync_types::HeadersSyncPipeline>::Hash, sync_types::QueuedHeader<P>>`

thread 'rustc' panicked at 'Box<Any>', compiler/rustc_errors/src/lib.rs:958:9
stack backtrace:
   0: std::panicking::begin_panic
   1: rustc_errors::HandlerInner::bug
   2: rustc_errors::Handler::bug
   3: rustc_middle::util::bug::opt_span_bug_fmt::{{closure}}
   4: rustc_middle::ty::context::tls::with_opt::{{closure}}
   5: rustc_middle::ty::context::tls::with_opt
   6: rustc_middle::util::bug::opt_span_bug_fmt
   7: rustc_middle::util::bug::bug_fmt
   8: rustc_infer::infer::InferCtxtBuilder::enter
   9: rustc_traits::normalize_erasing_regions::normalize_generic_arg_after_erasing_regions
  10: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  11: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  12: rustc_data_structures::stack::ensure_sufficient_stack
  13: rustc_query_system::query::plumbing::force_query_with_job
  14: rustc_query_system::query::plumbing::get_query_impl
  15: rustc_middle::ty::normalize_erasing_regions::<impl rustc_middle::ty::context::TyCtxt>::normalize_erasing_regions
  16: <rustc_middle::ty::layout::LayoutCx<rustc_middle::ty::context::TyCtxt> as rustc_target::abi::LayoutOf>::layout_of
  17: <rustc_lint::context::LateContext as rustc_target::abi::LayoutOf>::layout_of
  18: <clippy_lints::zero_sized_map_values::ZeroSizedMapValues as rustc_lint::passes::LateLintPass>::check_ty
  19: <rustc_lint::late::LateLintPassObjects as rustc_lint::passes::LateLintPass>::check_ty
  20: rustc_hir::intravisit::walk_item
  21: rustc_hir::intravisit::Visitor::visit_nested_item
  22: rustc_hir::intravisit::walk_item
  23: rustc_hir::intravisit::Visitor::visit_nested_item
  24: rustc_hir::intravisit::walk_crate
  25: rustc_lint::late::late_lint_pass_crate
  26: rustc_session::utils::<impl rustc_session::session::Session>::time
  27: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
  28: rustc_session::utils::<impl rustc_session::session::Session>::time
  29: rustc_interface::passes::analysis
  30: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute
  31: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  32: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  33: rustc_data_structures::stack::ensure_sufficient_stack
  34: rustc_query_system::query::plumbing::force_query_with_job
  35: rustc_query_system::query::plumbing::get_query_impl
  36: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  37: rustc_span::with_source_map
  38: rustc_interface::interface::create_compiler_and_run
  39: rustc_span::with_session_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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

note: we would appreciate a bug report: https://github.com/rust-lang/rust-clippy/issues/new

note: Clippy version: clippy 0.1.51 (c97f11af 2021-01-10)

query stack during panic:
#0 [normalize_generic_arg_after_erasing_regions] normalizing `std::collections::HashMap<<P as sync_types::HeadersSyncPipeline>::Hash, sync_types::QueuedHeader<P>>`
#1 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error

error: could not compile `headers-relay`

If I run Clippy with the following nightly everything compiles fine.

❯ rustc +nightly-2020-12-17 -V
rustc 1.50.0-nightly (b32e6e6ac 2020-12-16)

❯ cargo +nightly-2020-12-17 clippy -V
clippy 0.0.212 (b32e6e6a 2020-12-16)

P.S I also appreciate all your work on Clippy, it really is a great tool!

@ThibsG
Copy link
Contributor

ThibsG commented Jan 15, 2021

@rustbot label +L-crash

@rustbot rustbot added the I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️ label Jan 15, 2021
@giraffate
Copy link
Contributor

Thanks for your reports!

It seems to be a duplicate of #6539.

@giraffate
Copy link
Contributor

It seems to be fixed by #6582, so I'm closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

5 participants