Skip to content

the compiler unexpectedly panicked. #122020

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

Open
lifeRobot opened this issue Mar 5, 2024 · 2 comments
Open

the compiler unexpectedly panicked. #122020

lifeRobot opened this issue Mar 5, 2024 · 2 comments
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@lifeRobot
Copy link

I am sorry, I don't know where the code went wrong, but the compiler prompts [error: the compiler unexpectedly panicked. this is a bug.]

error msg

thread 'rustc' panicked at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce\compiler\rustc_serialize\src\serialize.rs:129:9:
assertion failed: bytes[len] == STR_SENTINEL
stack backtrace:
   0:     0x7ffde4c922c2 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h7851e041f2b8bcc2
   1:     0x7ffde4cc4cdd - core::fmt::write::h1642dfca37b49735
   2:     0x7ffde4c88ca1 - <std::io::IoSlice as core::fmt::Debug>::fmt::h7801514a6fc13a4a
   3:     0x7ffde4c920ea - std::sys_common::backtrace::lock::h8caaa69a6cc2258b
   4:     0x7ffde4c95529 - std::panicking::default_hook::h67f6260a0bf37eca
   5:     0x7ffde4c951e5 - std::panicking::default_hook::h67f6260a0bf37eca
   6:     0x7ffdc455fb03 - <tracing_subscriber[b129777695c18cc]::fmt::format::Writer>::write_fmt
   7:     0x7ffde4c95b43 - std::panicking::rust_panic_with_hook::h870983d929e74e12
   8:     0x7ffde4c959ab - <std::panicking::begin_panic_handler::StaticStrPayload as core::panic::PanicPayload>::take_box::h971268ed26284d4c
   9:     0x7ffde4c92bc9 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h7851e041f2b8bcc2
  10:     0x7ffde4c956b2 - rust_begin_unwind
  11:     0x7ffde4cea447 - core::panicking::panic_fmt::ha5dd7a91f3010b68
  12:     0x7ffde4cea522 - core::panicking::panic::h61d0277f5e1a7407
  13:     0x7ffdc41778de - <rustc_span[64dbdf40f18d9543]::symbol::Symbol as rustc_serialize[5c2de7cb72870ff8]::serialize::Encodable<rustc_metadata[6225089cefb65fc8]::rmeta::encoder::EncodeContext>>::encode
  14:     0x7ffdc420680a - <rustc_span[64dbdf40f18d9543]::def_id::CrateNum as rustc_serialize[5c2de7cb72870ff8]::serialize::Encodable<rustc_metadata[6225089cefb65fc8]::rmeta::encoder::EncodeContext>>::encode
  15:     0x7ffdc33176ee - <rustc_span[64dbdf40f18d9543]::SpanData as rustc_serialize[5c2de7cb72870ff8]::serialize::Encodable<rustc_metadata[6225089cefb65fc8]::rmeta::encoder::EncodeContext>>::encode
  16:     0x7ffdc30fe7c0 - rustc_query_impl[1b1c3ff2f5873f4d]::profiling_support::alloc_self_profile_query_strings
  17:     0x7ffdc30ea637 - rustc_query_impl[1b1c3ff2f5873f4d]::profiling_support::alloc_self_profile_query_strings
  18:     0x7ffdc3eb2b73 - <rustc_query_impl[1b1c3ff2f5873f4d]::plumbing::QueryCtxt as rustc_query_system[79eaec2bcc989eb1]::query::QueryContext>::load_side_effects
  19:     0x7ffdc31ac59b - <dyn std[9ab95dd99822253f]::io::Write as nu_ansi_term[e69e53107ba4ac27]::write::AnyWrite>::write_str
  20:     0x7ffdc2fcf619 - <rustc_builtin_macros[dd4f16c72cadaf36]::deriving::generic::find_type_parameters::Visitor as rustc_ast[e9dd69dd6ecea279]::visit::Visitor>::visit_ty
  21:     0x7ffdc3b3fe5d - <rustc_resolve[9c6e9c40bfd72874]::Segment as core[d8a3f01ca499b8ab]::convert::From<&rustc_ast[e9dd69dd6ecea279]::ast::PathSegment>>::from
  22:     0x7ffdc3b27c4c - <rustc_ast_lowering[78b18a5bf5a77e2]::index::NodeCollector as rustc_hir[bb3c913758e2f47e]::intravisit::Visitor>::visit_variant
  23:     0x7ffdc3b2a22b - <rustc_resolve[9c6e9c40bfd72874]::Resolver as rustc_expand[f8d40f23793d5605]::base::ResolverExpand>::resolve_imports
  24:     0x7ffdc42255fa - <rustc_expand[f8d40f23793d5605]::expand::MacroExpander>::fully_expand_fragment
  25:     0x7ffdc334f6aa - <rustc_expand[f8d40f23793d5605]::expand::MacroExpander>::expand_crate
  26:     0x7ffdc06d9fd9 - rustc_interface[9ef98228d448de4b]::interface::parse_check_cfg
  27:     0x7ffdc06baf1e - rustc_interface[9ef98228d448de4b]::passes::resolver_for_lowering
  28:     0x7ffdc30ff70d - rustc_query_impl[1b1c3ff2f5873f4d]::profiling_support::alloc_self_profile_query_strings
  29:     0x7ffdc3112919 - rustc_query_impl[1b1c3ff2f5873f4d]::profiling_support::alloc_self_profile_query_strings
  30:     0x7ffdc311e548 - rustc_query_impl[1b1c3ff2f5873f4d]::profiling_support::alloc_self_profile_query_strings
  31:     0x7ffdc312ebc4 - rustc_query_impl[1b1c3ff2f5873f4d]::profiling_support::alloc_self_profile_query_strings
  32:     0x7ffdc31933a1 - <dyn std[9ab95dd99822253f]::io::Write as nu_ansi_term[e69e53107ba4ac27]::write::AnyWrite>::write_str
  33:     0x7ffdc0669706 - rustc_driver_impl[5ff3db5439d2e5e5]::main
  34:     0x7ffdc0670e1b - rustc_driver_impl[5ff3db5439d2e5e5]::args::arg_expand_all
  35:     0x7ffdc0688809 - <rustc_middle[29ac2ae09cb008db]::ty::SymbolName as core[d8a3f01ca499b8ab]::fmt::Debug>::fmt
  36:     0x7ffdc068770f - <rustc_middle[29ac2ae09cb008db]::ty::SymbolName as core[d8a3f01ca499b8ab]::fmt::Debug>::fmt
  37:     0x7ffdc0691068 - <rustc_middle[29ac2ae09cb008db]::ty::SymbolName as core[d8a3f01ca499b8ab]::fmt::Debug>::fmt
  38:     0x7ffde4ca7ebc - std::sys::windows::thread::Thread::new::h827e23232df84eef
  39:     0x7ffe75fc257d - BaseThreadInitThunk
  40:     0x7ffe770caa58 - RtlUserThreadStart

error: 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.76.0 (07dca489a 2024-02-04) running on x86_64-pc-windows-msvc

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

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

query stack during panic:
#0 [module_children] collecting child items of module `vtable`
#1 [resolver_for_lowering] getting the resolver for lowering
end of query stack
error: could not compile `park_monitor` (bin "park_monitor")

other descriptions

  1. cargo clippy executed successfully
  2. cargo run and cargo build executed fail
  3. I re executed cargo clean and cargo build, then they executed successfully, and I not change any code
@lifeRobot lifeRobot 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 Mar 5, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 5, 2024
@jieyouxu jieyouxu added the S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. label Mar 5, 2024
@jieyouxu
Copy link
Member

jieyouxu commented Mar 5, 2024

Could potentially be related to #121973.

@saethlin
Copy link
Member

saethlin commented Mar 5, 2024

That seems unlikely? This file isn't truncated, it has the wrong value at a byte that was successfully read.

What really confuses me is that the backtrace here points to code for encoding, but this check is in a decoding code path.

@jieyouxu jieyouxu removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. 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