Open
Description
I tried this code:
./x.py build compiler/rustc_codegen_cranelift
with the compiler
profile which enables incr comp.
I expected to see this happen: It worked.
Instead, this happened: Got an incr comp related ICE.
Meta
Base commit is c84d5e7. Commit of the previous build is bjorn3@15d3eee.
Backtrace
error: internal compiler error: compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs:595:32: uninterned StableCrateId: StableCrateId(16163198275912615384)
thread 'rustc' panicked at 'Box<dyn Any>', /rustc/eff24c06d8f4397802b546aa2e52450e1022fc02/compiler/rustc_errors/src/lib.rs:1651:9
stack backtrace:
0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
1: <rustc_errors::HandlerInner>::bug::<alloc::string::String>
2: <rustc_errors::Handler>::bug::<alloc::string::String>
3: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>::{closure#0}
4: rustc_middle::ty::context::tls::with_opt::<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}
5: rustc_middle::ty::context::tls::with_context_opt::<rustc_middle::ty::context::tls::with_opt<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
6: rustc_middle::util::bug::bug_fmt
7: <rustc_metadata::creader::CStore as rustc_session::cstore::CrateStore>::stable_crate_id_to_crate_num
8: <rustc_span::span_encoding::Span as rustc_serialize::serialize::Decodable<rustc_middle::query::on_disk_cache::CacheDecoder>>::decode
9: <alloc::vec::Vec<(rustc_middle::ty::Predicate, rustc_span::span_encoding::Span)> as alloc::vec::spec_from_iter::SpecFromIter<(rustc_middle::ty::Predicate, rustc_span::span_encoding::Span), core::iter::adapters::map::Map<core::ops::range::Range<usize>, <[(rustc_middle::ty::Predicate, rustc_span::span_encoding::Span)] as rustc_middle::ty::codec::RefDecodable<rustc_middle::query::on_disk_cache::CacheDecoder>>::decode::{closure#0}>>>::from_iter
10: <[(rustc_middle::ty::Predicate, rustc_span::span_encoding::Span)] as rustc_middle::ty::codec::RefDecodable<rustc_middle::query::on_disk_cache::CacheDecoder>>::decode
11: <rustc_middle::query::on_disk_cache::OnDiskCache>::load_indexed::<rustc_middle::ty::generics::GenericPredicates>
12: rustc_query_impl::plumbing::try_load_from_disk::<rustc_middle::ty::generics::GenericPredicates>
13: <rustc_query_impl::query_impl::implied_predicates_of::dynamic_query::{closure#6} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, &rustc_span::def_id::DefId, rustc_query_system::dep_graph::serialized::SerializedDepNodeIndex, rustc_query_system::dep_graph::graph::DepNodeIndex)>>::call_once
14: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::query::erase::Erased<[u8; 24]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, true>
15: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::query::erase::Erased<[u8; 24]>>>
16: <rustc_privacy::ReachEverythingInTheInterfaceVisitor>::predicates
17: <rustc_privacy::EmbargoVisitor as rustc_hir::intravisit::Visitor>::visit_item
18: <rustc_middle::hir::map::Map>::visit_all_item_likes_in_crate::<rustc_privacy::EmbargoVisitor>
19: rustc_privacy::effective_visibilities
20: rustc_passes::stability::check_unused_or_stable_features
21: <rustc_session::session::Session>::time::<(), rustc_interface::passes::analysis::{closure#0}::{closure#2}::{closure#0}>
22: rustc_interface::passes::analysis
23: <rustc_interface::queries::QueryResult<&rustc_middle::ty::context::GlobalCtxt>>::enter::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#4}>
24: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
25: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
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.71.0-beta.1 (eff24c06d 2023-05-29) running on aarch64-unknown-linux-gnu
note: compiler flags: --crate-type dylib -C opt-level=3 -C embed-bitcode=no -C debuginfo=0 -Z unstable-options -C incremental=[REDACTED] -C symbol-mangling-version=v0 -Z unstable-options -Z macro-backtrace -C link-args=-Wl,-z,origin -C link-args=-Wl,-rpath,$ORIGIN/../lib -C split-debuginfo=off -C llvm-args=-import-instr-limit=10 -Z binary-dep-depinfo -Z force-unstable-if-unmarked
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
thread panicked while processing panic. aborting.
rustc exited with signal: 6 (SIGABRT) (core dumped)
error: could not compile `rustc_codegen_cranelift` (lib)
Metadata
Metadata
Assignees
Labels
Type
Projects
Relationships
Development
No branches or pull requests
Activity
bjorn3 commentedon Jun 16, 2023
cc @jyn514 looks like #111329 didn't fix everything yet.
jyn514 commentedon Jun 16, 2023
This is an ICE in beta, not stage 1. So this is probably a real incr comp bug, not a bug in bootstrap..
[-]Bootstrap error: internal compiler error: compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs:595:32: uninterned StableCrateId: StableCrateId(16163198275912615384)[/-][+]ICE: compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs:595:32: uninterned StableCrateId[/+]jyn514 commentedon Jun 16, 2023
#88488 might be related.
dpaoliello commentedon Aug 11, 2023
I'm reliably hitting this using x86_64-pc-windows-msvc. Please let me know if you need any info to debug it.
11 remaining items
apiraino commentedon Dec 11, 2023
WG-prioritization assigning priority (Zulip discussion).
@rustbot label -I-prioritize +P-medium
michaelwoerister commentedon Dec 19, 2023
I'm having a hard time writing a small reproducer for this. Simply changing
-Cmetadata
of an upstream dependency is not sufficient. I think it also needs to involved certain things to be read from the incr. comp. cache in order to trigger the ICE.Auto merge of rust-lang#119139 - michaelwoerister:cleanup-stable-sour…
Auto merge of rust-lang#119139 - michaelwoerister:cleanup-stable-sour…
Auto merge of #119139 - michaelwoerister:cleanup-stable-source-file-i…
michaelwoerister commentedon Jan 3, 2024
A potential fix for this has been merged in #119139 last week. Since the issue seems to most easily trigger during bootstrap, we'll have to wait for the fix to make it to beta before we can tell if it worked. I wasn't able to come up with a small reproducer, unfortunately.
vegardgs-ksat commentedon Apr 16, 2024
I encountered this issue in stable (1.77.1) today.
michaelwoerister commentedon Apr 17, 2024
Thanks for the report, @vegardgs-ksat!
This looks like a different issue. It's the same error but triggered by a different code path. Do you have a reproducer for the ICE? Then it would be best to open a new issue.
vegardgs-ksat commentedon Apr 18, 2024
I was not aware it was a different issue.
I do not have a reproducer - it was a one-off error that occurred when I made two consecutive changes within
sqlx::QueryBuilder
string contents (I believe - I do not think it was thesqlx::query!
macro). I have worked a lot with this kind of code, and I have only gotten this ICE once - so its definitely not a common issue.michaelwoerister commentedon Apr 19, 2024
No worries, there's no way to tell that this has a different root cause unless one knows the relevant parts of the compiler's internals. You absolutely did the right thing reporting the backtrace here.
We'll have to wait for a reproducer to dig into this more.