Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

'Forcing query with already existing DepNode' panic on new nightly #1032

Closed
sfackler opened this issue Aug 31, 2018 · 3 comments
Closed

'Forcing query with already existing DepNode' panic on new nightly #1032

sfackler opened this issue Aug 31, 2018 · 3 comments
Labels
Milestone

Comments

@sfackler
Copy link
Member

This panic has appeared in the newest nightly while working on a large internal project:

thread '<unnamed>' panicked at 'Forcing query with already existing DepNode.
- query-key: Canonical { variables: [], value: ParamEnvAnd { param_env: ParamEnv { caller_bounds: [Binder(ProjectionPredicate(ProjectionTy { substs: [F, ()], item_def_id: DefId(2/0:963 ~ core[b8a9]::ops[0]::function[0]::FnOnce[0]::Output[0]) }, std::result::Result<T, boulder::Error>)), Binder(TraitPredicate(<F as std::ops::FnMut<()>>)), Binder(TraitPredicate(<F as std::ops::FnOnce<()>>)), Binder(TraitPredicate(<F as std::marker::Sized>)), Binder(TraitPredicate(<T as std::marker::Sized>))], reveal: UserFacing }, value: Binder(TraitPredicate(<zipkin::Tracer as std::ops::Deref>)) } }
- dep-node: EvaluateObligation(3e57807fef32ab60-eb2f2133b87e6308)', librustc/ty/query/plumbing.rs:531:9
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
   1: std::sys_common::backtrace::print
   2: std::panicking::default_hook::{{closure}}
   3: std::panicking::default_hook
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
   6: std::panicking::continue_panic_fmt
   7: std::panicking::begin_panic_fmt
   8: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
   9: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
  10: rustc::traits::query::evaluate_obligation::<impl rustc::infer::InferCtxt<'cx, 'gcx, 'tcx>>::evaluate_obligation
  11: rustc::traits::query::evaluate_obligation::<impl rustc::infer::InferCtxt<'cx, 'gcx, 'tcx>>::predicate_may_hold
  12: <rustc_typeck::check::autoderef::Autoderef<'a, 'gcx, 'tcx> as core::iter::iterator::Iterator>::next
  13: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T, I>>::from_iter
  14: rustc_typeck::check::method::probe::<impl rustc_typeck::check::FnCtxt<'a, 'gcx, 'tcx>>::create_steps
  15: rustc_typeck::check::method::probe::<impl rustc_typeck::check::FnCtxt<'a, 'gcx, 'tcx>>::probe_for_name
  16: rustc_typeck::check::FnCtxt::check_expr_kind
  17: rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_needs
  18: rustc_typeck::check::FnCtxt::check_expr_kind
  19: rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_needs
  20: rustc_typeck::check::FnCtxt::check_decl_local
  21: rustc_typeck::check::FnCtxt::check_block_with_expected
  22: rustc_typeck::check::FnCtxt::check_expr_kind
  23: rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_needs
  24: rustc_typeck::check::FnCtxt::check_expr_kind
  25: rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_needs
  26: rustc_typeck::check::FnCtxt::check_block_with_expected
  27: rustc_typeck::check::FnCtxt::check_expr_kind
  28: rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_needs
  29: rustc_typeck::check::FnCtxt::check_expr_meets_expectation_or_error
  30: rustc_typeck::check::FnCtxt::check_block_with_expected
  31: rustc_typeck::check::FnCtxt::check_expr_kind
  32: rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_needs
  33: rustc_typeck::check::FnCtxt::check_expr_kind
  34: rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_needs
  35: rustc_typeck::check::FnCtxt::check_decl_local
  36: rustc_typeck::check::FnCtxt::check_block_with_expected
  37: rustc_typeck::check::FnCtxt::check_expr_kind
  38: rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_needs
  39: rustc_typeck::check::FnCtxt::check_expr_meets_expectation_or_error
  40: rustc_typeck::check::FnCtxt::check_block_with_expected
  41: rustc_typeck::check::FnCtxt::check_expr_kind
  42: rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_needs
  43: rustc_typeck::check::FnCtxt::check_return_expr
  44: rustc_typeck::check::check_fn
  45: rustc::ty::context::tls::with_related_context
  46: rustc::infer::InferCtxtBuilder::enter
  47: rustc_typeck::check::typeck_tables_of
  48: rustc::ty::query::__query_compute::typeck_tables_of
  49: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::typeck_tables_of<'tcx>>::compute
  50: rustc::ty::context::tls::with_context
  51: rustc::dep_graph::graph::DepGraph::with_task_impl
  52: <rustc::ty::query::plumbing::JobOwner<'a, 'tcx, Q>>::start
  53: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
  54: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
  55: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::ensure_query
  56: rustc_typeck::check::typeck_item_bodies
  57: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::typeck_item_bodies<'tcx>>::compute
  58: rustc::ty::context::tls::with_context
  59: rustc::dep_graph::graph::DepGraph::with_task_impl
  60: <rustc::ty::query::plumbing::JobOwner<'a, 'tcx, Q>>::start
  61: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
  62: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
  63: rustc::util::common::time
  64: rustc_typeck::check_crate
  65: rustc::ty::context::tls::enter_context
  66: <std::thread::local::LocalKey<T>>::with
  67: rustc::ty::context::TyCtxt::create_and_enter
  68: rustc_driver::driver::compile_input
  69: rustc_driver::run_compiler_with_pool
  70: <scoped_tls::ScopedKey<T>>::set
  71: rustc_driver::run_compiler
  72: <scoped_tls::ScopedKey<T>>::set
  73: syntax::with_globals
  74: std::panicking::try::do_call
  75: __rust_maybe_catch_panic
  76: rustc_driver::run
  77: std::panicking::try::do_call
  78: __rust_maybe_catch_panic
  79: rls::build::rustc::rustc
  80: rls::build::plan::JobQueue::execute
  81: rls::build::BuildQueue::run_thread
query stack during panic:
end of query stack

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.30.0-nightly (f8d34596f 2018-08-30) running on x86_64-apple-darwin
@sfackler sfackler changed the title 'Forcing query with already existing DepNode' on new nightly 'Forcing query with already existing DepNode' panic on new nightly Aug 31, 2018
@nrc nrc added this to the Edition RC1 milestone Sep 4, 2018
@nrc nrc added the bug label Sep 12, 2018
@nrc
Copy link
Member

nrc commented Sep 12, 2018

cc @michaelwoerister do you know what is going on here?

@michaelwoerister
Copy link
Member

It usually means that two distinct query keys map to the same DepNode. There should be a one to one mapping between query keys and their corresponding DepNode. The DepNode for complex keys like this is created by hashing the value of the key. Problems arise if something in the key is not hashed properly.

@nikomatsakis or @eddyb might know more about what could be wrong with the hashing of this particular query key (or might know who knows best).

@nrc
Copy link
Member

nrc commented Oct 25, 2018

dup of #999

@nrc nrc closed this as completed Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants