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

ICE during ./x.py check miri when switching between rustc commits #115835

Closed
RalfJung opened this issue Sep 14, 2023 · 2 comments
Closed

ICE during ./x.py check miri when switching between rustc commits #115835

RalfJung opened this issue Sep 14, 2023 · 2 comments
Labels
A-incr-comp Area: Incremental compilation 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.

Comments

@RalfJung
Copy link
Member

RalfJung commented Sep 14, 2023

This could be an incremental issue? Not sure. To reproduce:

find build/ -name incremental -name "miri*" | xargs rm -rf
git reset --hard 585bb5e68d85c1e4f32da3e2499343372626a436 && git submodule update --recursive
./x.py check miri
git reset --hard c728bf3963433062b91bd84ffcb37d15416b800e && git submodule update --recursive
./x.py check miri
error: internal compiler error: compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs:603:32: uninterned StableCrateId: StableCrateId(747081748557157979)

thread 'rustc' panicked at /rustc/680cdf8168a906b4ea80af673c64e4a16f77be57/compiler/rustc_errors/src/lib.rs:1635:9:
Box<dyn Any>
stack backtrace:
   0:     0x7f21009630fc - std::backtrace_rs::backtrace::libunwind::trace::h2735517c1857b7ac
                               at /rustc/680cdf8168a906b4ea80af673c64e4a16f77be57/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f21009630fc - std::backtrace_rs::backtrace::trace_unsynchronized::hf9177b97a126b282
                               at /rustc/680cdf8168a906b4ea80af673c64e4a16f77be57/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f21009630fc - std::sys_common::backtrace::_print_fmt::h2e15a1c5b347a299
                               at /rustc/680cdf8168a906b4ea80af673c64e4a16f77be57/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7f21009630fc - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h5349d15174bef316
                               at /rustc/680cdf8168a906b4ea80af673c64e4a16f77be57/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f21009c93bc - core::fmt::rt::Argument::fmt::hf7848e265af79e1f
                               at /rustc/680cdf8168a906b4ea80af673c64e4a16f77be57/library/core/src/fmt/rt.rs:138:9
   5:     0x7f21009c93bc - core::fmt::write::hbde61702c56c8f5f
                               at /rustc/680cdf8168a906b4ea80af673c64e4a16f77be57/library/core/src/fmt/mod.rs:1094:21
   6:     0x7f2100955b2e - std::io::Write::write_fmt::h064308c6d4b3b51c
                               at /rustc/680cdf8168a906b4ea80af673c64e4a16f77be57/library/std/src/io/mod.rs:1714:15
   7:     0x7f2100962ee4 - std::sys_common::backtrace::_print::h9568a7b6112c6b29
                               at /rustc/680cdf8168a906b4ea80af673c64e4a16f77be57/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f2100962ee4 - std::sys_common::backtrace::print::hf01ef999a96ddebe
                               at /rustc/680cdf8168a906b4ea80af673c64e4a16f77be57/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f2100965fda - std::panicking::panic_hook_with_disk_dump::{{closure}}::h80a06791c2b4e0bd
                               at /rustc/680cdf8168a906b4ea80af673c64e4a16f77be57/library/std/src/panicking.rs:278:22
  10:     0x7f2100965cc7 - std::panicking::panic_hook_with_disk_dump::h41378fbd0b9324e5
                               at /rustc/680cdf8168a906b4ea80af673c64e4a16f77be57/library/std/src/panicking.rs:312:9
  11:     0x7f2103b05929 - <rustc_driver_impl[e639b49598884b8a]::install_ice_hook::{closure#0} as core[adbc28648fe68309]::ops::function::FnOnce<(&core[adbc28648fe68309]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  12:     0x7f2100966880 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hca49758b2921d01d
                               at /rustc/680cdf8168a906b4ea80af673c64e4a16f77be57/library/alloc/src/boxed.rs:2021:9
  13:     0x7f2100966880 - std::panicking::rust_panic_with_hook::h6c0a3ee1013fc764
                               at /rustc/680cdf8168a906b4ea80af673c64e4a16f77be57/library/std/src/panicking.rs:733:13
  14:     0x7f2104080361 - std[9ddfa24fb45fdd5]::panicking::begin_panic::<rustc_errors[50cf2742985e2cc3]::ExplicitBug>::{closure#0}
  15:     0x7f210407c036 - std[9ddfa24fb45fdd5]::sys_common::backtrace::__rust_end_short_backtrace::<std[9ddfa24fb45fdd5]::panicking::begin_panic<rustc_errors[50cf2742985e2cc3]::ExplicitBug>::{closure#0}, !>
  16:     0x7f2104036486 - std[9ddfa24fb45fdd5]::panicking::begin_panic::<rustc_errors[50cf2742985e2cc3]::ExplicitBug>
  17:     0x7f2104042ef4 - <rustc_errors[50cf2742985e2cc3]::HandlerInner>::bug::<alloc[28d3c6fe31fa06ea]::string::String>
  18:     0x7f2104042d86 - <rustc_errors[50cf2742985e2cc3]::Handler>::bug::<alloc[28d3c6fe31fa06ea]::string::String>
  19:     0x7f21040c98fc - rustc_middle[4f8dbc89c826d5e7]::util::bug::opt_span_bug_fmt::<rustc_span[98abfeae9902262c]::span_encoding::Span>::{closure#0}
  20:     0x7f21040c7faa - rustc_middle[4f8dbc89c826d5e7]::ty::context::tls::with_opt::<rustc_middle[4f8dbc89c826d5e7]::util::bug::opt_span_bug_fmt<rustc_span[98abfeae9902262c]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  21:     0x7f21040c7f78 - rustc_middle[4f8dbc89c826d5e7]::ty::context::tls::with_context_opt::<rustc_middle[4f8dbc89c826d5e7]::ty::context::tls::with_opt<rustc_middle[4f8dbc89c826d5e7]::util::bug::opt_span_bug_fmt<rustc_span[98abfeae9902262c]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  22:     0x7f2102405390 - rustc_middle[4f8dbc89c826d5e7]::util::bug::bug_fmt
  23:     0x7f2101f68949 - <rustc_metadata[6be65da5367bcd92]::creader::CStore as rustc_session[8b0e884d99892ff9]::cstore::CrateStore>::stable_crate_id_to_crate_num
  24:     0x7f2101f62cf2 - <rustc_span[98abfeae9902262c]::span_encoding::Span as rustc_serialize[83c63665af70f8d4]::serialize::Decodable<rustc_middle[4f8dbc89c826d5e7]::query::on_disk_cache::CacheDecoder>>::decode
  25:     0x7f2102287fb5 - <rustc_middle[4f8dbc89c826d5e7]::query::on_disk_cache::OnDiskCache>::load_indexed::<rustc_middle[4f8dbc89c826d5e7]::ty::generics::GenericPredicates>
  26:     0x7f2102ae801f - rustc_query_system[4951510bf28fc946]::query::plumbing::try_execute_query::<rustc_query_impl[c656d3eafec972bf]::DynamicConfig<rustc_query_system[4951510bf28fc946]::query::caches::DefaultCache<rustc_span[98abfeae9902262c]::def_id::DefId, rustc_middle[4f8dbc89c826d5e7]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[c656d3eafec972bf]::plumbing::QueryCtxt, true>
  27:     0x7f2102a876c9 - rustc_query_impl[c656d3eafec972bf]::query_impl::predicates_of::get_query_incr::__rust_end_short_backtrace
  28:     0x7f2101e9de76 - <rustc_trait_selection[e7c9f5e50b08178d]::traits::wf::WfPredicates>::compute
  29:     0x7f2101e8c9c2 - <rustc_trait_selection[e7c9f5e50b08178d]::traits::fulfill::FulfillProcessor as rustc_data_structures[1b8eceeea0e3e8e]::obligation_forest::ObligationProcessor>::process_obligation
  30:     0x7f2101e88294 - <rustc_data_structures[1b8eceeea0e3e8e]::obligation_forest::ObligationForest<rustc_trait_selection[e7c9f5e50b08178d]::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection[e7c9f5e50b08178d]::traits::fulfill::FulfillProcessor>
  31:     0x7f210239c702 - <rustc_trait_selection[e7c9f5e50b08178d]::traits::engine::ObligationCtxt>::assumed_wf_types_and_report_errors
  32:     0x7f210238d1d2 - rustc_hir_analysis[540d0155f9a9fdf9]::check::wfcheck::check_well_formed
  33:     0x7f2101bf49bc - rustc_query_impl[c656d3eafec972bf]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[c656d3eafec972bf]::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle[4f8dbc89c826d5e7]::query::erase::Erased<[u8; 0usize]>>
  34:     0x7f2101bf499c - <rustc_query_impl[c656d3eafec972bf]::query_impl::check_well_formed::dynamic_query::{closure#2} as core[adbc28648fe68309]::ops::function::FnOnce<(rustc_middle[4f8dbc89c826d5e7]::ty::context::TyCtxt, rustc_hir[b203f27517561947]::hir_id::OwnerId)>>::call_once
  35:     0x7f2101d3953c - rustc_query_system[4951510bf28fc946]::query::plumbing::try_execute_query::<rustc_query_impl[c656d3eafec972bf]::DynamicConfig<rustc_query_system[4951510bf28fc946]::query::caches::VecCache<rustc_hir[b203f27517561947]::hir_id::OwnerId, rustc_middle[4f8dbc89c826d5e7]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[c656d3eafec972bf]::plumbing::QueryCtxt, true>
  36:     0x7f21032c2604 - rustc_query_system[4951510bf28fc946]::query::plumbing::force_query::<rustc_query_impl[c656d3eafec972bf]::DynamicConfig<rustc_query_system[4951510bf28fc946]::query::caches::VecCache<rustc_hir[b203f27517561947]::hir_id::OwnerId, rustc_middle[4f8dbc89c826d5e7]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[c656d3eafec972bf]::plumbing::QueryCtxt>
  37:     0x7f21032c24db - <rustc_query_impl[c656d3eafec972bf]::plumbing::query_callback<rustc_query_impl[c656d3eafec972bf]::query_impl::check_well_formed::QueryType>::{closure#0} as core[adbc28648fe68309]::ops::function::FnOnce<(rustc_middle[4f8dbc89c826d5e7]::ty::context::TyCtxt, rustc_query_system[4951510bf28fc946]::dep_graph::dep_node::DepNode<rustc_middle[4f8dbc89c826d5e7]::dep_graph::dep_node::DepKind>)>>::call_once
  38:     0x7f2101d3a598 - <rustc_query_system[4951510bf28fc946]::dep_graph::graph::DepGraphData<rustc_middle[4f8dbc89c826d5e7]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[c656d3eafec972bf]::plumbing::QueryCtxt>
  39:     0x7f210295e47f - <rustc_query_system[4951510bf28fc946]::dep_graph::graph::DepGraph<rustc_middle[4f8dbc89c826d5e7]::dep_graph::dep_node::DepKind>>::try_mark_green::<rustc_query_impl[c656d3eafec972bf]::plumbing::QueryCtxt>
  40:     0x7f2101d3900c - rustc_query_system[4951510bf28fc946]::query::plumbing::ensure_must_run::<rustc_query_impl[c656d3eafec972bf]::DynamicConfig<rustc_query_system[4951510bf28fc946]::query::caches::DefaultCache<rustc_span[98abfeae9902262c]::def_id::LocalModDefId, rustc_middle[4f8dbc89c826d5e7]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[c656d3eafec972bf]::plumbing::QueryCtxt>
  41:     0x7f2103486f96 - rustc_query_impl[c656d3eafec972bf]::query_impl::check_mod_type_wf::get_query_incr::__rust_end_short_backtrace
  42:     0x7f2102ced693 - rustc_data_structures[1b8eceeea0e3e8e]::sync::par_for_each_in::<&[rustc_hir[b203f27517561947]::hir_id::OwnerId], <rustc_middle[4f8dbc89c826d5e7]::hir::map::Map>::par_for_each_module<rustc_hir_analysis[540d0155f9a9fdf9]::check_crate::{closure#5}::{closure#0}::{closure#0}>::{closure#0}>
  43:     0x7f2102ceca4e - rustc_hir_analysis[540d0155f9a9fdf9]::check_crate
  44:     0x7f2102ce327a - rustc_interface[2bb5c4c25af7699b]::passes::analysis
  45:     0x7f210302515a - rustc_query_impl[c656d3eafec972bf]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[c656d3eafec972bf]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[4f8dbc89c826d5e7]::query::erase::Erased<[u8; 1usize]>>
  46:     0x7f2103025149 - <rustc_query_impl[c656d3eafec972bf]::query_impl::analysis::dynamic_query::{closure#2} as core[adbc28648fe68309]::ops::function::FnOnce<(rustc_middle[4f8dbc89c826d5e7]::ty::context::TyCtxt, ())>>::call_once
  47:     0x7f2103312308 - rustc_query_system[4951510bf28fc946]::query::plumbing::try_execute_query::<rustc_query_impl[c656d3eafec972bf]::DynamicConfig<rustc_query_system[4951510bf28fc946]::query::caches::SingleCache<rustc_middle[4f8dbc89c826d5e7]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[c656d3eafec972bf]::plumbing::QueryCtxt, true>
  48:     0x7f2103311e64 - rustc_query_impl[c656d3eafec972bf]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
  49:     0x7f2102dc1e93 - <rustc_interface[2bb5c4c25af7699b]::queries::QueryResult<&rustc_middle[4f8dbc89c826d5e7]::ty::context::GlobalCtxt>>::enter::<core[adbc28648fe68309]::result::Result<(), rustc_span[98abfeae9902262c]::ErrorGuaranteed>, rustc_driver_impl[e639b49598884b8a]::run_compiler::{closure#1}::{closure#2}::{closure#6}>
  50:     0x7f2102dc0e6a - <rustc_interface[2bb5c4c25af7699b]::interface::Compiler>::enter::<rustc_driver_impl[e639b49598884b8a]::run_compiler::{closure#1}::{closure#2}, core[adbc28648fe68309]::result::Result<core[adbc28648fe68309]::option::Option<rustc_interface[2bb5c4c25af7699b]::queries::Linker>, rustc_span[98abfeae9902262c]::ErrorGuaranteed>>
  51:     0x7f2102dbe198 - std[9ddfa24fb45fdd5]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[2bb5c4c25af7699b]::util::run_in_thread_pool_with_globals<rustc_interface[2bb5c4c25af7699b]::interface::run_compiler<core[adbc28648fe68309]::result::Result<(), rustc_span[98abfeae9902262c]::ErrorGuaranteed>, rustc_driver_impl[e639b49598884b8a]::run_compiler::{closure#1}>::{closure#0}, core[adbc28648fe68309]::result::Result<(), rustc_span[98abfeae9902262c]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[adbc28648fe68309]::result::Result<(), rustc_span[98abfeae9902262c]::ErrorGuaranteed>>
  52:     0x7f2102dbd925 - <<std[9ddfa24fb45fdd5]::thread::Builder>::spawn_unchecked_<rustc_interface[2bb5c4c25af7699b]::util::run_in_thread_pool_with_globals<rustc_interface[2bb5c4c25af7699b]::interface::run_compiler<core[adbc28648fe68309]::result::Result<(), rustc_span[98abfeae9902262c]::ErrorGuaranteed>, rustc_driver_impl[e639b49598884b8a]::run_compiler::{closure#1}>::{closure#0}, core[adbc28648fe68309]::result::Result<(), rustc_span[98abfeae9902262c]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[adbc28648fe68309]::result::Result<(), rustc_span[98abfeae9902262c]::ErrorGuaranteed>>::{closure#1} as core[adbc28648fe68309]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  53:     0x7f21009711e5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hf9491799b6dcd8af
                               at /rustc/680cdf8168a906b4ea80af673c64e4a16f77be57/library/alloc/src/boxed.rs:2007:9
  54:     0x7f21009711e5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::he56d203ba32460f1
                               at /rustc/680cdf8168a906b4ea80af673c64e4a16f77be57/library/alloc/src/boxed.rs:2007:9
  55:     0x7f21009711e5 - std::sys::unix::thread::Thread::new::thread_start::h872e25e6c21f41ae
                               at /rustc/680cdf8168a906b4ea80af673c64e4a16f77be57/library/std/src/sys/unix/thread.rs:108:17
    Checking backtrace v0.3.69
    Checking cargo_metadata v0.15.4
    Checking rustfix v0.6.1
  56:     0x7f210070b3ec - start_thread
                               at ./nptl/pthread_create.c:444:8
  57:     0x7f210078ba1c - __GI___clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
  58:                0x0 - <unknown>

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.73.0-beta.1 (680cdf816 2023-08-21) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C opt-level=3 -C embed-bitcode=no -C codegen-units=20 -C debuginfo=1 -C debug-assertions=on -C overflow-checks=off -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 unstable-options -Z binary-dep-depinfo -Z tls-model=initial-exec

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 `miri` (lib)
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Sep 14, 2023
@saethlin saethlin added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-incr-comp Area: Incremental compilation C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Sep 14, 2023
@saethlin
Copy link
Member

I can confirm this is caused by incremental compilation.

bors added a commit to rust-lang-ci/rust that referenced this issue Dec 19, 2023
…ce-file-id, r=<try>

Unify SourceFile::name_hash and StableSourceFileId

This PR adapts the existing `StableSourceFileId` type so that it can be used instead of the `name_hash` field of `SourceFile`. This simplifies a few things that were kind of duplicated before.

The PR should also fix issues rust-lang#112700 and rust-lang#115835, but I was not able to reproduce these issues in a regression test. As far as I can tell, the root cause of these issues is that the id of the originating crate is not hashed in the `HashStable` impl of `Span` and thus cache entries that should have been considered invalidated were loaded. After this PR, the `stable_id` field of `SourceFile` includes information about the originating crate, so that ICE should not occur anymore.
bors added a commit to rust-lang-ci/rust that referenced this issue Dec 24, 2023
…ce-file-id, r=cjgillot

Unify SourceFile::name_hash and StableSourceFileId

This PR adapts the existing `StableSourceFileId` type so that it can be used instead of the `name_hash` field of `SourceFile`. This simplifies a few things that were kind of duplicated before.

The PR should also fix issues rust-lang#112700 and rust-lang#115835, but I was not able to reproduce these issues in a regression test. As far as I can tell, the root cause of these issues is that the id of the originating crate is not hashed in the `HashStable` impl of `Span` and thus cache entries that should have been considered invalidated were loaded. After this PR, the `stable_id` field of `SourceFile` includes information about the originating crate, so that ICE should not occur anymore.
github-actions bot pushed a commit to rust-lang/miri that referenced this issue Dec 26, 2023
…d, r=cjgillot

Unify SourceFile::name_hash and StableSourceFileId

This PR adapts the existing `StableSourceFileId` type so that it can be used instead of the `name_hash` field of `SourceFile`. This simplifies a few things that were kind of duplicated before.

The PR should also fix issues rust-lang/rust#112700 and rust-lang/rust#115835, but I was not able to reproduce these issues in a regression test. As far as I can tell, the root cause of these issues is that the id of the originating crate is not hashed in the `HashStable` impl of `Span` and thus cache entries that should have been considered invalidated were loaded. After this PR, the `stable_id` field of `SourceFile` includes information about the originating crate, so that ICE should not occur anymore.
@michaelwoerister
Copy link
Member

This very likely been fixed by #119139. Please re-open the issue if it is still occurring.

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 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.
Projects
None yet
Development

No branches or pull requests

4 participants