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: type metadata for unique ID VariantStructType([async block@h3/src/tests/connection.rs:631:22: 646:6], 0, HiddenZst) is already in the TypeMap! #105822

Open
Ruben2424 opened this issue Dec 17, 2022 · 2 comments
Labels
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

@Ruben2424
Copy link

Code

The error occurs when compiling tests in https://github.com/hyperium/h3.
I am sorry but I wasn't able to create a minimized example.
But I found out that without this function call (and the same function calls in similar tests) the error don't occur.
https://github.com/hyperium/h3/blob/885144bfcb0414bcb86b63cec9c65a611c7e56ee/h3/src/tests/connection.rs#L586 .

Meta

rustc --version --verbose:

rustc 1.67.0-beta.2 (352eb59a4 2022-12-13)
binary: rustc
commit-hash: 352eb59a4c33abf739914422f2ad975925750146
commit-date: 2022-12-13
host: x86_64-unknown-linux-gnu
release: 1.67.0-beta.2
LLVM version: 15.0.6

Error output

error: internal compiler error: compiler/rustc_codegen_llvm/src/debuginfo/metadata/type_map.rs:133:13: type metadata for unique ID 'VariantStructType([async block@h3/src/tests/connection.rs:631:22: 646:6], 0, HiddenZst)' is already in the `TypeMap`!
Backtrace

