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

Nightly internal compiler error in def_path_hash_map.rs #89361

Closed
Nutomic opened this issue Sep 29, 2021 · 8 comments
Closed

Nightly internal compiler error in def_path_hash_map.rs #89361

Nutomic opened this issue Sep 29, 2021 · 8 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

@Nutomic
Copy link

Nutomic commented Sep 29, 2021

I'm hitting an internal compiler error in the latest nightly (cargo 1.57). The same code compiles fine on stable, and also on the previous nightly I used (not sure which version it was). Sorry I dont have time to create a minimal example, as this problem occurs in a quite large project.

To reproduce

git clone https://github.com/LemmyNet/lemmy.git
cd lemmy
cargo build

Meta

rustc --version --verbose:

cargo 1.57.0-nightly (0121d66aa 2021-09-22)
release: 1.57.0
commit-hash: 0121d66aa2ef5ffa9735f86c2b56f5fdc5a837a6
commit-date: 2021-09-22

Error output

~/workspace/lemmy ~/workspace/lemmy/api_tests
Compiling lemmy_db_schema v0.12.2-rc.1 (/home/felix/workspace/lemmy/crates/db_schema)
Compiling lemmy_utils v0.12.2-rc.1 (/home/felix/workspace/lemmy/crates/utils)
Compiling lemmy_db_queries v0.12.2-rc.1 (/home/felix/workspace/lemmy/crates/db_queries)
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler/rustc_metadata/src/rmeta/def_path_hash_map.rs:18:85
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/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.57.0-nightly (8f8092cc3 2021-09-28) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=0 -C incremental --crate-type lib

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

query stack during panic:
#0 [evaluate_obligation] evaluating trait selection obligation `diesel::query_builder::update_statement::UpdateStatement<lemmy_db_schema::schema::site::table, diesel::query_builder::where_clause::WhereClause<diesel::expression::operators::Eq<lemmy_db_schema::schema::site::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>, (diesel::query_builder::update_statement::changeset::Assign<lemmy_db_schema::schema::site::columns::creator_id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>, diesel::query_builder::update_statement::changeset::Assign<lemmy_db_schema::schema::site::columns::updated, diesel::expression::bound::Bound<diesel::sql_types::Nullable<diesel::sql_types::Timestamp>, chrono::naive::datetime::NaiveDateTime>>)>: diesel::query_builder::AsQuery`
#1 [typeck] type-checking `source::site::<impl at crates/db_queries/src/source/site.rs:35:1: 47:2>::transfer`
end of query stack
error: could not compile `lemmy_db_queries`
Backtrace

