Skip to content

ICE: -Zsanitizer=cfi with allocator_api; transform_ty: unexpected Param(T/#0) #100772

Closed
@matthiaskrgr

Description

@matthiaskrgr

Code

#![feature(allocator_api)]

fn main() {
    Box::new_in(&[0, 1], &std::alloc::Global);
}

Meta

rustc --version --verbose:

rustc 1.65.0-nightly (0b79f758c 2022-08-18)
binary: rustc
commit-hash: 0b79f758c9aa6646606662a6d623a0752286cd17
commit-date: 2022-08-18
host: x86_64-unknown-linux-gnu
release: 1.65.0-nightly
LLVM version: 15.0.0

Error output

rustc ./78459.rs -Zsanitizer=cfi -Clto

warning: unused return value of `Box::<T, A>::new_in` that must be used
 --> ./78459.rs:4:5
  |
4 |     Box::new_in(&[0, 1], &std::alloc::Global);
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_must_use)]` on by default
Backtrace

error: internal compiler error: compiler/rustc_symbol_mangling/src/typeid/typeid_itanium_cxx_abi.rs:808:13: transform_ty: unexpected `Param(T/#0)`

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/6c943bad02626dddc5e5135b23c77429b6e4a063/compiler/rustc_errors/src/lib.rs:1393:9
stack backtrace:
   0:     0x7f80987026d0 - std::backtrace_rs::backtrace::libunwind::trace::h7ca77b521bf65a6c
                               at /rustc/6c943bad02626dddc5e5135b23c77429b6e4a063/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   1:     0x7f80987026d0 - std::backtrace_rs::backtrace::trace_unsynchronized::h177a997875d35c18
                               at /rustc/6c943bad02626dddc5e5135b23c77429b6e4a063/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f80987026d0 - std::sys_common::backtrace::_print_fmt::hd3873814e3096691
                               at /rustc/6c943bad02626dddc5e5135b23c77429b6e4a063/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7f80987026d0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::haddee310bc6c1547
                               at /rustc/6c943bad02626dddc5e5135b23c77429b6e4a063/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7f809875d76e - core::fmt::write::h91364c3556c4fb20
                               at /rustc/6c943bad02626dddc5e5135b23c77429b6e4a063/library/core/src/fmt/mod.rs:1202:17
   5:     0x7f80986f34d5 - std::io::Write::write_fmt::h47a066cd891c116c
                               at /rustc/6c943bad02626dddc5e5135b23c77429b6e4a063/library/std/src/io/mod.rs:1672:15
   6:     0x7f8098705393 - std::sys_common::backtrace::_print::habd193bfc945fcb4
                               at /rustc/6c943bad02626dddc5e5135b23c77429b6e4a063/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7f8098705393 - std::sys_common::backtrace::print::h427d6952dd801f82
                               at /rustc/6c943bad02626dddc5e5135b23c77429b6e4a063/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7f8098705393 - std::panicking::default_hook::{{closure}}::h20b829f4714f9675
                               at /rustc/6c943bad02626dddc5e5135b23c77429b6e4a063/library/std/src/panicking.rs:295:22
   9:     0x7f809870507f - std::panicking::default_hook::h87bd81f6c7ec0251
                               at /rustc/6c943bad02626dddc5e5135b23c77429b6e4a063/library/std/src/panicking.rs:314:9
  10:     0x7f809af3cb14 - <rustc_driver[6d8c1393407eb5ff]::DEFAULT_HOOK::{closure#0}::{closure#0} as core[952f8ce8af40b96d]::ops::function::FnOnce<(&core[952f8ce8af40b96d]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  11:     0x7f8098705bcd - std::panicking::rust_panic_with_hook::hfb97db1278428cc7
                               at /rustc/6c943bad02626dddc5e5135b23c77429b6e4a063/library/std/src/panicking.rs:702:17
  12:     0x7f809bedc021 - std[acaeed3f89206b7c]::panicking::begin_panic::<rustc_errors[13c7440083677ba0]::ExplicitBug>::{closure#0}
  13:     0x7f809bedb826 - std[acaeed3f89206b7c]::sys_common::backtrace::__rust_end_short_backtrace::<std[acaeed3f89206b7c]::panicking::begin_panic<rustc_errors[13c7440083677ba0]::ExplicitBug>::{closure#0}, !>
  14:     0x7f809bebc9f6 - std[acaeed3f89206b7c]::panicking::begin_panic::<rustc_errors[13c7440083677ba0]::ExplicitBug>
  15:     0x7f809bf01496 - std[acaeed3f89206b7c]::panic::panic_any::<rustc_errors[13c7440083677ba0]::ExplicitBug>
  16:     0x7f809bf009fd - <rustc_errors[13c7440083677ba0]::HandlerInner>::bug::<&alloc[f844ba373310351c]::string::String>
  17:     0x7f809bf00750 - <rustc_errors[13c7440083677ba0]::Handler>::bug::<&alloc[f844ba373310351c]::string::String>
  18:     0x7f809bf28c1d - rustc_middle[446de68b5eb34c50]::ty::context::tls::with_context_opt::<rustc_middle[446de68b5eb34c50]::ty::context::tls::with_opt<rustc_middle[446de68b5eb34c50]::util::bug::opt_span_bug_fmt<rustc_span[a3f8d340880b7e2f]::span_encoding::Span>::{closure#0}, ()>::{closure#0}, ()>
  19:     0x7f809bf2aa86 - rustc_middle[446de68b5eb34c50]::util::bug::opt_span_bug_fmt::<rustc_span[a3f8d340880b7e2f]::span_encoding::Span>
  20:     0x7f80998cd9e3 - rustc_middle[446de68b5eb34c50]::util::bug::bug_fmt
  21:     0x7f809ba0b9f2 - rustc_symbol_mangling[6b4956763d16dce]::typeid::typeid_itanium_cxx_abi::transform_ty
  22:     0x7f809ba0b659 - rustc_symbol_mangling[6b4956763d16dce]::typeid::typeid_itanium_cxx_abi::transform_ty
  23:     0x7f809ba0ba76 - rustc_symbol_mangling[6b4956763d16dce]::typeid::typeid_itanium_cxx_abi::transform_ty
  24:     0x7f809ba0be4e - rustc_symbol_mangling[6b4956763d16dce]::typeid::typeid_itanium_cxx_abi::typeid_for_fnabi
  25:     0x7f809ba1effb - rustc_symbol_mangling[6b4956763d16dce]::typeid::typeid_for_fnabi
  26:     0x7f8099c7b3e5 - <rustc_codegen_llvm[765025461e4e1812]::context::CodegenCx as rustc_codegen_ssa[5084c2222c6bb39a]::traits::declare::PreDefineMethods>::predefine_fn
  27:     0x7f809aa02afd - rustc_codegen_llvm[765025461e4e1812]::base::compile_codegen_unit::module_codegen
  28:     0x7f809ab677f9 - <rustc_query_system[185c665dfe85c460]::dep_graph::graph::DepGraph<rustc_middle[446de68b5eb34c50]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[446de68b5eb34c50]::ty::context::TyCtxt, rustc_span[a3f8d340880b7e2f]::symbol::Symbol, rustc_codegen_ssa[5084c2222c6bb39a]::ModuleCodegen<rustc_codegen_llvm[765025461e4e1812]::ModuleLlvm>>
  29:     0x7f809ab66499 - rustc_codegen_llvm[765025461e4e1812]::base::compile_codegen_unit
  30:     0x7f809ab64ba3 - rustc_codegen_ssa[5084c2222c6bb39a]::base::codegen_crate::<rustc_codegen_llvm[765025461e4e1812]::LlvmCodegenBackend>
  31:     0x7f809ab6437e - <rustc_codegen_llvm[765025461e4e1812]::LlvmCodegenBackend as rustc_codegen_ssa[5084c2222c6bb39a]::traits::backend::CodegenBackend>::codegen_crate
  32:     0x7f809a71f24c - <rustc_session[af48ca6573de68ee]::session::Session>::time::<alloc[f844ba373310351c]::boxed::Box<dyn core[952f8ce8af40b96d]::any::Any>, rustc_interface[6393774c6f4fd726]::passes::start_codegen::{closure#0}>
  33:     0x7f809a71eb83 - <rustc_interface[6393774c6f4fd726]::passes::QueryContext>::enter::<<rustc_interface[6393774c6f4fd726]::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core[952f8ce8af40b96d]::result::Result<alloc[f844ba373310351c]::boxed::Box<dyn core[952f8ce8af40b96d]::any::Any>, rustc_errors[13c7440083677ba0]::ErrorGuaranteed>>
  34:     0x7f809a715f73 - <rustc_interface[6393774c6f4fd726]::queries::Queries>::ongoing_codegen
  35:     0x7f809a715011 - <rustc_interface[6393774c6f4fd726]::interface::Compiler>::enter::<rustc_driver[6d8c1393407eb5ff]::run_compiler::{closure#1}::{closure#2}, core[952f8ce8af40b96d]::result::Result<core[952f8ce8af40b96d]::option::Option<rustc_interface[6393774c6f4fd726]::queries::Linker>, rustc_errors[13c7440083677ba0]::ErrorGuaranteed>>
  36:     0x7f809a710acc - rustc_span[a3f8d340880b7e2f]::with_source_map::<core[952f8ce8af40b96d]::result::Result<(), rustc_errors[13c7440083677ba0]::ErrorGuaranteed>, rustc_interface[6393774c6f4fd726]::interface::create_compiler_and_run<core[952f8ce8af40b96d]::result::Result<(), rustc_errors[13c7440083677ba0]::ErrorGuaranteed>, rustc_driver[6d8c1393407eb5ff]::run_compiler::{closure#1}>::{closure#1}>
  37:     0x7f809a7104b2 - rustc_interface[6393774c6f4fd726]::interface::create_compiler_and_run::<core[952f8ce8af40b96d]::result::Result<(), rustc_errors[13c7440083677ba0]::ErrorGuaranteed>, rustc_driver[6d8c1393407eb5ff]::run_compiler::{closure#1}>
  38:     0x7f809a70f051 - <scoped_tls[9a3b36d7c76a010]::ScopedKey<rustc_span[a3f8d340880b7e2f]::SessionGlobals>>::set::<rustc_interface[6393774c6f4fd726]::interface::run_compiler<core[952f8ce8af40b96d]::result::Result<(), rustc_errors[13c7440083677ba0]::ErrorGuaranteed>, rustc_driver[6d8c1393407eb5ff]::run_compiler::{closure#1}>::{closure#0}, core[952f8ce8af40b96d]::result::Result<(), rustc_errors[13c7440083677ba0]::ErrorGuaranteed>>
  39:     0x7f809a70ed3f - std[acaeed3f89206b7c]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[6393774c6f4fd726]::util::run_in_thread_pool_with_globals<rustc_interface[6393774c6f4fd726]::interface::run_compiler<core[952f8ce8af40b96d]::result::Result<(), rustc_errors[13c7440083677ba0]::ErrorGuaranteed>, rustc_driver[6d8c1393407eb5ff]::run_compiler::{closure#1}>::{closure#0}, core[952f8ce8af40b96d]::result::Result<(), rustc_errors[13c7440083677ba0]::ErrorGuaranteed>>::{closure#0}, core[952f8ce8af40b96d]::result::Result<(), rustc_errors[13c7440083677ba0]::ErrorGuaranteed>>
  40:     0x7f809ad63979 - <<std[acaeed3f89206b7c]::thread::Builder>::spawn_unchecked_<rustc_interface[6393774c6f4fd726]::util::run_in_thread_pool_with_globals<rustc_interface[6393774c6f4fd726]::interface::run_compiler<core[952f8ce8af40b96d]::result::Result<(), rustc_errors[13c7440083677ba0]::ErrorGuaranteed>, rustc_driver[6d8c1393407eb5ff]::run_compiler::{closure#1}>::{closure#0}, core[952f8ce8af40b96d]::result::Result<(), rustc_errors[13c7440083677ba0]::ErrorGuaranteed>>::{closure#0}, core[952f8ce8af40b96d]::result::Result<(), rustc_errors[13c7440083677ba0]::ErrorGuaranteed>>::{closure#1} as core[952f8ce8af40b96d]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  41:     0x7f809870f9c3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h6c736715ca9b28d8
                               at /rustc/6c943bad02626dddc5e5135b23c77429b6e4a063/library/alloc/src/boxed.rs:1935:9
  42:     0x7f809870f9c3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h6ebbe313642a96d7
                               at /rustc/6c943bad02626dddc5e5135b23c77429b6e4a063/library/alloc/src/boxed.rs:1935:9
  43:     0x7f809870f9c3 - std::sys::unix::thread::Thread::new::thread_start::h214ebd9a6e392fdc
                               at /rustc/6c943bad02626dddc5e5135b23c77429b6e4a063/library/std/src/sys/unix/thread.rs:108:17
  44:     0x7f809846c78d - <unknown>
  45:     0x7f80984ed8e4 - clone
  46:                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.65.0-nightly (6c943bad0 2022-08-19) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z sanitizer=cfi -C lto

query stack during panic:
end of query stack
error: aborting due to previous error; 1 warning emitted

Metadata

Metadata

Assignees

Labels

A-allocatorsArea: Custom and system allocatorsA-sanitizersArea: Sanitizers for correctness and code qualityC-bugCategory: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️PG-exploit-mitigationsProject group: Exploit mitigationsS-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions