Skip to content

ICE rustc_middle/src/ty/query/on_disk_cache.rs index out of bounds #80577

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

Closed
GuillaumeGomez opened this issue Jan 1, 2021 · 4 comments
Closed
Labels
A-incr-comp Area: Incremental compilation A-spurious Area: Spurious failures in builds (spuriously == for no apparent reason) 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

@GuillaumeGomez
Copy link
Member

Unfortunately, this error seems to appear randomly on my mac (version 10.15.5) with rustc 1.50.0-nightly (d32c320d7 2020-12-10) so I can't provide a shorter code to reproduce it... After running a cargo clean, it works again. This happens when working on sysinfo.

> RUST_BACKTRACE=full cargo test -- --test-threads 1
   Compiling sysinfo v0.15.3 (/Users/imperio/rust/sysinfo)
thread 'rustc' panicked at 'index out of bounds: the len is 34 but the index is 34', compiler/rustc_middle/src/ty/query/on_disk_cache.rs:458:9
stack backtrace:
   0:        0x10fcf511c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hddf67b5e68ee5eac
   1:        0x10fd5c99d - core::fmt::write::hae6418d3f135b639
   2:        0x10fce6d36 - std::io::Write::write_fmt::h822c37b1fbb805d3
   3:        0x10fcf8d99 - std::panicking::default_hook::{{closure}}::hb8c76ec6b2b5fec2
   4:        0x10fcf8920 - std::panicking::default_hook::h9520f36dd50be056
   5:        0x1081b0cd8 - rustc_driver::report_ice::hab08807b07bece61
   6:        0x10fcf957e - std::panicking::rust_panic_with_hook::hbb70e1d25c7381a9
   7:        0x10fcf9085 - std::panicking::begin_panic_handler::{{closure}}::hb72eee9aad2e147c
   8:        0x10fcf55d8 - std::sys_common::backtrace::__rust_end_short_backtrace::h372ff87ecb2667f3
   9:        0x10fcf8fea - _rust_begin_unwind
  10:        0x10fd83c1f - core::panicking::panic_fmt::h261fd45d36f74dfa
  11:        0x10fd83be6 - core::panicking::panic_bounds_check::h351420368676628d
  12:        0x10c4bcd0e - rustc_middle::ty::query::on_disk_cache::OnDiskCache::def_path_hash_to_def_id::h4f93023befb182c6
  13:        0x10c275d6c - rustc_middle::ty::query::force_from_dep_node::h9bfdec7d63e44336
  14:        0x10a9b7e71 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::h10d4dfb26a6f3788
  15:        0x10a9b7e56 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::h10d4dfb26a6f3788
  16:        0x10a9b7e56 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::h10d4dfb26a6f3788
  17:        0x10a9b7e56 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::h10d4dfb26a6f3788
  18:        0x10a9b7e56 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::h10d4dfb26a6f3788
  19:        0x10a9b7e56 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::h10d4dfb26a6f3788
  20:        0x10a9b7e56 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::h10d4dfb26a6f3788
  21:        0x10a9b7e56 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::h10d4dfb26a6f3788
  22:        0x10a9b7b67 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_green_and_read::hcc33643fa422840b
  23:        0x10ab54e3a - rustc_query_system::query::plumbing::ensure_query_impl::h2a35a985b6d954e0
  24:        0x10aacef04 - rustc_typeck::check::typeck_item_bodies::h3b3cfd7be7dac211
  25:        0x10a9946ad - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::typeck_item_bodies>::compute::h909ad4ff4e5bfa13
  26:        0x10a92357a - rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps::hc37e07c92b74a90b
  27:        0x10a9d0416 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task::hce985fa18d8ed435
  28:        0x10a9dcea3 - rustc_data_structures::stack::ensure_sufficient_stack::ha89cd398836304e2
  29:        0x10aaddc94 - rustc_query_system::query::plumbing::get_query_impl::h04501283c38432c0
  30:        0x10aa20801 - rustc_typeck::check_crate::h58474acc135a75e2
  31:        0x1083aaf8b - rustc_interface::passes::analysis::h0925811594003c98
  32:        0x108209aaa - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute::h6ed202cb73ca585d
  33:        0x10820df81 - rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps::hce3a31dd68debf89
  34:        0x1081ed484 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_eval_always_task::h0a922d31d914645d
  35:        0x1081fcfbe - rustc_data_structures::stack::ensure_sufficient_stack::h8d90ce16157a9504
  36:        0x10819c9fa - rustc_query_system::query::plumbing::get_query_impl::h68a4f1557f83d39c
  37:        0x10820e2b6 - rustc_interface::passes::QueryContext::enter::ha00806fa9c6b1509
  38:        0x108162de8 - rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter::hb3cbdf40d2d583ab
  39:        0x1081d12be - rustc_span::with_source_map::h4f73b4651f1d8670
  40:        0x108163d94 - rustc_interface::interface::create_compiler_and_run::ha35d2af54e9355e8
  41:        0x1081f7529 - scoped_tls::ScopedKey<T>::set::h8cb1fe74bd062a4c
  42:        0x1081fd781 - std::sys_common::backtrace::__rust_begin_short_backtrace::h8e2469a9116ebf76
  43:        0x10816b969 - core::ops::function::FnOnce::call_once{{vtable.shim}}::hfc39034b1b021f49
  44:        0x10fd05fdd - std::sys::unix::thread::Thread::new::thread_start::h93dd3097fa4fa219
  45:     0x7fff70d07109 - __pthread_start

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.50.0-nightly (d32c320d7 2020-12-10) running on x86_64-apple-darwin

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type rlib --crate-type cdylib

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

query stack during panic:
#0 [typeck_item_bodies] type-checking all item bodies
#1 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `sysinfo`

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
@GuillaumeGomez GuillaumeGomez added 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. C-bug Category: This is a bug. labels Jan 1, 2021
@camelid camelid added A-incr-comp Area: Incremental compilation A-spurious Area: Spurious failures in builds (spuriously == for no apparent reason) labels Jan 1, 2021
@camelid
Copy link
Member

camelid commented Jan 1, 2021

@GuillaumeGomez you might consider updating to a newer nightly; I know there were some incr. comp. bugs fixed around 2020-12-10 (which is when your nightly is from).

@GuillaumeGomez
Copy link
Member Author

Interesting, thanks for the info! I'll let it open just in case (in case it happens again...) but in the meantime, I'm going to update my nightly version.

@tgnottingham
Copy link
Contributor

Based on the version, file, and line number, this is probably the same as #80151, likely fixed by #79915.

@GuillaumeGomez
Copy link
Member Author

Then let's close it!

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 A-spurious Area: Spurious failures in builds (spuriously == for no apparent reason) 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

3 participants