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

thread 'rustc' panicked at 'called Option::unwrap() on a None value' #91511

Closed
rainliu opened this issue Dec 4, 2021 · 6 comments
Closed

thread 'rustc' panicked at 'called Option::unwrap() on a None value' #91511

rainliu opened this issue Dec 4, 2021 · 6 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

@rainliu
Copy link

rainliu commented Dec 4, 2021

Code

[<code>](https://github.com/webrtc-rs/sctp/commit/7d58b8b2b701e190795fe52a540b24937012269d)

Meta

rustc --version --verbose:

rustc 1.57.0 (f1edd0429 2021-11-29) running on x86_64-unknown-linux-gnu

Error output

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

Backtrace

Checking sctp-proto v0.0.0 (/home/yliu/rust/webrtc-rs/webrtc/crates/sctp/sctp-proto)
thread 'rustc' panicked at 'called Option::unwrap() on a None value', /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/compiler/rustc_hir/src/definitions.rs:452:14
stack backtrace:
0: 0x7ff751bc1a9c - std::backtrace_rs::backtrace::libunwind::trace::hf6a6dfd7da937cb0
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
1: 0x7ff751bc1a9c - std::backtrace_rs::backtrace::trace_unsynchronized::hc596a19e4891f7f3
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: 0x7ff751bc1a9c - std::sys_common::backtrace::_print_fmt::hb16700db31584325
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/sys_common/backtrace.rs:67:5
3: 0x7ff751bc1a9c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h231c4190cfa75162
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/sys_common/backtrace.rs:46:22
4: 0x7ff751c1efdc - core::fmt::write::h2a1462b5f8eea807
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/fmt/mod.rs:1163:17
5: 0x7ff751bb1c05 - std::io::Write::write_fmt::h71ddfebc68685972
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/io/mod.rs:1696:15
6: 0x7ff751bc4f60 - std::sys_common::backtrace::_print::hcc197d4bebf2b369
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/sys_common/backtrace.rs:49:5
7: 0x7ff751bc4f60 - std::sys_common::backtrace::print::h335a66af06738c7c
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/sys_common/backtrace.rs:36:9
8: 0x7ff751bc4f60 - std::panicking::default_hook::{{closure}}::h6fac9ac9c8b79e52
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:210:50
9: 0x7ff751bc4b15 - std::panicking::default_hook::h341c1030c6a1161b
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:227:9
10: 0x55d66891b339 - clippy_driver::ICE_HOOK::{{closure}}::{{closure}}::h161f3201ca55bc81
11: 0x7ff73bb9c183 - <alloc::boxed::Box<F,A> as core::ops::function::Fn>::call::h363c824e187f76f1
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/alloc/src/boxed.rs:1705:9
12: 0x7ff73bba4b6d - proc_macro::bridge::client::::enter::{{closure}}::{{closure}}::h100005456d848b32
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/proc_macro/src/bridge/client.rs:320:21
13: 0x7ff751bc5779 - std::panicking::rust_panic_with_hook::h50680ff4b44510c6
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:628:17
14: 0x7ff751bc5202 - std::panicking::begin_panic_handler::{{closure}}::h9371c0fbb1e8465a
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:519:13
15: 0x7ff751bc1f44 - std::sys_common::backtrace::__rust_end_short_backtrace::h9b3efa22a5768c0f
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/sys_common/backtrace.rs:139:18
16: 0x7ff751bc5199 - rust_begin_unwind
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:517:5
17: 0x7ff751b89441 - core::panicking::panic_fmt::h23b9203e89cc61cf
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/panicking.rs10014
18: 0x7ff751b8938d - core::panicking::panic::h0ba7146865b2f9d6
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/panicking.rs:50:5
19: 0x7ff753bb4b47 - <rustc_query_impl::on_disk_cache::OnDiskCache as rustc_middle::ty::context::OnDiskCache>::def_path_hash_to_def_id::hb925ab58899dddff
20: 0x7ff753f20b21 - 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::LocalDefId>::recover::h2e76aa40aab4da19
21: 0x7ff7545ab52c - rustc_query_impl::query_callbacks::hir_owner::force_from_dep_node::hc7fd02f51ac51090
22: 0x7ff753b9fd6a - rustc_query_system::dep_graph::graph::DepGraph::try_mark_previous_green::h14b50df9818693f3
23: 0x7ff753b9fd41 - rustc_query_system::dep_graph::graph::DepGraph::try_mark_previous_green::h14b50df9818693f3
24: 0x7ff753b9fd41 - rustc_query_system::dep_graph::graph::DepGraph::try_mark_previous_green::h14b50df9818693f3
25: 0x7ff753b9fd41 - rustc_query_system::dep_graph::graph::DepGraph::try_mark_previous_green::h14b50df9818693f3
26: 0x7ff753afe234 - rustc_query_system::query::plumbing::ensure_must_run::h5874d260d5ffefca
27: 0x7ff7545b9430 - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::coherent_trait::hef06870853770eff
28: 0x7ff753778bf6 - rustc_session::session::Session::track_errors::hd7a6334bb75371c9
29: 0x7ff75425c448 - rustc_typeck::check_crate::h6215961d94aab927
30: 0x7ff753fbb0a0 - rustc_interface::passes::analysis::h9fda1a8ae44d53e7
31: 0x7ff7545d53cf - rustc_query_system::dep_graph::graph::DepGraph::with_task::h26e86d963a73dec8
32: 0x7ff75457a609 - rustc_data_structures::stack::ensure_sufficient_stack::h135baf7277c4d193
33: 0x7ff75449ea7b - rustc_query_system::query::plumbing::try_execute_query::h0bf7639d3f58bfbd
34: 0x7ff7545b7232 - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis::ha2144cf05b40d10d
35: 0x7ff753fafca9 - rustc_interface::passes::QueryContext::enter::h0523b23606206a0b
36: 0x7ff753f96977 - rustc_interface::queries::::enter::hf84cd18c24bd5171
37: 0x7ff753f840ee - rustc_span::with_source_map::h6ab8a240e103b5b9
38: 0x7ff753f962ac - scoped_tls::ScopedKey::set::hd1fbd64c6f645895
39: 0x7ff753f84ef5 - std::sys_common::backtrace::__rust_begin_short_backtrace::h0a1328c9fa7f7448
40: 0x7ff753fb0962 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h4ea1ced06d6b3e97
41: 0x7ff751bd0933 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce>::call_once::h7bd677a5dc988be6
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/alloc/src/boxed.rs:1691:9
42: 0x7ff751bd0933 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce>::call_once::h7b1c1ba11c4db785
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/alloc/src/boxed.rs:1691:9
43: 0x7ff751bd0933 - std::sys::unix:thread:Thread:new:thread_start::h9c58c0d12d84e854
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/sys/unix/thread.rs:106:17
44: 0x7ff751880927 - start_thread
at ./nptl/./nptl/pthread_create.c:435:8
45: 0x7ff7519109e4 - __clone
at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:100
46: 0x0 -

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.57 (f1edd04 2021-11-29)

query stack during panic:
#0 [analysis] running analysis passes on this crate
end of query stack
error: could not compile sctp-proto

@rainliu rainliu 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 Dec 4, 2021
@rainliu
Copy link
Author

rainliu commented Dec 4, 2021

nightly works fine.

nightly-x86_64-unknown-linux-gnu unchanged - rustc 1.59.0-nightly (acbe444 2021-12-02)

@mibes
Copy link

mibes commented Dec 4, 2021

Just experienced the same, running trunk serve on a yew project:

Backtrace
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/compiler/rustc_hir/src/definitions.rs:452:14
stack backtrace:
   0:        0x10e40a321 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h4edbddd26fc45697
   1:        0x10e45b4bb - core::fmt::write::h266c957f12b1655a
   2:        0x10e3fad3a - std::io::Write::write_fmt::h65d4ee621e8d810d
   3:        0x10e40d585 - std::panicking::default_hook::{{closure}}::h5b4886cd9f93dfca
   4:        0x10e40d16f - std::panicking::default_hook::h986d152c7bd7e732
   5:        0x1063977c8 - rustc_driver::DEFAULT_HOOK::{{closure}}::{{closure}}::h997411fe6ff6a285
   6:        0x10e40ddc6 - std::panicking::rust_panic_with_hook::h151f3b3bf37b4f17
   7:        0x10e40d814 - std::panicking::begin_panic_handler::{{closure}}::hf6660086d9ebd48c
   8:        0x10e40a797 - std::sys_common::backtrace::__rust_end_short_backtrace::h34152178ea368a9a
   9:        0x10e40d7aa - _rust_begin_unwind
  10:        0x10e48605f - core::panicking::panic_fmt::hb64a2db862b4aca0
  11:        0x10e485fb7 - core::panicking::panic::h709f8bbcee9c47c1
  12:        0x109bf8fba - <rustc_query_impl::on_disk_cache::OnDiskCache as rustc_middle::ty::context::OnDiskCache>::def_path_hash_to_def_id::hb730d16bcb9182b2
  13:        0x10a83c49c - 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::LocalDefId>::recover::hffc4e6a0830f2648
  14:        0x109aecbe0 - rustc_query_impl::query_callbacks::hir_owner::force_from_dep_node::h1e753a243eb0fce7
  15:        0x109b60a79 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::h5ec984268becc2ed
  16:        0x109b60a50 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::h5ec984268becc2ed
  17:        0x109b60a50 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::h5ec984268becc2ed
  18:        0x109b60a50 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::h5ec984268becc2ed
  19:        0x109b20beb - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_green::h29c934006e707d96
  20:        0x109877e88 - rustc_query_system::query::plumbing::ensure_must_run::h7a6c9ea58c479dff
  21:        0x109b0f07a - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::coherent_trait::hca51fa11b348897d
  22:        0x108e3c837 - rustc_session::session::Session::track_errors::h3606446a7e54ce1b
  23:        0x108dfad35 - rustc_typeck::check_crate::h639646483ad1f67a
  24:        0x1064b819f - rustc_interface::passes::analysis::h4f85fbb562aaa2d0
  25:        0x109b6d1d8 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task::h250cbf125cf5c5da
  26:        0x109a8f5d5 - rustc_data_structures::stack::ensure_sufficient_stack::h6bf2db115705a40c
  27:        0x10995448c - rustc_query_system::query::plumbing::try_execute_query::hea85233fa9cc2fd4
  28:        0x109b0a0c5 - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis::hda9a7d1ffac3bca0
  29:        0x1063f7211 - rustc_interface::passes::QueryContext::enter::hca7a6b48fcdfcc9c
  30:        0x1063d5be6 - rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter::h5dd0e3e5d157764e
  31:        0x1063a620e - rustc_span::with_source_map::h5222a0af0f8eb603
  32:        0x1063d43ac - scoped_tls::ScopedKey<T>::set::h1d3d67352154478d
  33:        0x1063aac32 - std::sys_common::backtrace::__rust_begin_short_backtrace::hb945015c1b1cd51d
  34:        0x1063fc9a5 - core::ops::function::FnOnce::call_once{{vtable.shim}}::hc43c9a06b1d9c32a
  35:        0x10e417ba7 - std::sys::unix::thread::Thread::new::thread_start::h1ebadf8a3a1817e4
  36:     0x7fff2040a8fc - __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.57.0 (f1edd0429 2021-11-29) running on x86_64-apple-darwin

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
error: could not compile `components`

Meta:

$ rustc --version --verbose
  
rustc 1.57.0 (f1edd0429 2021-11-29)
binary: rustc
commit-hash: f1edd0429582dd29cccacaf50fd134b05593bd9c
commit-date: 2021-11-29
host: x86_64-apple-darwin
release: 1.57.0
LLVM version: 13.0.0
$ trunk --version 
trunk 0.14.0

@mibes
Copy link

mibes commented Dec 4, 2021

Rust 1.56.1 works fine.

rustc 1.56.1 (59eed8a2a 2021-11-01)
binary: rustc
commit-hash: 59eed8a2aac0230a8b53e89d4e99d55912ba6b35
commit-date: 2021-11-01
host: x86_64-apple-darwin
release: 1.56.1
LLVM version: 13.0.0

@mibes
Copy link

mibes commented Dec 4, 2021

@rainliu it seems that a cargo cleanand a fresh rebuild of the project resolved the situation. Although I have no hard evidence and it may just be "luck".

@BGR360
Copy link
Contributor

BGR360 commented Dec 21, 2021

Looks like a known incremental compilation bug. That's why cargo clean fixed it.

See #91696. Hopefully fixed by #91919.

@rustbot label +A-incr-comp

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

Closing assuming the previous "it's a duplicate" is correct, because it seems so to my eyes. Should be fixed by either that or #93064

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

5 participants