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

failed to lookup SourceFile in new context #92163

Closed
Mark-Simulacrum opened this issue Dec 21, 2021 · 17 comments · Fixed by #92175
Closed

failed to lookup SourceFile in new context #92163

Mark-Simulacrum opened this issue Dec 21, 2021 · 17 comments · Fixed by #92175
Labels
A-incr-comp Area: Incremental compilation I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-critical Critical priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Milestone

Comments

@Mark-Simulacrum
Copy link
Member

84f962a (based on bisection) made rustc-perf's CI start failing on the webrender-wrench benchmark, with this error. Not sure what is making rustc-perf special here, but it's also failing on the collector.

thread 'rustc' panicked at 'failed to lookup `SourceFile` in new context', compiler/rustc_query_impl/src/on_disk_cache.rs:500:22
stack backtrace:
   0: rust_begin_unwind
             at /rustc/84f962a89bac3948ed116f1ad04c2f4793fb69ea/library/std/src/panicking.rs:498:5
   1: core::panicking::panic_fmt
             at /rustc/84f962a89bac3948ed116f1ad04c2f4793fb69ea/library/core/src/panicking.rs:107:14
   2: core::panicking::panic_display
             at /rustc/84f962a89bac3948ed116f1ad04c2f4793fb69ea/library/core/src/panicking.rs:63:5
   3: core::option::expect_failed
             at /rustc/84f962a89bac3948ed116f1ad04c2f4793fb69ea/library/core/src/option.rs:1819:5
   4: <rustc_span::span_encoding::Span as rustc_serialize::serialize::Decodable<rustc_query_impl::on_disk_cache::CacheDecoder>>::decode
   5: <rustc_middle::ty::VariantDef as rustc_serialize::serialize::Decodable<rustc_query_impl::on_disk_cache::CacheDecoder>>::decode
   6: <rustc_query_impl::on_disk_cache::CacheDecoder as rustc_serialize::serialize::Decoder>::read_seq::<alloc::vec::Vec<rustc_middle::ty::VariantDef>, <alloc::vec::Vec<rustc_middle::ty::VariantDef> as rustc_serialize::serialize::Decodable<rustc_query_impl::on_disk_cache::CacheDecoder>>::decode::{closure#0}>
   7: <rustc_middle::ty::adt::AdtDef as rustc_serialize::serialize::Decodable<rustc_query_impl::on_disk_cache::CacheDecoder>>::decode
   8: <rustc_middle::ty::sty::TyKind as rustc_serialize::serialize::Decodable<rustc_query_impl::on_disk_cache::CacheDecoder>>::decode
   9: <&rustc_middle::ty::TyS as rustc_serialize::serialize::Decodable<rustc_query_impl::on_disk_cache::CacheDecoder>>::decode
  10: <core::result::Result<rustc_middle::ty::subst::GenericArg, alloc::string::String> as rustc_middle::ty::context::InternIteratorElement<rustc_middle::ty::subst::GenericArg, &rustc_middle::ty::list::List<rustc_middle::ty::subst::GenericArg>>>::intern_with::<core::iter::adapters::map::Map<core::ops::range::Range<usize>, <&rustc_middle::ty::list::List<rustc_middle::ty::subst::GenericArg> as rustc_serialize::serialize::Decodable<rustc_query_impl::on_disk_cache::CacheDecoder>>::decode::{closure#0}>, <rustc_middle::ty::context::TyCtxt>::mk_substs<core::iter::adapters::map::Map<core::ops::range::Range<usize>, <&rustc_middle::ty::list::List<rustc_middle::ty::subst::GenericArg> as rustc_serialize::serialize::Decodable<rustc_query_impl::on_disk_cache::CacheDecoder>>::decode::{closure#0}>>::{closure#0}>
  11: <rustc_middle::ty::sty::TyKind as rustc_serialize::serialize::Decodable<rustc_query_impl::on_disk_cache::CacheDecoder>>::decode
  12: <&rustc_middle::ty::TyS as rustc_serialize::serialize::Decodable<rustc_query_impl::on_disk_cache::CacheDecoder>>::decode
  13: <core::result::Result<rustc_middle::ty::subst::GenericArg, alloc::string::String> as rustc_middle::ty::context::InternIteratorElement<rustc_middle::ty::subst::GenericArg, &rustc_middle::ty::list::List<rustc_middle::ty::subst::GenericArg>>>::intern_with::<core::iter::adapters::map::Map<core::ops::range::Range<usize>, <&rustc_middle::ty::list::List<rustc_middle::ty::subst::GenericArg> as rustc_serialize::serialize::Decodable<rustc_query_impl::on_disk_cache::CacheDecoder>>::decode::{closure#0}>, <rustc_middle::ty::context::TyCtxt>::mk_substs<core::iter::adapters::map::Map<core::ops::range::Range<usize>, <&rustc_middle::ty::list::List<rustc_middle::ty::subst::GenericArg> as rustc_serialize::serialize::Decodable<rustc_query_impl::on_disk_cache::CacheDecoder>>::decode::{closure#0}>>::{closure#0}>
  14: <rustc_middle::ty::sty::TyKind as rustc_serialize::serialize::Decodable<rustc_query_impl::on_disk_cache::CacheDecoder>>::decode
  15: <&rustc_middle::ty::TyS as rustc_serialize::serialize::Decodable<rustc_query_impl::on_disk_cache::CacheDecoder>>::decode
  16: <&rustc_middle::ty::TyS as rustc_serialize::serialize::Decodable<rustc_query_impl::on_disk_cache::CacheDecoder>>::decode
  17: <rustc_query_impl::on_disk_cache::CacheDecoder as rustc_serialize::serialize::Decoder>::read_seq::<alloc::vec::Vec<&rustc_middle::ty::TyS>, <alloc::vec::Vec<&rustc_middle::ty::TyS> as rustc_serialize::serialize::Decodable<rustc_query_impl::on_disk_cache::CacheDecoder>>::decode::{closure#0}>
  18: <rustc_query_impl::on_disk_cache::CacheDecoder as rustc_serialize::serialize::Decoder>::read_map::<std::collections::hash::map::HashMap<rustc_hir::hir_id::ItemLocalId, alloc::vec::Vec<&rustc_middle::ty::TyS>, core::hash::BuildHasherDefault<rustc_hash::FxHasher>>, <std::collections::hash::map::HashMap<rustc_hir::hir_id::ItemLocalId, alloc::vec::Vec<&rustc_middle::ty::TyS>, core::hash::BuildHasherDefault<rustc_hash::FxHasher>> as rustc_serialize::serialize::Decodable<rustc_query_impl::on_disk_cache::CacheDecoder>>::decode::{closure#0}>
  19: <rustc_middle::ty::context::TypeckResults as rustc_serialize::serialize::Decodable<rustc_query_impl::on_disk_cache::CacheDecoder>>::decode::{closure#0}
  20: <rustc_query_impl::on_disk_cache::OnDiskCache>::try_load_query_result::<&rustc_middle::ty::context::TypeckResults>
  21: rustc_query_system::query::plumbing::try_load_from_disk_and_cache_in_memory::<rustc_query_impl::plumbing::QueryCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>
  22: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>>
  23: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck
  24: <rustc_middle::ty::context::TyCtxt>::typeck_body
  25: rustc_hir::intravisit::walk_impl_item::<rustc_passes::dead::MarkSymbolVisitor>
  26: rustc_passes::dead::check_crate
  27: <core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#5}::{closure#0}::{closure#1}> as core::ops::function::FnOnce<()>>::call_once
  28: <core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#5}::{closure#0}> as core::ops::function::FnOnce<()>>::call_once
  29: <rustc_session::session::Session>::time::<(), rustc_interface::passes::analysis::{closure#5}>
  30: rustc_interface::passes::analysis
  31: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, (), core::result::Result<(), rustc_errors::ErrorReported>>
  32: rustc_data_structures::stack::ensure_sufficient_stack::<(core::result::Result<(), rustc_errors::ErrorReported>, rustc_query_system::dep_graph::graph::DepNodeIndex), rustc_query_system::query::plumbing::execute_job<rustc_query_impl::plumbing::QueryCtxt, (), core::result::Result<(), rustc_errors::ErrorReported>>::{closure#3}>
  33: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<(), core::result::Result<(), rustc_errors::ErrorReported>>>
  34: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
  35: <rustc_interface::passes::QueryContext>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}::{closure#3}, core::result::Result<(), rustc_errors::ErrorReported>>
  36: <rustc_interface::interface::Compiler>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_errors::ErrorReported>>
  37: rustc_span::with_source_map::<core::result::Result<(), rustc_errors::ErrorReported>, rustc_interface::interface::create_compiler_and_run<core::result::Result<(), rustc_errors::ErrorReported>, rustc_driver::run_compiler::{closure#1}>::{closure#1}>
  38: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::setup_callbacks_and_run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorReported>, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorReported>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_errors::ErrorReported>>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose 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.59.0-nightly (84f962a89 2021-12-20) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z incremental-verify-ich -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type bin

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

query stack during panic:
#0 [typeck] type-checking `wrench::<impl at wrench/src/wrench.rs:165:1: 635:2>::new`
#1 [analysis] running analysis passes on this crate
end of query stack

This can be reproduced with the following:

rustup-toolchain-install-master 84f962a89bac3948ed116f1ad04c2f4793fb69ea
cargo build -p collector
RUST_BACKTRACE=1 \
    RUST_LIB_BACKTRACE=0 \
    RUST_LOG=raw_cargo_messages=trace,collector=debug \
    cargo run -p collector --bin collector -- \
    bench_local +84f962a89bac3948ed116f1ad04c2f4793fb69ea Test \
        --builds Check \
        --runs All \
        --include webrender-wrench

cc @Aaron1011

@Mark-Simulacrum Mark-Simulacrum added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ A-incr-comp Area: Incremental compilation labels Dec 21, 2021
@Mark-Simulacrum Mark-Simulacrum added this to the 1.59.0 milestone Dec 21, 2021
jsdanielh added a commit to nimiq/core-rs-albatross that referenced this issue Dec 21, 2021
Avoid cleaning specific crates since latest `rustc` nightly
presents issues whith the disk cache when doing a clean of a
specific crate as reported
[here](rust-lang/rust#92163).
This affects only the devnet scripts and would make the CI to
take longer to run these scripts.
jsdanielh added a commit to nimiq/core-rs-albatross that referenced this issue Dec 21, 2021
Avoid cleaning specific crates since latest `rustc` nightly
presents issues with the disk cache when doing a clean of a
specific crate as reported
[here](rust-lang/rust#92163).
This affects only the devnet scripts and would make the CI to
take longer to run these scripts.
@Aaron1011
Copy link
Member

@Mark-Simulacrum: Do you know why this didn't show up in the rust-timer perf runs that I did for that PR?

@Mark-Simulacrum
Copy link
Member Author

We didn't used to show errors on comparison pages (only by omission), I think at least part of the webrender results were missing.

I just today landed a PR that addresses this, so we should hopefully notice this sooner in the future, and you can see that results from #91924 now have a line at the top indicating this breakage. It should also get reflected in future PR comments and such.

https://perf.rust-lang.org/compare.html?start=60f3bd78eeac87ad474916d36d29ed7e5084b25b&end=84f962a89bac3948ed116f1ad04c2f4793fb69ea

@Aaron1011
Copy link
Member

I have a fix locally, and I'm working on a PR.

@Mark-Simulacrum
Copy link
Member Author

One thing I'm realizing -- we should list fixed benchmarks on rustc-perf as well. I'll file an issue for that.

@WilliamVenner
Copy link
Contributor

WilliamVenner commented Dec 22, 2021

I have come across this problem on my own machine.

Please note I am using sscache. cargo clean resolves the issue.

thread 'rustc' panicked at 'failed to lookup `SourceFile` in new context', compiler\rustc_query_impl\src\on_disk_cache.rs:500:22
stack backtrace:
   0:     0x7ffbba9b9c4f - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hb627657c32fb20ba
   1:     0x7ffbba9e47fa - core::fmt::write::h54eb8d7da15814eb
   2:     0x7ffbba9ab738 - <std::io::IoSliceMut as core::fmt::Debug>::fmt::hc3eb0e97c5326934
   3:     0x7ffbba9bd3a6 - std::panicking::take_hook::hf5b13a50efed9e15
   4:     0x7ffbba9bce89 - std::panicking::take_hook::hf5b13a50efed9e15
   5:     0x7ffb9cc999f6 - <rustc_typeck[981eab1a4c12faaf]::coherence::inherent_impls_overlap::InherentOverlapChecker as rustc_hir[a7510ee90ae70616]::itemlikevisit::ItemLikeVisitor>::visit_impl_item
   6:     0x7ffbba9bdc09 - std::panicking::rust_panic_with_hook::hfaaf6cbad4a745da
   7:     0x7ffbba9bd75b - rust_begin_unwind
   8:     0x7ffbba9ba577 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hb627657c32fb20ba
   9:     0x7ffbba9bd6b9 - rust_begin_unwind
  10:     0x7ffbbaa18a20 - core::panicking::panic_fmt::h94b2d3b80b2c8df8
  11:     0x7ffbba9e1410 - <core::panic::panic_info::PanicInfo as core::fmt::Display>::fmt::h515aead6be4ecac0
  12:     0x7ffbbaa1891b - core::option::expect_failed::h44068138c8379b84
  13:     0x7ffba0468693 - <rustc_query_impl[d9ad865d4dbd08ba]::on_disk_cache::OnDiskCache>::load_side_effects
  14:     0x7ffba05c9957 - <rustc_span[98c5fae7be2fedaa]::span_encoding::Span as rustc_serialize[656dd67819cd77eb]::serialize::Decodable<rustc_query_impl[d9ad865d4dbd08ba]::on_disk_cache::CacheDecoder>>::decode
  15:     0x7ffba054e6b6 - <&[rustc_ast[f68e92c20283ad0]::ast::InlineAsmTemplatePiece] as rustc_serialize[656dd67819cd77eb]::serialize::Decodable<rustc_query_impl[d9ad865d4dbd08ba]::on_disk_cache::CacheDecoder>>::decode
  16:     0x7ffba0457190 - rustc_query_impl[d9ad865d4dbd08ba]::query_callbacks::diagnostic_hir_wf_check
  17:     0x7ffba0418ae3 - <rustc_query_impl[d9ad865d4dbd08ba]::Queries as rustc_middle[1767ea85553f7985]::ty::query::QueryEngine>::try_mark_green
  18:     0x7ffba03adcc8 - <rustc_mir_dataflow[3ff2d8458acef131]::impls::storage_liveness::MaybeRequiresStorage as rustc_mir_dataflow[3ff2d8458acef131]::framework::AnalysisDomain>::initialize_start_block
  19:     0x7ffba055b1b9 - <&[rustc_ast[f68e92c20283ad0]::ast::InlineAsmTemplatePiece] as rustc_serialize[656dd67819cd77eb]::serialize::Decodable<rustc_query_impl[d9ad865d4dbd08ba]::on_disk_cache::CacheDecoder>>::decode
  20:     0x7ffba0468844 - <rustc_query_impl[d9ad865d4dbd08ba]::on_disk_cache::OnDiskCache>::load_side_effects
  21:     0x7ffba055b2a8 - <&[rustc_ast[f68e92c20283ad0]::ast::InlineAsmTemplatePiece] as rustc_serialize[656dd67819cd77eb]::serialize::Decodable<rustc_query_impl[d9ad865d4dbd08ba]::on_disk_cache::CacheDecoder>>::decode
  22:     0x7ffba04548c3 - rustc_query_impl[d9ad865d4dbd08ba]::query_callbacks::diagnostic_hir_wf_check
  23:     0x7ffba04056e0 - <rustc_query_impl[d9ad865d4dbd08ba]::Queries as rustc_middle[1767ea85553f7985]::ty::query::QueryEngine>::try_mark_green
  24:     0x7ffba04672a7 - <rustc_query_impl[d9ad865d4dbd08ba]::on_disk_cache::OnDiskCache>::load_side_effects
  25:     0x7ffba030072b - <rustc_mir_dataflow[3ff2d8458acef131]::impls::storage_liveness::MaybeRequiresStorage as rustc_mir_dataflow[3ff2d8458acef131]::framework::AnalysisDomain>::initialize_start_block
  26:     0x7ffba0389422 - <rustc_mir_dataflow[3ff2d8458acef131]::impls::storage_liveness::MaybeRequiresStorage as rustc_mir_dataflow[3ff2d8458acef131]::framework::AnalysisDomain>::initialize_start_block
  27:     0x7ffba024224d - <rustc_mir_dataflow[3ff2d8458acef131]::impls::storage_liveness::MaybeRequiresStorage as rustc_mir_dataflow[3ff2d8458acef131]::framework::AnalysisDomain>::initialize_start_block
  28:     0x7ffba0363245 - <rustc_mir_dataflow[3ff2d8458acef131]::impls::storage_liveness::MaybeRequiresStorage as rustc_mir_dataflow[3ff2d8458acef131]::framework::AnalysisDomain>::initialize_start_block
  29:     0x7ffba11bce09 - <rustc_middle[1767ea85553f7985]::ty::context::TyCtxt>::typeck_body
  30:     0x7ffb9faa2c86 - <rustc_ast_lowering[70a0538daa5dcc6b]::index::NodeCollector as rustc_hir[a7510ee90ae70616]::intravisit::Visitor>::visit_impl_item_ref
  31:     0x7ffb9fac2591 - <rustc_ast_lowering[70a0538daa5dcc6b]::index::NodeCollector as rustc_hir[a7510ee90ae70616]::intravisit::Visitor>::visit_impl_item_ref
  32:     0x7ffb9fb20bbe - rustc_passes[3916d9b1c55b1c4f]::dead::check_crate
  33:     0x7ffb9cec39a7 - <rustc_interface[ac5c56627e25a53e]::passes::boxed_resolver::BoxedResolver>::to_resolver_outputs
  34:     0x7ffb9cec5088 - <rustc_interface[ac5c56627e25a53e]::passes::boxed_resolver::BoxedResolver>::to_resolver_outputs
  35:     0x7ffb9ceb398e - <rustc_interface[ac5c56627e25a53e]::passes::boxed_resolver::BoxedResolver>::to_resolver_outputs
  36:     0x7ffb9ce01a67 - rustc_interface[ac5c56627e25a53e]::passes::analysis
  37:     0x7ffba03d8ceb - <rustc_query_impl[d9ad865d4dbd08ba]::Queries as rustc_middle[1767ea85553f7985]::ty::query::QueryEngine>::try_mark_green
  38:     0x7ffba052025e - <&[rustc_ast[f68e92c20283ad0]::ast::InlineAsmTemplatePiece] as rustc_serialize[656dd67819cd77eb]::serialize::Decodable<rustc_query_impl[d9ad865d4dbd08ba]::on_disk_cache::CacheDecoder>>::decode
  39:     0x7ffba0396601 - <rustc_mir_dataflow[3ff2d8458acef131]::impls::storage_liveness::MaybeRequiresStorage as rustc_mir_dataflow[3ff2d8458acef131]::framework::AnalysisDomain>::initialize_start_block
  40:     0x7ffba02c7a39 - <rustc_mir_dataflow[3ff2d8458acef131]::impls::storage_liveness::MaybeRequiresStorage as rustc_mir_dataflow[3ff2d8458acef131]::framework::AnalysisDomain>::initialize_start_block
  41:     0x7ffba0363692 - <rustc_mir_dataflow[3ff2d8458acef131]::impls::storage_liveness::MaybeRequiresStorage as rustc_mir_dataflow[3ff2d8458acef131]::framework::AnalysisDomain>::initialize_start_block
  42:     0x7ffb9cd1bf50 - <rustc_driver[2fa120ec4306dc43]::args::Error as core[714c049513c47125]::fmt::Debug>::fmt
  43:     0x7ffb9ccc08b5 - <rustc_middle[1767ea85553f7985]::ty::SymbolName as core[714c049513c47125]::fmt::Display>::fmt
  44:     0x7ffb9ccb4a05 - rustc_driver[2fa120ec4306dc43]::pretty::print_after_hir_lowering
  45:     0x7ffb9ccdcf91 - <rustc_middle[1767ea85553f7985]::ty::SymbolName as core[714c049513c47125]::fmt::Display>::fmt
  46:     0x7ffb9ccbd8d3 - rustc_driver[2fa120ec4306dc43]::pretty::print_after_hir_lowering
  47:     0x7ffb9cd38018 - <rustc_driver[2fa120ec4306dc43]::args::Error as core[714c049513c47125]::fmt::Debug>::fmt
  48:     0x7ffbba9cb38c - std::sys::windows::thread::Thread::new::h675ce0e4b2379fd4
  49:     0x7ffc884054e0 - BaseThreadInitThunk
  50:     0x7ffc896c485b - RtlUserThreadStart

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.59.0-nightly (23f69235a 2021-12-20) running on x86_64-pc-windows-msvc

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental -C target-feature=+crt-static --crate-type cdylib

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

query stack during panic:
#0 [typeck] type-checking `hax::init::__process_voice_data`
#1 [analysis] running analysis passes on this crate
end of query stack

Here is where it got to:

pub unsafe fn init() {
	let (_engine, _engine_path) = open_library_srv!("engine").expect("Failed to open engine shared library!");

	extern "C" fn __process_voice_data(client: *mut std::ffi::c_void, len: i32, data: *mut std::os::raw::c_char, xuid: i64) {
		unsafe {
			if crate::record::SV_BroadcastVoiceData(client, len, data, xuid) {
				BROADCAST_VOICE_DATA_DETOUR.get().call(client, len, data, xuid);
			}
		}
	}

@WilliamVenner
Copy link
Contributor

Still occurs on e100ec5bc 2021-12-21 nightly

bors bot pushed a commit to bevyengine/bevy that referenced this issue Dec 24, 2021
This is a temporary measure while we wait for rust-lang/rust#92163 to be resolved.
bors bot pushed a commit to bevyengine/bevy that referenced this issue Dec 24, 2021
This is a temporary measure while we wait for rust-lang/rust#92163 to be resolved.
nmraz added a commit to nmraz/corrosios that referenced this issue Dec 24, 2021
This is due to a recently-introduced conditional compilation ICE
(rust-lang/rust#92163).
@petrochenkov
Copy link
Contributor

FWIW, it prevents building clippy with x.py test with enabled incremental for me.
The cargo clean recommendation doesn't work in that case, and removing the incremental directories manually doesn't help either because some intermediate build step creates them again.
The only fix is disabling the incremental flag, but it requires rebuilding everything from scratch (and rebuilding everything again when enabling incremental back), which requires unreasonable amount of time.

@apiraino
Copy link
Contributor

Seeing the increasing number of incoming reports, we raise the evaluation of this issue

(Zulip thread)

@rustbot label -P-high +P-critical

@rustbot rustbot added P-critical Critical priority and removed P-high High priority labels Dec 31, 2021
bors added a commit to rust-lang-ci/rust that referenced this issue Dec 31, 2021
…cjgillot

Import `SourceFile`s from crate before decoding foreign `Span`

Fixes rust-lang#92163
Fixes rust-lang#92014

When writing to the incremental cache, we encode all `Span`s
we encounter, regardless of whether or not their `SourceFile`
comes from the local crate, or from a foreign crate.

When we decode a `Span`, we use the `StableSourceFileId` we encoded
to locate the matching `SourceFile` in the current session. If this
id corresponds to a `SourceFile` from another crate, then we need to
have already imported that `SourceFile` into our current session.

This usually happens automatically during resolution / macro expansion,
when we try to resolve definitions from other crates. In certain cases,
however, we may try to load a `Span` from a transitive dependency
without having ever imported the `SourceFile`s from that crate, leading
to an ICE.

This PR fixes the issue by enconding the `SourceFile`'s `CrateNum`
when we encode a `Span`. During decoding, we call `imported_source_files()`
when we encounter a foreign `CrateNum`, which ensure that all
`SourceFile`s from that crate are imported into the current session.
@bors bors closed this as completed in d922092 Dec 31, 2021
bors added a commit to rust-lang/miri that referenced this issue Jan 1, 2022
rustup

The previously pinned toolchain was affected by rust-lang/rust#92163, let's switch to one where that problem is fixed.
jsdanielh added a commit to nimiq/core-rs-albatross that referenced this issue Jan 3, 2022
Now that the issue in nightly `rustc` reported
[here](rust-lang/rust#92163) is fixed,
allow the devnet scripts to only clean the `nimiq-genesis` crate.
viquezclaudio pushed a commit to nimiq/core-rs-albatross that referenced this issue Jan 3, 2022
Now that the issue in nightly `rustc` reported
[here](rust-lang/rust#92163) is fixed,
allow the devnet scripts to only clean the `nimiq-genesis` crate.
tiagolobocastro added a commit to openebs/mayastor-control-plane that referenced this issue Jan 7, 2022
tiagolobocastro added a commit to openebs/mayastor-control-plane that referenced this issue Jan 7, 2022
@jyn514
Copy link
Member

jyn514 commented Feb 2, 2022

This issue is milestoned 1.59, but I've also been running into this crash on 1.58.1 stable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-incr-comp Area: Incremental compilation I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-critical Critical priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. 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.