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

Unexpected panic in compiler/rustc_hir/src/definitions.rs #93317

Closed
yannham opened this issue Jan 26, 2022 · 2 comments
Closed

Unexpected panic in compiler/rustc_hir/src/definitions.rs #93317

yannham opened this issue Jan 26, 2022 · 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

@yannham
Copy link

yannham commented Jan 26, 2022

I got a an unexpected panic when running cargo build on a project using the latest stable version of Rust 1.58.1.

Code

I don't have time right nor a good lead for minimizing the code example for now, but may try to do so later. Sorry about that. For the time being, the offending commit is b13930e1f948b2773f1049fc4724e45306f6f175 on tweag/nickel. The error is triggered by a cargo build at the root of the project.

Meta

rustc --version --verbose:

rustc 1.58.1 (db9d1b20b 2022-01-20)
binary: rustc
commit-hash: db9d1b20bba1968c1ec1fc49616d4742c1725b4b
commit-date: 2022-01-20
host: x86_64-unknown-linux-gnu
release: 1.58.1
LLVM version: 13.0.0

Error output

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/compiler/rustc_hir/src/definitions.rs:452:14

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.58.1 (db9d1b20b 2022-01-20) running on x86_64-unknown-linux-gnu

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

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

query stack during panic:
#0 [analysis] running analysis passes on this crate
end of query stack
Backtrace

