Skip to content

ICE compiler/rustc_metadata/src/rmeta/def_path_hash_map.rs:23:85 on stable #103156

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
ijackson opened this issue Oct 17, 2022 · 3 comments
Closed
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

@ijackson
Copy link
Contributor

Code

I don't have a minimal repro. Moving target aside makes the bug go away. Putting the "busted" target back makes it reappear, so this looks like an incremental compilation bug. The target directory in question is 42Gb.

I was running cargo clippy. Switching to cargo check makes the bug go away.

The error message is:

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler/rustc_metadata/src/rmeta/def_path_hash_map.rs:23:85

I think this is probably #100521 but here it's happening on stable.

For my reference: this occurs with arti#8b7a07d7ea36128b9c397cd50d0092c14cda921e. I have saved target as /volatile/rustcargo/Rustup/Arti/Bug-ICE-2022-10-17-target. My build rune is in the stack trace below.

Meta

rustc --version --verbose:

rustcargo@zealot:/volatile/rustcargo/Rustup/Arti$ rustc +stable --version --verbose
rustc 1.64.0 (a55dd71d5 2022-09-19)
binary: rustc
commit-hash: a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52
commit-date: 2022-09-19
host: x86_64-unknown-linux-gnu
release: 1.64.0
LLVM version: 14.0.6
rustcargo@zealot:/volatile/rustcargo/Rustup/Arti$ 

Error output

nailing-cargo: out-of-tree, building in: `/home/ian/Rustup/Arti/Build/arti'
nailing-cargo: using really to run as user `rustcargo'
nailing-cargo: *WARNING* cwd is not in Cargo.nail thbough it has Cargo.toml!
nailing-cargo: nailed (0 manifests, 0 packages)
nailing-cargo: invoking: cargo +stable clippy --manifest-path=/home/ian/Rustup/Arti/arti/Cargo.toml --locked --target-dir=target --workspace --all-features
warning: variant `DirSpecificRelay` is never constructed
   --> crates/tor-circmgr/src/usage.rs:167:5
    |