error: internal compiler error: compiler/rustc_codegen_llvm/src/debuginfo/metadata/type_map.rs:133:13: type metadata for unique ID 'VariantStructType([async block@h3/src/tests/connection.rs:631:22: 646:6], 0, HiddenZst)' is already in the `TypeMap`!

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/352eb59a4c33abf739914422f2ad975925750146/compiler/rustc_errors/src/lib.rs:1576:9
stack backtrace:
   0:     0x7fef9277967a - std::backtrace_rs::backtrace::libunwind::trace::hcd4891e18cdac4cb
                               at /rustc/352eb59a4c33abf739914422f2ad975925750146/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7fef9277967a - std::backtrace_rs::backtrace::trace_unsynchronized::ha58ab820c4658994
                               at /rustc/352eb59a4c33abf739914422f2ad975925750146/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fef9277967a - std::sys_common::backtrace::_print_fmt::he568d92119f87d54
                               at /rustc/352eb59a4c33abf739914422f2ad975925750146/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7fef9277967a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hcbc847301a6787b7
                               at /rustc/352eb59a4c33abf739914422f2ad975925750146/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7fef8e6f325e - core::fmt::write::h2fc64d22f72fd459
                               at /rustc/352eb59a4c33abf739914422f2ad975925750146/library/core/src/fmt/mod.rs:1208:17
   5:     0x7fef9276d4a5 - std::io::Write::write_fmt::h7541c526a11333b7
                               at /rustc/352eb59a4c33abf739914422f2ad975925750146/library/std/src/io/mod.rs:1682:15
   6:     0x7fef92779445 - std::sys_common::backtrace::_print::hbd71aef4fc6cae4a
                               at /rustc/352eb59a4c33abf739914422f2ad975925750146/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7fef92779445 - std::sys_common::backtrace::print::hafe0948995637b97
                               at /rustc/352eb59a4c33abf739914422f2ad975925750146/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7fef9277b7cf - std::panicking::default_hook::{{closure}}::h45f78efd81105148
                               at /rustc/352eb59a4c33abf739914422f2ad975925750146/library/std/src/panicking.rs:267:22
   9:     0x7fef9277b50b - std::panicking::default_hook::h5d914794caf2ae06
                               at /rustc/352eb59a4c33abf739914422f2ad975925750146/library/std/src/panicking.rs:286:9
  10:     0x7fef919c63e1 - rustc_driver[7be1e2c8384e391a]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7fef9277bfcd - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h68a829533092086a
                               at /rustc/352eb59a4c33abf739914422f2ad975925750146/library/alloc/src/boxed.rs:2032:9
  12:     0x7fef9277bfcd - std::panicking::rust_panic_with_hook::h81cbe204a0e9dbb4
                               at /rustc/352eb59a4c33abf739914422f2ad975925750146/library/std/src/panicking.rs:692:13
  13:     0x7fef91e4f9f1 - std[1420c78fae8005f4]::panicking::begin_panic::<rustc_errors[22c30192bd34e832]::ExplicitBug>::{closure#0}
  14:     0x7fef91e4f2c6 - std[1420c78fae8005f4]::sys_common::backtrace::__rust_end_short_backtrace::<std[1420c78fae8005f4]::panicking::begin_panic<rustc_errors[22c30192bd34e832]::ExplicitBug>::{closure#0}, !>
  15:     0x7fef91e880d6 - std[1420c78fae8005f4]::panicking::begin_panic::<rustc_errors[22c30192bd34e832]::ExplicitBug>
  16:     0x7fef91e4cbe6 - std[1420c78fae8005f4]::panic::panic_any::<rustc_errors[22c30192bd34e832]::ExplicitBug>
  17:     0x7fef91e4b9a6 - <rustc_errors[22c30192bd34e832]::HandlerInner>::bug::<&alloc[2bbbf4664cc293fb]::string::String>
  18:     0x7fef91e4b610 - <rustc_errors[22c30192bd34e832]::Handler>::bug::<&alloc[2bbbf4664cc293fb]::string::String>
  19:     0x7fef91e2d2ae - rustc_middle[6f44b2edfca54a7c]::ty::context::tls::with_context_opt::<rustc_middle[6f44b2edfca54a7c]::ty::context::tls::with_opt<rustc_middle[6f44b2edfca54a7c]::util::bug::opt_span_bug_fmt<rustc_span[9a3cb0e49fef3da0]::span_encoding::Span>::{closure#0}, ()>::{closure#0}, ()>
  20:     0x7fef91e2e716 - rustc_middle[6f44b2edfca54a7c]::util::bug::opt_span_bug_fmt::<rustc_span[9a3cb0e49fef3da0]::span_encoding::Span>
  21:     0x7fef8fc3d783 - rustc_middle[6f44b2edfca54a7c]::util::bug::bug_fmt
  22:     0x7fef9125ba26 - <rustc_codegen_llvm[3f3b4ba1dcec146e]::debuginfo::metadata::type_map::TypeMap>::insert
  23:     0x7fef918487b6 - rustc_codegen_llvm[3f3b4ba1dcec146e]::debuginfo::metadata::type_map::build_type_with_children::<rustc_codegen_llvm[3f3b4ba1dcec146e]::debuginfo::metadata::enums::build_generator_variant_struct_type_di_node::{closure#0}, rustc_codegen_llvm[3f3b4ba1dcec146e]::debuginfo::metadata::enums::build_generator_variant_struct_type_di_node::{closure#1}>
  24:     0x7fef91827a24 - rustc_codegen_llvm[3f3b4ba1dcec146e]::debuginfo::metadata::enums::build_generator_variant_struct_type_di_node
  25:     0x7fef917f600a - <&mut rustc_codegen_llvm[3f3b4ba1dcec146e]::debuginfo::metadata::enums::native::build_generator_di_node::{closure#0}::{closure#0} as core[b9c1de13ce1671c0]::ops::function::FnOnce<(rustc_target[9c8ec14b4338e81c]::abi::VariantIdx,)>>::call_once
  26:     0x7fef918379fa - <smallvec[2a35e75d77540254]::SmallVec<[rustc_codegen_llvm[3f3b4ba1dcec146e]::debuginfo::metadata::enums::native::VariantMemberInfo; 16usize]> as core[b9c1de13ce1671c0]::iter::traits::collect::Extend<rustc_codegen_llvm[3f3b4ba1dcec146e]::debuginfo::metadata::enums::native::VariantMemberInfo>>::extend::<core[b9c1de13ce1671c0]::iter::adapters::map::Map<core[b9c1de13ce1671c0]::iter::adapters::map::Map<core[b9c1de13ce1671c0]::ops::range::Range<usize>, <rustc_index[a6e905da1e73ca79]::vec::IndexVec<rustc_target[9c8ec14b4338e81c]::abi::VariantIdx, rustc_abi[87f217d803b9d4b]::LayoutS<rustc_target[9c8ec14b4338e81c]::abi::VariantIdx>>>::indices::{closure#0}>, rustc_codegen_llvm[3f3b4ba1dcec146e]::debuginfo::metadata::enums::native::build_generator_di_node::{closure#0}::{closure#0}>>
  27:     0x7fef91848f9f - rustc_codegen_llvm[3f3b4ba1dcec146e]::debuginfo::metadata::type_map::build_type_with_children::<rustc_codegen_llvm[3f3b4ba1dcec146e]::debuginfo::metadata::enums::native::build_generator_di_node::{closure#0}, for<'a, 'b, 'c> fn(&'a rustc_codegen_llvm[3f3b4ba1dcec146e]::context::CodegenCx<'b, 'c>) -> smallvec[2a35e75d77540254]::SmallVec<[&'b rustc_codegen_llvm[3f3b4ba1dcec146e]::llvm_::ffi::Metadata; 16usize]>>
  28:     0x7fef917f9591 - rustc_codegen_llvm[3f3b4ba1dcec146e]::debuginfo::metadata::enums::native::build_generator_di_node
  29:     0x7fef918270ff - rustc_codegen_llvm[3f3b4ba1dcec146e]::debuginfo::metadata::enums::build_generator_di_node
  30:     0x7fef9013705b - rustc_codegen_llvm[3f3b4ba1dcec146e]::debuginfo::metadata::type_di_node
  31:     0x7fef90053199 - <rustc_codegen_llvm[3f3b4ba1dcec146e]::context::CodegenCx as rustc_codegen_ssa[5366641906a838a4]::traits::debuginfo::DebugInfoMethods>::create_dbg_var
  32:     0x7fef90048602 - rustc_codegen_ssa[5366641906a838a4]::mir::codegen_mir::<rustc_codegen_llvm[3f3b4ba1dcec146e]::builder::Builder>
  33:     0x7fef90ce00c3 - rustc_codegen_llvm[3f3b4ba1dcec146e]::base::compile_codegen_unit::module_codegen
  34:     0x7fef91043a57 - <rustc_query_system[7b71e87695234a12]::dep_graph::graph::DepGraph<rustc_middle[6f44b2edfca54a7c]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[6f44b2edfca54a7c]::ty::context::TyCtxt, rustc_span[9a3cb0e49fef3da0]::symbol::Symbol, rustc_codegen_ssa[5366641906a838a4]::ModuleCodegen<rustc_codegen_llvm[3f3b4ba1dcec146e]::ModuleLlvm>>
  35:     0x7fef91043511 - <rustc_codegen_llvm[3f3b4ba1dcec146e]::LlvmCodegenBackend as rustc_codegen_ssa[5366641906a838a4]::traits::backend::ExtraBackendMethods>::compile_codegen_unit
  36:     0x7fef91040db2 - rustc_codegen_ssa[5366641906a838a4]::base::codegen_crate::<rustc_codegen_llvm[3f3b4ba1dcec146e]::LlvmCodegenBackend>
  37:     0x7fef91040559 - <rustc_codegen_llvm[3f3b4ba1dcec146e]::LlvmCodegenBackend as rustc_codegen_ssa[5366641906a838a4]::traits::backend::CodegenBackend>::codegen_crate
  38:     0x7fef90b403b1 - <rustc_session[9f2eda86fa5de41f]::session::Session>::time::<alloc[2bbbf4664cc293fb]::boxed::Box<dyn core[b9c1de13ce1671c0]::any::Any>, rustc_interface[b55cc7e3edc32fa9]::passes::start_codegen::{closure#0}>
  39:     0x7fef90b3fed9 - rustc_interface[b55cc7e3edc32fa9]::passes::start_codegen
  40:     0x7fef90b3dbb6 - <rustc_interface[b55cc7e3edc32fa9]::passes::QueryContext>::enter::<<rustc_interface[b55cc7e3edc32fa9]::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core[b9c1de13ce1671c0]::result::Result<alloc[2bbbf4664cc293fb]::boxed::Box<dyn core[b9c1de13ce1671c0]::any::Any>, rustc_errors[22c30192bd34e832]::ErrorGuaranteed>>
  41:     0x7fef90b3b1f6 - <rustc_interface[b55cc7e3edc32fa9]::queries::Queries>::ongoing_codegen
  42:     0x7fef90b3a717 - <rustc_interface[b55cc7e3edc32fa9]::interface::Compiler>::enter::<rustc_driver[7be1e2c8384e391a]::run_compiler::{closure#1}::{closure#2}, core[b9c1de13ce1671c0]::result::Result<core[b9c1de13ce1671c0]::option::Option<rustc_interface[b55cc7e3edc32fa9]::queries::Linker>, rustc_errors[22c30192bd34e832]::ErrorGuaranteed>>
  43:     0x7fef90b35738 - rustc_span[9a3cb0e49fef3da0]::with_source_map::<core[b9c1de13ce1671c0]::result::Result<(), rustc_errors[22c30192bd34e832]::ErrorGuaranteed>, rustc_interface[b55cc7e3edc32fa9]::interface::run_compiler<core[b9c1de13ce1671c0]::result::Result<(), rustc_errors[22c30192bd34e832]::ErrorGuaranteed>, rustc_driver[7be1e2c8384e391a]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  44:     0x7fef90b35225 - <scoped_tls[5e88bebcbbbb855e]::ScopedKey<rustc_span[9a3cb0e49fef3da0]::SessionGlobals>>::set::<rustc_interface[b55cc7e3edc32fa9]::interface::run_compiler<core[b9c1de13ce1671c0]::result::Result<(), rustc_errors[22c30192bd34e832]::ErrorGuaranteed>, rustc_driver[7be1e2c8384e391a]::run_compiler::{closure#1}>::{closure#0}, core[b9c1de13ce1671c0]::result::Result<(), rustc_errors[22c30192bd34e832]::ErrorGuaranteed>>
  45:     0x7fef90b34812 - std[1420c78fae8005f4]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[b55cc7e3edc32fa9]::util::run_in_thread_pool_with_globals<rustc_interface[b55cc7e3edc32fa9]::interface::run_compiler<core[b9c1de13ce1671c0]::result::Result<(), rustc_errors[22c30192bd34e832]::ErrorGuaranteed>, rustc_driver[7be1e2c8384e391a]::run_compiler::{closure#1}>::{closure#0}, core[b9c1de13ce1671c0]::result::Result<(), rustc_errors[22c30192bd34e832]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[b9c1de13ce1671c0]::result::Result<(), rustc_errors[22c30192bd34e832]::ErrorGuaranteed>>
  46:     0x7fef91279618 - <<std[1420c78fae8005f4]::thread::Builder>::spawn_unchecked_<rustc_interface[b55cc7e3edc32fa9]::util::run_in_thread_pool_with_globals<rustc_interface[b55cc7e3edc32fa9]::interface::run_compiler<core[b9c1de13ce1671c0]::result::Result<(), rustc_errors[22c30192bd34e832]::ErrorGuaranteed>, rustc_driver[7be1e2c8384e391a]::run_compiler::{closure#1}>::{closure#0}, core[b9c1de13ce1671c0]::result::Result<(), rustc_errors[22c30192bd34e832]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[b9c1de13ce1671c0]::result::Result<(), rustc_errors[22c30192bd34e832]::ErrorGuaranteed>>::{closure#1} as core[b9c1de13ce1671c0]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  47:     0x7fef92783313 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h505d44b0a4d2868a
                               at /rustc/352eb59a4c33abf739914422f2ad975925750146/library/alloc/src/boxed.rs:2000:9
  48:     0x7fef92783313 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h83bbe20ed8f689ab
                               at /rustc/352eb59a4c33abf739914422f2ad975925750146/library/alloc/src/boxed.rs:2000:9
  49:     0x7fef92783313 - std::sys::unix::thread::Thread::new::thread_start::hbc564e93ad1dfe6f
                               at /rustc/352eb59a4c33abf739914422f2ad975925750146/library/std/src/sys/unix/thread.rs:108:17
  50:     0x7fef8e3d8b43 - start_thread
                               at ./nptl/./nptl/pthread_create.c:442:8
  51:     0x7fef8e46aa00 - clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
  52:                0x0 - <unknown>

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.67.0-beta.2 (352eb59a4 2022-12-13) running on x86_64-unknown-linux-gnu

note: compiler flags: -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:
end of query stack
error: could not compile `h3`
<backtrace>

@Ruben2424 Ruben2424 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 17, 2022
@compiler-errors compiler-errors added E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example labels Dec 17, 2022
@albertlarsan68
Copy link
Member

searched nightlies: from nightly-2022-10-29 to nightly-2022-12-17
regressed nightly: nightly-2022-12-10
searched commit range: 7632db0...dfe3fe7
regressed commit: 7701a7e (#105456)

bisected with cargo-bisect-rustc v0.6.5

Host triple: x86_64-pc-windows-msvc
Reproduce with:

cargo bisect-rustc --preserve --access github --start 1.66.0 --regress=ice -- build --tests

with hyperium/h3@885144b

@rustbot label -E-needs-bisection

@rustbot rustbot removed the E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc label Dec 17, 2022
@rustworthy
Copy link

hey guys, I got this kind of error when building unoptimized with both
rustc 1.67.0 (fc594f1 2023-01-24) and nightly. The message will be:

error: internal compiler error: compiler/rustc_codegen_llvm/src/debuginfo/metadata/type_map.rs:133:13: type metadata for unique ID 'VariantStructType([async fn body@actix_sam::startup::run_on_lambda::{closure#0}], 0, HiddenZst)' is already in the `TypeMap`!

rustc 1.69.0-nightly (11d96b5 2023-02-01), when building for release, will not compile the code either, but will give instead the following error:

/usr/bin/ld: /home/*/*/actix_sam/target/x86_64-unknown-linux-musl/release/deps/bootstrap-1ad98e62c8a62aaa: hidden symbol `_ZN4core3pin12Pin$LT$P$GT$13new_unchecked17h62d18ebcc30617d3E' isn't defined

I am on Ubuntu 22.04.1 LTS on x86_64 arch.

Here is the repo with project:
https://github.com/rustworthy/actix_sam

branch 'report'

command to reproduce: 'make build'

I hope that's not me being stupid and not having all native libs installed :( or missing some necessary flags.
Thanks a lot! Please let me know if I can be of any help.

P.S.: some additional context: with line 11-14 in main module commented out, and thus the 'run_on_lambda' not used, the compilations runs just fine.

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. 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