stack backtrace:
   0:     0x7f0e88e41e8c - std::backtrace_rs::backtrace::libunwind::trace::h09f7e4e089375279
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f0e88e41e8c - std::backtrace_rs::backtrace::trace_unsynchronized::h1ec96f1c7087094e
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f0e88e41e8c - std::sys_common::backtrace::_print_fmt::h317b71fc9a5cf964
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7f0e88e41e8c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::he3555b48e7dfe7f0
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x7f0e88e9f55c - core::fmt::write::h513b07ca38f4fb1b
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/fmt/mod.rs:1149:17
   5:     0x7f0e88e320d5 - std::io::Write::write_fmt::haf8c932b52111354
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/io/mod.rs:1697:15
   6:     0x7f0e88e44f30 - std::sys_common::backtrace::_print::h195c38364780a303
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x7f0e88e44f30 - std::sys_common::backtrace::print::hc09dfdea923b6730
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x7f0e88e44f30 - std::panicking::default_hook::{{closure}}::hb2e38ec0d91046a3
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/panicking.rs:211:50
   9:     0x7f0e88e44ae5 - std::panicking::default_hook::h60284635b0ad54a8
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/panicking.rs:228:9
  10:     0x7f0e895eeaa1 - rustc_driver[6ad7101a8fabd86e]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7f0e81752193 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h863e64465650e049
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/alloc/src/boxed.rs:1708:9
  12:     0x7f0e817cf5dd - proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}::{{closure}}::hf3c41c0ce1a83fe5
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/proc_macro/src/bridge/client.rs:320:21
  13:     0x7f0e88e45749 - std::panicking::rust_panic_with_hook::ha677a669fb275654
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/panicking.rs:610:17
  14:     0x7f0e88e451d2 - std::panicking::begin_panic_handler::{{closure}}::h976246fb95d93c31
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/panicking.rs:500:13
  15:     0x7f0e88e42334 - std::sys_common::backtrace::__rust_end_short_backtrace::h38077ee5b7b9f99a
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/sys_common/backtrace.rs:139:18
  16:     0x7f0e88e45169 - rust_begin_unwind
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/panicking.rs:498:5
  17:     0x7f0e88e094b1 - core::panicking::panic_fmt::h35f3a62252ba0fd2
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/panicking.rs:107:14
  18:     0x7f0e88e093fd - core::panicking::panic::h86fc01e270142a61
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/panicking.rs:48:5
  19:     0x7f0e8b0d693e - <rustc_middle[26370726012d1bf2]::ty::context::TyCtxt>::def_path_hash_to_def_id
  20:     0x7f0e8b111182 - <rustc_query_system[3616b1a045b1904c]::dep_graph::dep_node::DepNode<rustc_middle[26370726012d1bf2]::dep_graph::dep_node::DepKind> as rustc_middle[26370726012d1bf2]::dep_graph::dep_node::DepNodeExt>::extract_def_id
  21:     0x7f0e8b7be19e - rustc_query_impl[4fd9530611cf4d08]::query_callbacks::hir_owner::force_from_dep_node
  22:     0x7f0e8baea801 - <rustc_middle[26370726012d1bf2]::ty::context::TyCtxt as rustc_query_system[3616b1a045b1904c]::dep_graph::DepContext>::try_force_from_dep_node
  23:     0x7f0e8add7e2c - <rustc_query_system[3616b1a045b1904c]::dep_graph::graph::DepGraph<rustc_middle[26370726012d1bf2]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[4fd9530611cf4d08]::plumbing::QueryCtxt>
  24:     0x7f0e8add7dfd - <rustc_query_system[3616b1a045b1904c]::dep_graph::graph::DepGraph<rustc_middle[26370726012d1bf2]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[4fd9530611cf4d08]::plumbing::QueryCtxt>
  25:     0x7f0e8add7dfd - <rustc_query_system[3616b1a045b1904c]::dep_graph::graph::DepGraph<rustc_middle[26370726012d1bf2]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[4fd9530611cf4d08]::plumbing::QueryCtxt>
  26:     0x7f0e8add7dfd - <rustc_query_system[3616b1a045b1904c]::dep_graph::graph::DepGraph<rustc_middle[26370726012d1bf2]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[4fd9530611cf4d08]::plumbing::QueryCtxt>
  27:     0x7f0e8add7dfd - <rustc_query_system[3616b1a045b1904c]::dep_graph::graph::DepGraph<rustc_middle[26370726012d1bf2]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[4fd9530611cf4d08]::plumbing::QueryCtxt>
  28:     0x7f0e8add7dfd - <rustc_query_system[3616b1a045b1904c]::dep_graph::graph::DepGraph<rustc_middle[26370726012d1bf2]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[4fd9530611cf4d08]::plumbing::QueryCtxt>
  29:     0x7f0e8ad2ec19 - rustc_query_system[3616b1a045b1904c]::query::plumbing::ensure_must_run::<rustc_query_impl[4fd9530611cf4d08]::plumbing::QueryCtxt, rustc_span[c29ad455a793da3]::def_id::LocalDefId, &rustc_middle[26370726012d1bf2]::ty::context::TypeckResults>
  30:     0x7f0e8ad76c18 - rustc_query_system[3616b1a045b1904c]::query::plumbing::get_query::<rustc_query_impl[4fd9530611cf4d08]::queries::mir_borrowck, rustc_query_impl[4fd9530611cf4d08]::plumbing::QueryCtxt>
  31:     0x7f0e8a8356ed - <rustc_middle[26370726012d1bf2]::hir::map::Map>::par_body_owners::<rustc_interface[2c1d684caca70d53]::passes::analysis::{closure#2}::{closure#0}>
  32:     0x7f0e8b1c494a - rustc_interface[2c1d684caca70d53]::passes::analysis
  33:     0x7f0e8b7f6bb0 - <rustc_query_system[3616b1a045b1904c]::dep_graph::graph::DepGraph<rustc_middle[26370726012d1bf2]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[26370726012d1bf2]::ty::context::TyCtxt, (), core[7435606f1c80df2a]::result::Result<(), rustc_errors[5befc41d352b3f14]::ErrorReported>>
  34:     0x7f0e8b75abd3 - rustc_data_structures[a6a643d2c4658522]::stack::ensure_sufficient_stack::<(core[7435606f1c80df2a]::result::Result<(), rustc_errors[5befc41d352b3f14]::ErrorReported>, rustc_query_system[3616b1a045b1904c]::dep_graph::graph::DepNodeIndex), rustc_query_system[3616b1a045b1904c]::query::plumbing::execute_job<rustc_query_impl[4fd9530611cf4d08]::plumbing::QueryCtxt, (), core[7435606f1c80df2a]::result::Result<(), rustc_errors[5befc41d352b3f14]::ErrorReported>>::{closure#3}>
  35:     0x7f0e8b6c579c - rustc_query_system[3616b1a045b1904c]::query::plumbing::try_execute_query::<rustc_query_impl[4fd9530611cf4d08]::plumbing::QueryCtxt, rustc_query_system[3616b1a045b1904c]::query::caches::DefaultCache<(), core[7435606f1c80df2a]::result::Result<(), rustc_errors[5befc41d352b3f14]::ErrorReported>>>
  36:     0x7f0e8b773265 - <rustc_query_impl[4fd9530611cf4d08]::Queries as rustc_middle[26370726012d1bf2]::ty::query::QueryEngine>::analysis
  37:     0x7f0e8b1b8699 - <rustc_interface[2c1d684caca70d53]::passes::QueryContext>::enter::<rustc_driver[6ad7101a8fabd86e]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[7435606f1c80df2a]::result::Result<(), rustc_errors[5befc41d352b3f14]::ErrorReported>>
  38:     0x7f0e8b18ffd7 - <rustc_interface[2c1d684caca70d53]::interface::Compiler>::enter::<rustc_driver[6ad7101a8fabd86e]::run_compiler::{closure#1}::{closure#2}, core[7435606f1c80df2a]::result::Result<core[7435606f1c80df2a]::option::Option<rustc_interface[2c1d684caca70d53]::queries::Linker>, rustc_errors[5befc41d352b3f14]::ErrorReported>>
  39:     0x7f0e8b18bed4 - rustc_span[c29ad455a793da3]::with_source_map::<core[7435606f1c80df2a]::result::Result<(), rustc_errors[5befc41d352b3f14]::ErrorReported>, rustc_interface[2c1d684caca70d53]::interface::create_compiler_and_run<core[7435606f1c80df2a]::result::Result<(), rustc_errors[5befc41d352b3f14]::ErrorReported>, rustc_driver[6ad7101a8fabd86e]::run_compiler::{closure#1}>::{closure#1}>
  40:     0x7f0e8b190e2f - <scoped_tls[66f88778b59ce329]::ScopedKey<rustc_span[c29ad455a793da3]::SessionGlobals>>::set::<rustc_interface[2c1d684caca70d53]::util::setup_callbacks_and_run_in_thread_pool_with_globals<rustc_interface[2c1d684caca70d53]::interface::run_compiler<core[7435606f1c80df2a]::result::Result<(), rustc_errors[5befc41d352b3f14]::ErrorReported>, rustc_driver[6ad7101a8fabd86e]::run_compiler::{closure#1}>::{closure#0}, core[7435606f1c80df2a]::result::Result<(), rustc_errors[5befc41d352b3f14]::ErrorReported>>::{closure#0}::{closure#0}, core[7435606f1c80df2a]::result::Result<(), rustc_errors[5befc41d352b3f14]::ErrorReported>>
  41:     0x7f0e8b18ef65 - std[b2a2bae5f6ca25d7]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[2c1d684caca70d53]::util::setup_callbacks_and_run_in_thread_pool_with_globals<rustc_interface[2c1d684caca70d53]::interface::run_compiler<core[7435606f1c80df2a]::result::Result<(), rustc_errors[5befc41d352b3f14]::ErrorReported>, rustc_driver[6ad7101a8fabd86e]::run_compiler::{closure#1}>::{closure#0}, core[7435606f1c80df2a]::result::Result<(), rustc_errors[5befc41d352b3f14]::ErrorReported>>::{closure#0}, core[7435606f1c80df2a]::result::Result<(), rustc_errors[5befc41d352b3f14]::ErrorReported>>
  42:     0x7f0e8b1b915a - <<std[b2a2bae5f6ca25d7]::thread::Builder>::spawn_unchecked<rustc_interface[2c1d684caca70d53]::util::setup_callbacks_and_run_in_thread_pool_with_globals<rustc_interface[2c1d684caca70d53]::interface::run_compiler<core[7435606f1c80df2a]::result::Result<(), rustc_errors[5befc41d352b3f14]::ErrorReported>, rustc_driver[6ad7101a8fabd86e]::run_compiler::{closure#1}>::{closure#0}, core[7435606f1c80df2a]::result::Result<(), rustc_errors[5befc41d352b3f14]::ErrorReported>>::{closure#0}, core[7435606f1c80df2a]::result::Result<(), rustc_errors[5befc41d352b3f14]::ErrorReported>>::{closure#1} as core[7435606f1c80df2a]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  43:     0x7f0e88e50fc3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hcbc6d2d80772be64
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/alloc/src/boxed.rs:1694:9
  44:     0x7f0e88e50fc3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h9bffa2ca65a1d6e6
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/alloc/src/boxed.rs:1694:9
  45:     0x7f0e88e50fc3 - std::sys::unix::thread::Thread::new::thread_start::ha678a8b0caec8f55
                               at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/sys/unix/thread.rs:106:17
  46:     0x7f0e88d68d80 - start_thread
                               at ./nptl/./nptl/pthread_create.c:481:8
  47:     0x7f0e88c7fbdf - __GI___clone
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95
  48:                0x0 - <unknown>

@yannham yannham 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 Jan 26, 2022
@yannham
Copy link
Author

yannham commented Jan 26, 2022

After some more research, it is a possible duplicate of #93125, #93096, #93020 and #93013. Feel free to close if it is. a cargo clean did fix it, and the bug is not triggered on the CI (although the CI is using Nix, so a possibly different version of stable rustc).

@hkratz
Copy link
Contributor

hkratz commented Jan 27, 2022

@rustbot label A-incr-comp

@rustbot rustbot added the A-incr-comp Area: Incremental compilation label Jan 27, 2022
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