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

ICE: debuginfo: unexpected type in type_di_node() #112731

Closed
matthiaskrgr opened this issue Jun 17, 2023 · 1 comment · Fixed by #112777
Closed

ICE: debuginfo: unexpected type in type_di_node() #112731

matthiaskrgr opened this issue Jun 17, 2023 · 1 comment · Fixed by #112777
Labels
A-codegen Area: Code generation A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) C-bug Category: This is a bug. F-type_alias_impl_trait `#[feature(type_alias_impl_trait)]` 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

@matthiaskrgr
Copy link
Member

Code

rustc -Cdebuginfo=2 --crate-type lib

#![feature(type_alias_impl_trait)]

use std::fmt::Debug;

type Foo = impl Debug;

static FOO1: Foo = 22_u32;

Meta

rustc --version --verbose:

rustc 1.72.0-nightly (1d7d82472 2023-06-17)
binary: rustc
commit-hash: 1d7d82472617a4a0fea59c7e239c8a48c8ac5c34
commit-date: 2023-06-17
host: x86_64-unknown-linux-gnu
release: 1.72.0-nightly
LLVM version: 16.0.5

Error output

<output>
Backtrace

error: internal compiler error: compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs:462:14: debuginfo: unexpected type in type_di_node(): Foo

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/compiler/rustc_errors/src/lib.rs:1650:9
stack backtrace:
   0:     0x7f162fd68821 - std::backtrace_rs::backtrace::libunwind::trace::h6e3584f9aa263648
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f162fd68821 - std::backtrace_rs::backtrace::trace_unsynchronized::h7cba45a2d56b3723
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f162fd68821 - std::sys_common::backtrace::_print_fmt::hb3e5f2b800058c47
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f162fd68821 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hc6fcd56f05592786
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f162fdc9b2f - core::fmt::rt::Argument::fmt::hb8b6762d96a2930c
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/core/src/fmt/rt.rs:138:9
   5:     0x7f162fdc9b2f - core::fmt::write::ha824b1be2c398991
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/core/src/fmt/mod.rs:1094:21
   6:     0x7f162fd5ba31 - std::io::Write::write_fmt::h4bbc557c498e18be
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/std/src/io/mod.rs:1713:15
   7:     0x7f162fd68635 - std::sys_common::backtrace::_print::hb6a2afc924d1ac9a
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f162fd68635 - std::sys_common::backtrace::print::h39a60e9b1dd2b988
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f162fd6b317 - std::panicking::default_hook::{{closure}}::hf1636ea70b88baf6
  10:     0x7f162fd6b104 - std::panicking::default_hook::h25db0e741a15cb6c
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/std/src/panicking.rs:288:9
  11:     0x7f1632fc105b - <rustc_driver_impl[9fb98086b5dc1b8]::install_ice_hook::{closure#0} as core[5a025f5ac19a3684]::ops::function::FnOnce<(&core[5a025f5ac19a3684]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  12:     0x7f162fd6ba5d - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hb67fc0de76dc4685
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/alloc/src/boxed.rs:1999:9
  13:     0x7f162fd6ba5d - std::panicking::rust_panic_with_hook::h6c10fd1f40066f99
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/std/src/panicking.rs:709:13
  14:     0x7f16334c21b1 - std[5e6a7ab4ec51e2fa]::panicking::begin_panic::<rustc_errors[db6e693a4d78f721]::ExplicitBug>::{closure#0}
  15:     0x7f16334c0e06 - std[5e6a7ab4ec51e2fa]::sys_common::backtrace::__rust_end_short_backtrace::<std[5e6a7ab4ec51e2fa]::panicking::begin_panic<rustc_errors[db6e693a4d78f721]::ExplicitBug>::{closure#0}, !>
  16:     0x7f16335572a6 - std[5e6a7ab4ec51e2fa]::panicking::begin_panic::<rustc_errors[db6e693a4d78f721]::ExplicitBug>
  17:     0x7f16334bdbd4 - <rustc_errors[db6e693a4d78f721]::HandlerInner>::bug::<alloc[31842ca5441cdb56]::string::String>
  18:     0x7f16334bda56 - <rustc_errors[db6e693a4d78f721]::Handler>::bug::<alloc[31842ca5441cdb56]::string::String>
  19:     0x7f163351142c - rustc_middle[c2d4873b804b2cf0]::util::bug::opt_span_bug_fmt::<rustc_span[7bbc48c8a570ee79]::span_encoding::Span>::{closure#0}
  20:     0x7f163350e2ca - rustc_middle[c2d4873b804b2cf0]::ty::context::tls::with_opt::<rustc_middle[c2d4873b804b2cf0]::util::bug::opt_span_bug_fmt<rustc_span[7bbc48c8a570ee79]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  21:     0x7f163350e29a - rustc_middle[c2d4873b804b2cf0]::ty::context::tls::with_context_opt::<rustc_middle[c2d4873b804b2cf0]::ty::context::tls::with_opt<rustc_middle[c2d4873b804b2cf0]::util::bug::opt_span_bug_fmt<rustc_span[7bbc48c8a570ee79]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  22:     0x7f163124f89d - rustc_middle[c2d4873b804b2cf0]::util::bug::bug_fmt
  23:     0x7f16314d0a24 - rustc_codegen_llvm[69782307a30a28b1]::debuginfo::metadata::type_di_node
  24:     0x7f1631c240ba - rustc_codegen_llvm[69782307a30a28b1]::debuginfo::metadata::build_global_var_di_node
  25:     0x7f1631c236e7 - <rustc_codegen_llvm[69782307a30a28b1]::context::CodegenCx as rustc_codegen_ssa[7cf51ec1c1d8e70f]::traits::statics::StaticMethods>::codegen_static
  26:     0x7f1631c0c8bc - rustc_codegen_llvm[69782307a30a28b1]::base::compile_codegen_unit::module_codegen
  27:     0x7f1631c0a109 - rustc_codegen_llvm[69782307a30a28b1]::base::compile_codegen_unit
  28:     0x7f1631c07901 - rustc_codegen_ssa[7cf51ec1c1d8e70f]::base::codegen_crate::<rustc_codegen_llvm[69782307a30a28b1]::LlvmCodegenBackend>
  29:     0x7f1631c0720f - <rustc_codegen_llvm[69782307a30a28b1]::LlvmCodegenBackend as rustc_codegen_ssa[7cf51ec1c1d8e70f]::traits::backend::CodegenBackend>::codegen_crate
  30:     0x7f16324fc0a2 - <rustc_session[5d8f1134011332b9]::session::Session>::time::<alloc[31842ca5441cdb56]::boxed::Box<dyn core[5a025f5ac19a3684]::any::Any>, rustc_interface[75da62af7afad68]::passes::start_codegen::{closure#0}>
  31:     0x7f16324fbc1b - rustc_interface[75da62af7afad68]::passes::start_codegen
  32:     0x7f16324f696d - <rustc_middle[c2d4873b804b2cf0]::ty::context::GlobalCtxt>::enter::<<rustc_interface[75da62af7afad68]::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core[5a025f5ac19a3684]::result::Result<alloc[31842ca5441cdb56]::boxed::Box<dyn core[5a025f5ac19a3684]::any::Any>, rustc_span[7bbc48c8a570ee79]::ErrorGuaranteed>>
  33:     0x7f16324f50dd - <rustc_interface[75da62af7afad68]::queries::Queries>::ongoing_codegen
  34:     0x7f16324f3c3a - rustc_span[7bbc48c8a570ee79]::set_source_map::<core[5a025f5ac19a3684]::result::Result<(), rustc_span[7bbc48c8a570ee79]::ErrorGuaranteed>, rustc_interface[75da62af7afad68]::interface::run_compiler<core[5a025f5ac19a3684]::result::Result<(), rustc_span[7bbc48c8a570ee79]::ErrorGuaranteed>, rustc_driver_impl[9fb98086b5dc1b8]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  35:     0x7f16324ec3f9 - <scoped_tls[5be461245172b0fd]::ScopedKey<rustc_span[7bbc48c8a570ee79]::SessionGlobals>>::set::<rustc_interface[75da62af7afad68]::interface::run_compiler<core[5a025f5ac19a3684]::result::Result<(), rustc_span[7bbc48c8a570ee79]::ErrorGuaranteed>, rustc_driver_impl[9fb98086b5dc1b8]::run_compiler::{closure#1}>::{closure#0}, core[5a025f5ac19a3684]::result::Result<(), rustc_span[7bbc48c8a570ee79]::ErrorGuaranteed>>
  36:     0x7f16324eb9f6 - std[5e6a7ab4ec51e2fa]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[75da62af7afad68]::util::run_in_thread_pool_with_globals<rustc_interface[75da62af7afad68]::interface::run_compiler<core[5a025f5ac19a3684]::result::Result<(), rustc_span[7bbc48c8a570ee79]::ErrorGuaranteed>, rustc_driver_impl[9fb98086b5dc1b8]::run_compiler::{closure#1}>::{closure#0}, core[5a025f5ac19a3684]::result::Result<(), rustc_span[7bbc48c8a570ee79]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[5a025f5ac19a3684]::result::Result<(), rustc_span[7bbc48c8a570ee79]::ErrorGuaranteed>>
  37:     0x7f16324eb7a5 - <<std[5e6a7ab4ec51e2fa]::thread::Builder>::spawn_unchecked_<rustc_interface[75da62af7afad68]::util::run_in_thread_pool_with_globals<rustc_interface[75da62af7afad68]::interface::run_compiler<core[5a025f5ac19a3684]::result::Result<(), rustc_span[7bbc48c8a570ee79]::ErrorGuaranteed>, rustc_driver_impl[9fb98086b5dc1b8]::run_compiler::{closure#1}>::{closure#0}, core[5a025f5ac19a3684]::result::Result<(), rustc_span[7bbc48c8a570ee79]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[5a025f5ac19a3684]::result::Result<(), rustc_span[7bbc48c8a570ee79]::ErrorGuaranteed>>::{closure#1} as core[5a025f5ac19a3684]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  38:     0x7f162fd75f55 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h3b57fe0fe8253eda
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/alloc/src/boxed.rs:1985:9
  39:     0x7f162fd75f55 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h6eac2c7c988070fa
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/alloc/src/boxed.rs:1985:9
  40:     0x7f162fd75f55 - std::sys::unix::thread::Thread::new::thread_start::h8d73f1104f34aa7b
                               at /rustc/1d7d82472617a4a0fea59c7e239c8a48c8ac5c34/library/std/src/sys/unix/thread.rs:108:17
  41:     0x7f162fb0f44b - <unknown>
  42:     0x7f162fb92e40 - <unknown>
  43:                0x0 - <unknown>

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.72.0-nightly (1d7d82472 2023-06-17) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C debuginfo=2

query stack during panic:
end of query stack
error: aborting due to previous error

@matthiaskrgr matthiaskrgr added 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. C-bug Category: This is a bug. F-type_alias_impl_trait `#[feature(type_alias_impl_trait)]` labels Jun 17, 2023
@matthiaskrgr
Copy link
Member Author

0cc541e cc @oli-obk

@Nilstrieb Nilstrieb added the A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) label Jun 17, 2023
@matthiaskrgr matthiaskrgr added the A-codegen Area: Code generation label Jun 17, 2023
jyn514 added a commit to jyn514/rust that referenced this issue Jun 19, 2023
…e, r=oli-obk

Continue folding in query normalizer on weak aliases

Fixes rust-lang#112752
Fixes rust-lang#112731 (same root cause, so didn't make a test for it)
fixes rust-lang#112776

r? `@oli-obk`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jun 19, 2023
…e, r=oli-obk

Continue folding in query normalizer on weak aliases

Fixes rust-lang#112752
Fixes rust-lang#112731 (same root cause, so didn't make a test for it)
fixes rust-lang#112776

r? ``@oli-obk``
@bors bors closed this as completed in 68f2f1e Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) C-bug Category: This is a bug. F-type_alias_impl_trait `#[feature(type_alias_impl_trait)]` 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

Successfully merging a pull request may close this issue.

2 participants