131 | pub(crate) enum TargetCircUsage {
    |                 --------------- variant in this enum
...
167 |     DirSpecificRelay(OwnedChanTarget),
    |     ^^^^^^^^^^^^^^^^
    |
    = note: `#[warn(dead_code)]` on by default
    = note: `TargetCircUsage` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis

warning: `tor-circmgr` (lib) generated 1 warning
    Checking arti-client v0.7.0 (/home/ian/Rustup/Arti/arti/crates/arti-client)
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler/rustc_metadata/src/rmeta/def_path_hash_map.rs:23:85
stack backtrace:
...
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-clippy/issues/new

note: Clippy version: clippy 0.1.64 (a55dd71 2022-09-19)

query stack during panic:
#0 [evaluate_obligation] evaluating trait selection obligation `weak_table::PtrWeakHashSet<alloc::sync::Weak<tor_circmgr::mgr::PendingEntry<tor_circmgr::build::CircuitBuilder<tor_rtcompat::PreferredRuntime>>>>: core::marker::Send`
#1 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `arti-client`
nailing-cargo: really failed (exit status 25856)
nailing-cargo: unnailed.  status 101.
Backtrace

-*- mode: compilation; default-directory: "~/Rustup/Arti/arti/" -*-
Compilation started at Mon Oct 17 18:37:47

set -e; p='--workspace'; xp='-p tor-chanmgr'; p="$p --all-features"; export RUST_BACKTRACE=1; nailing-cargo -o +stable clippy $p # check $p # clippy $p # test $p -- --nocapture # layers #
nailing-cargo: out-of-tree, building in: `/home/ian/Rustup/Arti/Build/arti'
nailing-cargo: using really to run as user `rustcargo'
nailing-cargo: *WARNING* cwd is not in Cargo.nail thbough it has Cargo.toml!
nailing-cargo: nailed (0 manifests, 0 packages)
nailing-cargo: invoking: cargo +stable clippy --manifest-path=/home/ian/Rustup/Arti/arti/Cargo.toml --locked --target-dir=target --workspace --all-features
warning: variant `DirSpecificRelay` is never constructed
   --> crates/tor-circmgr/src/usage.rs:167:5
    |
131 | pub(crate) enum TargetCircUsage {
    |                 --------------- variant in this enum
...
167 |     DirSpecificRelay(OwnedChanTarget),
    |     ^^^^^^^^^^^^^^^^
    |
    = note: `#[warn(dead_code)]` on by default
    = note: `TargetCircUsage` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis

warning: `tor-circmgr` (lib) generated 1 warning
    Checking arti-client v0.7.0 (/home/ian/Rustup/Arti/arti/crates/arti-client)
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler/rustc_metadata/src/rmeta/def_path_hash_map.rs:23:85
stack backtrace:
   0: rust_begin_unwind
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/panicking.rs:142:14
   2: core::panicking::panic
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/panicking.rs:48:5
   3: <rustc_metadata::creader::CStore as rustc_session::cstore::CrateStore>::def_path_hash_to_def_id
   4: <rustc_query_system::dep_graph::dep_node::DepNode<rustc_middle::dep_graph::dep_node::DepKind> as rustc_middle::dep_graph::dep_node::DepNodeExt>::extract_def_id
   5: rustc_query_impl::query_callbacks::type_of::force_from_dep_node
   6: <rustc_middle::ty::context::TyCtxt as rustc_query_system::dep_graph::DepContext>::try_force_from_dep_node
   7: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
   8: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
   9: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  10: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  11: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  12: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  13: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  14: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  15: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  16: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  17: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  18: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  19: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  20: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  21: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl::plumbing::QueryCtxt>
  22: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::evaluate_obligation, rustc_query_impl::plumbing::QueryCtxt>
  23: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::evaluate_obligation
  24: <rustc_trait_selection::traits::fulfill::FulfillProcessor as rustc_data_structures::obligation_forest::ObligationProcessor>::process_obligation
  25: <rustc_data_structures::obligation_forest::ObligationForest<rustc_trait_selection::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection::traits::fulfill::FulfillProcessor, rustc_data_structures::obligation_forest::Outcome<rustc_trait_selection::traits::fulfill::PendingPredicateObligation, rustc_infer::traits::FulfillmentErrorCode>>
  26: <rustc_trait_selection::traits::fulfill::FulfillmentContext as rustc_infer::traits::engine::TraitEngine>::select_all_or_error
  27: <rustc_infer::infer::InferCtxtBuilder>::enter::<alloc::vec::Vec<rustc_infer::traits::FulfillmentError>, <clippy_lints::future_not_send::FutureNotSend as rustc_lint::passes::LateLintPass>::check_fn::{closure#0}>
  28: <clippy_lints::future_not_send::FutureNotSend as rustc_lint::passes::LateLintPass>::check_fn
  29: <rustc_lint::late::LateLintPassObjects as rustc_lint::passes::LateLintPass>::check_fn
  30: <rustc_lint::late::LateContextAndPass<rustc_lint::late::LateLintPassObjects> as rustc_hir::intravisit::Visitor>::visit_fn
  31: rustc_hir::intravisit::walk_impl_item::<rustc_lint::late::LateContextAndPass<rustc_lint::late::LateLintPassObjects>>
  32: <rustc_lint::late::LateContextAndPass<rustc_lint::late::LateLintPassObjects> as rustc_hir::intravisit::Visitor>::visit_nested_impl_item
  33: rustc_hir::intravisit::walk_item::<rustc_lint::late::LateContextAndPass<rustc_lint::late::LateLintPassObjects>>
  34: <rustc_lint::late::LateContextAndPass<rustc_lint::late::LateLintPassObjects> as rustc_hir::intravisit::Visitor>::visit_nested_item
  35: rustc_hir::intravisit::walk_mod::<rustc_lint::late::LateContextAndPass<rustc_lint::late::LateLintPassObjects>>
  36: <rustc_lint::late::LateContextAndPass<rustc_lint::late::LateLintPassObjects> as rustc_hir::intravisit::Visitor>::visit_nested_item
  37: rustc_hir::intravisit::walk_mod::<rustc_lint::late::LateContextAndPass<rustc_lint::late::LateLintPassObjects>>
  38: rustc_lint::late::late_lint_pass_crate::<rustc_lint::late::LateLintPassObjects>
  39: rustc_lint::late::late_lint_crate::<rustc_lint::BuiltinCombinedLateLintPass>
  40: <rustc_session::session::Session>::time::<(), rustc_lint::late::check_crate<rustc_lint::BuiltinCombinedLateLintPass, rustc_interface::passes::analysis::{closure#5}::{closure#1}::{closure#2}::{closure#0}::{closure#0}>::{closure#0}::{closure#0}>
  41: <core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#5}::{closure#1}::{closure#2}> as core::ops::function::FnOnce<()>>::call_once
  42: <core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#5}::{closure#1}> as core::ops::function::FnOnce<()>>::call_once
  43: <rustc_session::session::Session>::time::<(), rustc_interface::passes::analysis::{closure#5}>
  44: rustc_interface::passes::analysis
  45: <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::ErrorGuaranteed>>
  46: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<(), core::result::Result<(), rustc_errors::ErrorGuaranteed>>>
  47: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
  48: <rustc_interface::passes::QueryContext>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}::{closure#3}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
  49: <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::ErrorGuaranteed>>
  50: rustc_span::with_source_map::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_interface::interface::create_compiler_and_run<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#1}>
  51: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
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-clippy/issues/new

note: Clippy version: clippy 0.1.64 (a55dd71 2022-09-19)

query stack during panic:
#0 [evaluate_obligation] evaluating trait selection obligation `weak_table::PtrWeakHashSet<alloc::sync::Weak<tor_circmgr::mgr::PendingEntry<tor_circmgr::build::CircuitBuilder<tor_rtcompat::PreferredRuntime>>>>: core::marker::Send`
#1 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `arti-client`
nailing-cargo: really failed (exit status 25856)
nailing-cargo: unnailed.  status 101.

Compilation exited abnormally with code 101 at Mon Oct 17 18:37:48

@ijackson ijackson 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 Oct 17, 2022
@ijackson
Copy link
Contributor Author

@rustbot modify labels +A-incr-comp

@rustbot rustbot added the A-incr-comp Area: Incremental compilation label Oct 17, 2022
@TaKO8Ki TaKO8Ki added the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Oct 17, 2022
@Noratrieb
Copy link
Member

Noratrieb commented Oct 17, 2022

This is probably still happening on stable because the fix hasn't been released to stable yet I think

@workingjubilee
Copy link
Member

The fix in question has landed and I am going to benignly assume that this issue is now resolved and redundant. And if I am wrong, sketchy incremental compilation errors like this will resurface soon enough.

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

5 participants