Skip to content

thread 'rustc' panicked at 'failed to lookup SourceFile in new context' #71380

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
gendx opened this issue Apr 21, 2020 · 2 comments
Closed

thread 'rustc' panicked at 'failed to lookup SourceFile in new context' #71380

gendx opened this issue Apr 21, 2020 · 2 comments
Labels
A-incr-comp Area: Incremental compilation C-bug Category: This is a bug. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example 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

@gendx
Copy link

gendx commented Apr 21, 2020

This seems like a problem with the build cache. Clearing it with cargo clean fixed the issue.

Code

Not sure it matters, but this is compiling the following crate: https://github.com/tock/tock/tree/master/chips/nrf52840.

Meta

rustc --version --verbose:

$ rustc --version --verbose
rustc 1.44.0-nightly (20fc02f83 2020-04-20)
binary: rustc
commit-hash: 20fc02f836f3035b86b56a7cedb97c5cd4ed9612
commit-date: 2020-04-20
host: x86_64-unknown-linux-gnu
release: 1.44.0-nightly
LLVM version: 9.0

Error output

thread 'rustc' panicked at 'failed to lookup `SourceFile` in new context', src/librustc_middle/ty/query/on_disk_cache.rs:456:17
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/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.44.0-nightly (20fc02f83 2020-04-20) running on x86_64-unknown-linux-gnu

note: compiler flags: -C opt-level=z -C debuginfo=2 -C debug-assertions=on -C incremental --crate-type lib

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

stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.heygears.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.heygears.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:78
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:59
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1069
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1504
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:62
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:198
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:218
  10: rustc_driver::report_ice
  11: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:515
  12: rust_begin_unwind
             at src/libstd/panicking.rs:419
  13: core::panicking::panic_fmt
             at src/libcore/panicking.rs:111
  14: core::option::expect_failed
             at src/libcore/option.rs:1260
  15: <rustc_middle::ty::query::on_disk_cache::CacheDecoder as serialize::serialize::SpecializedDecoder<rustc_span::span_encoding::Span>>::specialized_decode
  16: <(T10,T11) as serialize::serialize::Decodable>::decode
  17: <rustc_middle::ty::query::on_disk_cache::CacheDecoder as serialize::serialize::SpecializedDecoder<rustc_span::span_encoding::Span>>::specialized_decode
  18: serialize::serialize::Decoder::read_option
  19: <rustc_middle::ty::Generics as serialize::serialize::Decodable>::decode
  20: rustc_middle::ty::query::on_disk_cache::OnDiskCache::try_load_query_result
  21: rustc_query_system::query::plumbing::get_query
  22: rustc_typeck::variance::terms::TermsContext::add_inferreds_for_item
  23: rustc_typeck::variance::terms::determine_parameters_to_be_inferred
  24: rustc_typeck::variance::crate_variances
  25: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  26: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  27: rustc_query_system::query::plumbing::force_query
  28: rustc_middle::ty::query::force_from_dep_node
  29: rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green
  30: rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green
  31: rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_green_and_read
  32: rustc_query_system::query::plumbing::ensure_query
  33: rustc_data_structures::sync::par_for_each_in
  34: rustc_hir::hir::Crate::par_visit_all_item_likes
  35: rustc_session::session::Session::track_errors
  36: rustc_typeck::check_crate
  37: rustc_interface::passes::analysis
  38: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute
  39: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  40: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  41: rustc_query_system::query::plumbing::get_query
  42: rustc_middle::ty::context::tls::enter_global
  43: rustc_interface::interface::run_compiler_in_existing_thread_pool
  44: scoped_tls::ScopedKey<T>::set
  45: rustc_ast::attr::with_globals

@gendx gendx 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 Apr 21, 2020
@jonas-schievink jonas-schievink added A-incr-comp Area: Incremental compilation E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example labels Apr 21, 2020
@gendx
Copy link
Author

gendx commented Apr 21, 2020

Other instance of this ICE (same project, but different crate): https://travis-ci.org/github/tock/tock/builds/677725676

@jonas-schievink
Copy link
Contributor

duplicate of #70924

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-incr-comp Area: Incremental compilation C-bug Category: This is a bug. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example 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

No branches or pull requests

2 participants