0: rust_begin_unwind
at /rustc/8f8092cc32ec171becef8ceacec7dbb06c5d7d7e/library/std/src/panicking.rs:517:5
1: core::panicking::panic_fmt
at /rustc/8f8092cc32ec171becef8ceacec7dbb06c5d7d7e/library/core/src/panicking.rs:100:14
2: core::panicking::panic
at /rustc/8f8092cc32ec171becef8ceacec7dbb06c5d7d7e/library/core/src/panicking.rs:50:5
3: rustc_metadata::rmeta::decoder::cstore_impl::<impl rustc_middle::middle::cstore::CrateStore for rustc_metadata::creader::CStore>::def_path_hash_to_def_id
4: <rustc_query_impl::on_disk_cache::OnDiskCache as rustc_middle::ty::context::OnDiskCache>::def_path_hash_to_def_id
5: rustc_middle::dep_graph::dep_node::<impl rustc_query_system::dep_graph::dep_node::DepNodeParams<rustc_middle::ty::context::TyCtxt> for rustc_span::def_id::DefId>::recover
6: rustc_query_system::query::plumbing::force_query
7: rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green
8: rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green
9: rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green
10: rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green
11: rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green
12: rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green
13: rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green
14: rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green
15: rustc_data_structures::stack::ensure_sufficient_stack
16: rustc_query_system::query::plumbing::get_query
17: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::evaluate_obligation
18: rustc_trait_selection::traits::fulfill::FulfillProcessor::progress_changed_obligations
19: rustc_data_structures::obligation_forest::ObligationForest<O>::process_obligations
20: <rustc_trait_selection::traits::fulfill::FulfillmentContext as rustc_infer::traits::engine::TraitEngine>::select_with_constness_where_possible
21: rustc_typeck::check::fn_ctxt::checks::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_argument_types
22: rustc_typeck::check::fn_ctxt::checks::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_method_argument_types
23: rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
24: rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
25: rustc_typeck::check::fn_ctxt::checks::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_block_with_expected
26: rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
27: rustc_typeck::check::expr::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
28: rustc_typeck::check::check::check_fn
29: rustc_infer::infer::InferCtxtBuilder::enter
30: rustc_typeck::check::typeck
31: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task
32: rustc_data_structures::stack::ensure_sufficient_stack
33: rustc_query_system::query::plumbing::try_execute_query
34: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck
35: rustc_middle::ty::<impl rustc_middle::ty::context::TyCtxt>::par_body_owners
36: rustc_typeck::check::typeck_item_bodies
37: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task
38: rustc_data_structures::stack::ensure_sufficient_stack
39: rustc_query_system::query::plumbing::try_execute_query
40: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck_item_bodies
41: rustc_session::utils::<impl rustc_session::session::Session>::time
42: rustc_typeck::check_crate
43: rustc_interface::passes::analysis
44: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task
45: rustc_data_structures::stack::ensure_sufficient_stack
46: rustc_query_system::query::plumbing::try_execute_query
47: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
48: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
49: rustc_span::with_source_map
50: rustc_interface::interface::create_compiler_and_run

@Nutomic Nutomic 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 Sep 29, 2021
@Aaron1011
Copy link
Member

cc @michaelwoerister

@rcgoodfellow
Copy link

FWIW I was hitting this (and seemingly this #89209) with

rustc 1.57.0-nightly (308dffd25 2021-09-22)
binary: rustc
commit-hash: 308dffd25cb55bbb4a1fbee9822cf82c6a5d012d
commit-date: 2021-09-22
host: x86_64-unknown-illumos
release: 1.57.0-nightly
LLVM version: 13.0.0

but things are now working for me with

rustc 1.57.0-nightly (25ec82738 2021-10-05)
binary: rustc
commit-hash: 25ec8273855fde2d72ae877b397e054de5300e10
commit-date: 2021-10-05
host: x86_64-unknown-illumos
release: 1.57.0-nightly
LLVM version: 13.0.0

@teor2345

This comment has been minimized.

@Nutomic
Copy link
Author

Nutomic commented Oct 8, 2021

For me the problem has been fixed after upgrading cargo, so the bug seems fixed in the following version.

cargo 1.57.0-nightly (d56b42c54 2021-09-27)
release: 1.57.0
commit-hash: d56b42c549dbb7e7d0f712c51b39400260d114d4
commit-date: 2021-09-27

@teor2345
Copy link
Contributor

teor2345 commented Oct 10, 2021

I'm still seeing a similar ICE on rustc 1.57.0-nightly (25ec827 2021-10-05)

I might be seeing a different trigger for the same panic location.

I'm seeing it when building https://github.com/ZcashFoundation/zebra , but only when the on-disk cache is in a particular state. (Approximately every ~100 builds.)

So I can't provide an easy reproduction.

Edit: my backtrace seems more similar to #89457 and #89260 than this ticket.

@JohnTitor JohnTitor added the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Nov 8, 2021
@BGR360
Copy link
Contributor

BGR360 commented Dec 21, 2021

@rustbot label +A-incr-comp

@rustbot rustbot added the A-incr-comp Area: Incremental compilation label Dec 21, 2021
@istankovic
Copy link
Contributor

@Nutomic is this still relevant?

@Nutomic
Copy link
Author

Nutomic commented Oct 23, 2023

No, I didnt have this problem anymore after upgrading the nightly version. Feel free to close.

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. 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

9 participants