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: kcfi: encode_region: unexpected ''static' #123685

Closed
matthiaskrgr opened this issue Apr 9, 2024 · 0 comments · Fixed by #129179
Closed

ICE: kcfi: encode_region: unexpected ''static' #123685

matthiaskrgr opened this issue Apr 9, 2024 · 0 comments · Fixed by #129179
Labels
A-sanitizers Area: Sanitizers for correctness and code quality C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

auto-reduced (treereduce-rust):

trait Empty {}

#[repr(transparent)]
pub struct FunnyPointer(dyn Empty);

#[repr(C)]
pub struct Meta {
    drop_fn: fn(&mut ()),
    size: usize,
    align: usize,
}

impl Meta {
    pub fn new() -> Self {
        Meta {
            drop_fn: |_| {},
            size: 0,
            align: 1,
        }
    }
}

#[repr(C)]
pub struct FatPointer {
    pub data: *const (),
    pub vtable: *const (),
}

impl FunnyPointer {
    pub unsafe fn from_data_ptr(data: &String, ptr: *const Meta) -> &Self {
        let obj = FatPointer {
            data: data as *const _ as *const (),
            vtable: ptr as *const _ as *const (),
        };
        let obj = std::mem::transmute::<FatPointer, *mut FunnyPointer>(obj);
        &*obj
    }
}

fn main() {
    unsafe {
        let meta = Meta::new();
        let hello = "hello".to_string();
        let _raw: &FunnyPointer = FunnyPointer::from_data_ptr(&hello, &meta as *const _);
    }
}

original:

trait Empty {}

#[repr(transparent)]
pub struct FunnyPointer(dyn Empty);

#[repr(C)]
pub struct Meta {
    drop_fn: fn(&mut ()),
    size: usize,
    align: usize,
}

impl Meta {
    pub fn new() -> Self {
        Meta { drop_fn: |_| {}, size: 0, align: 1 }
    }
}

#[repr(C)]
pub struct FatPointer {
    pub data: *const (),
    pub vtable: *const (),
}

impl FunnyPointer {
    pub unsafe fn from_data_ptr(data: &String, ptr: *const Meta) -> &Self {
        let obj = FatPointer {
            data: data as *const _ as *const (),
            vtable: ptr as *const _ as *const (),
        };
        let obj = std::mem::transmute::<FatPointer, *mut FunnyPointer>(obj); //~ ERROR: expected a vtable pointer
        &*obj
    }
}

fn main() {
    unsafe {
        let meta = Meta::new();
        let hello = "hello".to_string();
        let _raw: &FunnyPointer = FunnyPointer::from_data_ptr(&hello, &meta as *const _);
    }
}

Version information

rustc 1.79.0-dev
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-unknown-linux-gnu
release: 1.79.0-dev
LLVM version: 18.1.3

Command:
/home/matthias/.rustup/toolchains/local-debug-assertions/bin/rustc -Zsanitizer=kcfi -Cpanic=abort

Program output

error: internal compiler error: compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/encode.rs:296:13: encode_region: unexpected `'static`

thread 'rustc' panicked at compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/encode.rs:296:13:
Box<dyn Any>
stack backtrace:
   0:     0x71081e980a44 - std::backtrace_rs::backtrace::libunwind::trace::h265d1925ea598df2
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/../../backtrace/src/backtrace/libunwind.rs:105:5
   1:     0x71081e980a44 - std::backtrace_rs::backtrace::trace_unsynchronized::hb7395057f0c5468d
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x71081e980a44 - std::sys_common::backtrace::_print_fmt::h3d47c991162d4e52
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x71081e980a44 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hacda344c49f35c2d
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x71081e9c37e5 - core::fmt::rt::Argument::fmt::h73fccf37a3b29a55
                               at /home/matthias/vcs/github/rust_debug_assertions/library/core/src/fmt/rt.rs:142:9
   5:     0x71081e9c37e5 - core::fmt::write::h5e0aa268252d3b32
                               at /home/matthias/vcs/github/rust_debug_assertions/library/core/src/fmt/mod.rs:1153:17
   6:     0x71081e94b6d9 - std::io::Write::write_fmt::hd8859b8fbc5fad9b
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/io/mod.rs:1843:15
   7:     0x71081e9807fe - std::sys_common::backtrace::_print::hd162dc200d0a9165
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x71081e9807fe - std::sys_common::backtrace::print::h5331a7a997abba9a
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x71081e96684a - std::panicking::default_hook::{{closure}}::hde322b8785a305f9
  10:     0x71081e966546 - std::panicking::default_hook::h8bb4e5b2167fa65c
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/panicking.rs:291:9
  11:     0x71082158e198 - rustc_driver_impl[3245b2fc008c51d3]::install_ice_hook::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_driver_impl/src/lib.rs:1351:17
  12:     0x71082158e198 - <alloc[7a6344611ae1f7a8]::boxed::Box<rustc_driver_impl[3245b2fc008c51d3]::install_ice_hook::{closure#0}> as core[bf256ce745c7f201]::ops::function::Fn<(&dyn for<'a, 'b> core[bf256ce745c7f201]::ops::function::Fn<(&'a core[bf256ce745c7f201]::panic::panic_info::PanicInfo<'b>,), Output = ()> + core[bf256ce745c7f201]::marker::Send + core[bf256ce745c7f201]::marker::Sync, &core[bf256ce745c7f201]::panic::panic_info::PanicInfo)>>::call
                               at /home/matthias/vcs/github/rust_debug_assertions/library/alloc/src/boxed.rs:2032:9
  13:     0x71081e966dd1 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h8e32d665fbe06219
                               at /home/matthias/vcs/github/rust_debug_assertions/library/alloc/src/boxed.rs:2032:9
  14:     0x71081e966dd1 - std::panicking::rust_panic_with_hook::h6c21735fa2b9110c
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/panicking.rs:792:13
  15:     0x7108216ce226 - std[5dd5c2799579c4c8]::panicking::begin_panic::<rustc_errors[c9f9645da0d6d137]::ExplicitBug>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/panicking.rs:687:9
  16:     0x7108216cce16 - std[5dd5c2799579c4c8]::sys_common::backtrace::__rust_end_short_backtrace::<std[5dd5c2799579c4c8]::panicking::begin_panic<rustc_errors[c9f9645da0d6d137]::ExplicitBug>::{closure#0}, !>
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/sys_common/backtrace.rs:171:18
  17:     0x7108216e8ca6 - std[5dd5c2799579c4c8]::panicking::begin_panic::<rustc_errors[c9f9645da0d6d137]::ExplicitBug>
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/panicking.rs:686:12
  18:     0x7108216bc291 - std[5dd5c2799579c4c8]::panic::panic_any::<rustc_errors[c9f9645da0d6d137]::ExplicitBug>
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/panic.rs:63:5
  19:     0x7108216bc291 - <rustc_errors[c9f9645da0d6d137]::diagnostic::BugAbort as rustc_errors[c9f9645da0d6d137]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_errors/src/diagnostic.rs:84:9
  20:     0x710822856cb0 - <rustc_errors[c9f9645da0d6d137]::diagnostic::Diag<rustc_errors[c9f9645da0d6d137]::diagnostic::BugAbort>>::emit
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_errors/src/diagnostic.rs:1320:9
  21:     0x710822856cb0 - <rustc_errors[c9f9645da0d6d137]::DiagCtxt>::bug::<alloc[7a6344611ae1f7a8]::string::String>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_errors/src/lib.rs:1126:30
  22:     0x710822856cb0 - rustc_middle[340db270b268494c]::util::bug::opt_span_bug_fmt::<rustc_span[911f79266521dd07]::span_encoding::Span>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/util/bug.rs:37:48
  23:     0x710822856972 - rustc_middle[340db270b268494c]::ty::context::tls::with_opt::<rustc_middle[340db270b268494c]::util::bug::opt_span_bug_fmt<rustc_span[911f79266521dd07]::span_encoding::Span>::{closure#0}, !>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context/tls.rs:158:23
  24:     0x71082285692b - rustc_middle[340db270b268494c]::ty::context::tls::with_context_opt::<rustc_middle[340db270b268494c]::ty::context::tls::with_opt<rustc_middle[340db270b268494c]::util::bug::opt_span_bug_fmt<rustc_span[911f79266521dd07]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  25:     0x710822856ba0 - rustc_middle[340db270b268494c]::ty::context::tls::with_opt::<rustc_middle[340db270b268494c]::util::bug::opt_span_bug_fmt<rustc_span[911f79266521dd07]::span_encoding::Span>::{closure#0}, !>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context/tls.rs:156:5
  26:     0x710822856ba0 - rustc_middle[340db270b268494c]::util::bug::opt_span_bug_fmt::<rustc_span[911f79266521dd07]::span_encoding::Span>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/util/bug.rs:31:5
  27:     0x710822856ba0 - rustc_middle[340db270b268494c]::util::bug::bug_fmt
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/util/bug.rs:15:5
  28:     0x710823a4c27a - rustc_sanitizers[cb8bd6ee71e8255]::cfi::typeid::itanium_cxx_abi::encode::encode_region
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/encode.rs:296:13
  29:     0x710823a4edce - rustc_sanitizers[cb8bd6ee71e8255]::cfi::typeid::itanium_cxx_abi::encode::encode_ty
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/encode.rs:610:25
  30:     0x710823a4e6d1 - rustc_sanitizers[cb8bd6ee71e8255]::cfi::typeid::itanium_cxx_abi::encode::encode_ty
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/encode.rs:569:25
  31:     0x710823a52d10 - rustc_sanitizers[cb8bd6ee71e8255]::cfi::typeid::itanium_cxx_abi::typeid_for_fnabi
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/mod.rs:60:22
  32:     0x710823a53f84 - rustc_sanitizers[cb8bd6ee71e8255]::cfi::typeid::itanium_cxx_abi::typeid_for_instance
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/mod.rs:122:5
  33:     0x710823a5aff6 - rustc_sanitizers[cb8bd6ee71e8255]::kcfi::typeid::typeid_for_instance
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_sanitizers/src/kcfi/typeid/mod.rs:53:16
  34:     0x7108210dea64 - <rustc_codegen_llvm[ad47ec0b1bae30a6]::context::CodegenCx>::declare_fn
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_codegen_llvm/src/declare.rs:184:35
  35:     0x7108210df913 - <rustc_codegen_llvm[ad47ec0b1bae30a6]::context::CodegenCx as rustc_codegen_ssa[85967c5d94f5bca9]::traits::declare::PreDefineMethods>::predefine_fn
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_codegen_llvm/src/mono_item.rs:63:22
  36:     0x710821169515 - <rustc_middle[340db270b268494c]::mir::mono::MonoItem as rustc_codegen_ssa[85967c5d94f5bca9]::mono_item::MonoItemExt>::predefine::<rustc_codegen_llvm[ad47ec0b1bae30a6]::builder::Builder>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_codegen_ssa/src/mono_item.rs:138:17
  37:     0x710821121440 - rustc_codegen_llvm[ad47ec0b1bae30a6]::base::compile_codegen_unit::module_codegen
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_codegen_llvm/src/base.rs:88:17
  38:     0x710821120249 - <rustc_query_system[4fa63941cdc3ebb8]::dep_graph::graph::DepGraph<rustc_middle[340db270b268494c]::dep_graph::DepsType>>::with_task::<rustc_middle[340db270b268494c]::ty::context::TyCtxt, rustc_span[911f79266521dd07]::symbol::Symbol, rustc_codegen_ssa[85967c5d94f5bca9]::ModuleCodegen<rustc_codegen_llvm[ad47ec0b1bae30a6]::ModuleLlvm>>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_query_system/src/dep_graph/graph.rs:285:22
  39:     0x710821120249 - rustc_codegen_llvm[ad47ec0b1bae30a6]::base::compile_codegen_unit
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_codegen_llvm/src/base.rs:62:23
  40:     0x7108210547c1 - <rustc_codegen_llvm[ad47ec0b1bae30a6]::LlvmCodegenBackend as rustc_codegen_ssa[85967c5d94f5bca9]::traits::backend::ExtraBackendMethods>::compile_codegen_unit
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_codegen_llvm/src/lib.rs:134:9
  41:     0x7108210547c1 - rustc_codegen_ssa[85967c5d94f5bca9]::base::codegen_crate::<rustc_codegen_llvm[ad47ec0b1bae30a6]::LlvmCodegenBackend>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_codegen_ssa/src/base.rs:778:34
  42:     0x71082104fd83 - <rustc_codegen_llvm[ad47ec0b1bae30a6]::LlvmCodegenBackend as rustc_codegen_ssa[85967c5d94f5bca9]::traits::backend::CodegenBackend>::codegen_crate
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_codegen_llvm/src/lib.rs:358:18
  43:     0x71082228f367 - rustc_interface[df967e2b539786db]::passes::start_codegen::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_interface/src/passes.rs:930:9
  44:     0x71082228f367 - <rustc_data_structures[652bf30183ef56b3]::profiling::VerboseTimingGuard>::run::<alloc[7a6344611ae1f7a8]::boxed::Box<dyn core[bf256ce745c7f201]::any::Any>, rustc_interface[df967e2b539786db]::passes::start_codegen::{closure#0}>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_data_structures/src/profiling.rs:753:9
  45:     0x71082228f367 - <rustc_session[7fd02da4d67d248f]::session::Session>::time::<alloc[7a6344611ae1f7a8]::boxed::Box<dyn core[bf256ce745c7f201]::any::Any>, rustc_interface[df967e2b539786db]::passes::start_codegen::{closure#0}>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_session/src/utils.rs:15:9
  46:     0x7108221d6d24 - rustc_interface[df967e2b539786db]::passes::start_codegen
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_interface/src/passes.rs:929:19
  47:     0x71082229782b - <rustc_interface[df967e2b539786db]::queries::Queries>::codegen_and_build_linker::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_interface/src/queries.rs:229:35
  48:     0x71082229782b - <rustc_middle[340db270b268494c]::ty::context::GlobalCtxt>::enter::<<rustc_interface[df967e2b539786db]::queries::Queries>::codegen_and_build_linker::{closure#0}, core[bf256ce745c7f201]::result::Result<rustc_interface[df967e2b539786db]::queries::Linker, rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#1}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context.rs:778:37
  49:     0x71082229782b - rustc_middle[340db270b268494c]::ty::context::tls::enter_context::<<rustc_middle[340db270b268494c]::ty::context::GlobalCtxt>::enter<<rustc_interface[df967e2b539786db]::queries::Queries>::codegen_and_build_linker::{closure#0}, core[bf256ce745c7f201]::result::Result<rustc_interface[df967e2b539786db]::queries::Linker, rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#1}, core[bf256ce745c7f201]::result::Result<rustc_interface[df967e2b539786db]::queries::Linker, rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context/tls.rs:82:9
  50:     0x71082229782b - <std[5dd5c2799579c4c8]::thread::local::LocalKey<core[bf256ce745c7f201]::cell::Cell<*const ()>>>::try_with::<rustc_middle[340db270b268494c]::ty::context::tls::enter_context<<rustc_middle[340db270b268494c]::ty::context::GlobalCtxt>::enter<<rustc_interface[df967e2b539786db]::queries::Queries>::codegen_and_build_linker::{closure#0}, core[bf256ce745c7f201]::result::Result<rustc_interface[df967e2b539786db]::queries::Linker, rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#1}, core[bf256ce745c7f201]::result::Result<rustc_interface[df967e2b539786db]::queries::Linker, rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#0}, core[bf256ce745c7f201]::result::Result<rustc_interface[df967e2b539786db]::queries::Linker, rustc_span[911f79266521dd07]::ErrorGuaranteed>>
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/thread/local.rs:284:16
  51:     0x71082229782b - <std[5dd5c2799579c4c8]::thread::local::LocalKey<core[bf256ce745c7f201]::cell::Cell<*const ()>>>::with::<rustc_middle[340db270b268494c]::ty::context::tls::enter_context<<rustc_middle[340db270b268494c]::ty::context::GlobalCtxt>::enter<<rustc_interface[df967e2b539786db]::queries::Queries>::codegen_and_build_linker::{closure#0}, core[bf256ce745c7f201]::result::Result<rustc_interface[df967e2b539786db]::queries::Linker, rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#1}, core[bf256ce745c7f201]::result::Result<rustc_interface[df967e2b539786db]::queries::Linker, rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#0}, core[bf256ce745c7f201]::result::Result<rustc_interface[df967e2b539786db]::queries::Linker, rustc_span[911f79266521dd07]::ErrorGuaranteed>>
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/thread/local.rs:260:9
  52:     0x71082229782b - rustc_middle[340db270b268494c]::ty::context::tls::enter_context::<<rustc_middle[340db270b268494c]::ty::context::GlobalCtxt>::enter<<rustc_interface[df967e2b539786db]::queries::Queries>::codegen_and_build_linker::{closure#0}, core[bf256ce745c7f201]::result::Result<rustc_interface[df967e2b539786db]::queries::Linker, rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#1}, core[bf256ce745c7f201]::result::Result<rustc_interface[df967e2b539786db]::queries::Linker, rustc_span[911f79266521dd07]::ErrorGuaranteed>>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context/tls.rs:79:9
  53:     0x71082229782b - <rustc_middle[340db270b268494c]::ty::context::GlobalCtxt>::enter::<<rustc_interface[df967e2b539786db]::queries::Queries>::codegen_and_build_linker::{closure#0}, core[bf256ce745c7f201]::result::Result<rustc_interface[df967e2b539786db]::queries::Linker, rustc_span[911f79266521dd07]::ErrorGuaranteed>>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_middle/src/ty/context.rs:778:9
  54:     0x7108221ff0b0 - <rustc_interface[df967e2b539786db]::queries::QueryResult<&rustc_middle[340db270b268494c]::ty::context::GlobalCtxt>>::enter::<core[bf256ce745c7f201]::result::Result<rustc_interface[df967e2b539786db]::queries::Linker, rustc_span[911f79266521dd07]::ErrorGuaranteed>, <rustc_interface[df967e2b539786db]::queries::Queries>::codegen_and_build_linker::{closure#0}>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_interface/src/queries.rs:70:9
  55:     0x7108221ff0b0 - <rustc_interface[df967e2b539786db]::queries::Queries>::codegen_and_build_linker
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_interface/src/queries.rs:218:9
  56:     0x7108215e2678 - rustc_driver_impl[3245b2fc008c51d3]::run_compiler::{closure#0}::{closure#1}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_driver_impl/src/lib.rs:447:26
  57:     0x7108215e2678 - <rustc_interface[df967e2b539786db]::interface::Compiler>::enter::<rustc_driver_impl[3245b2fc008c51d3]::run_compiler::{closure#0}::{closure#1}, core[bf256ce745c7f201]::result::Result<core[bf256ce745c7f201]::option::Option<rustc_interface[df967e2b539786db]::queries::Linker>, rustc_span[911f79266521dd07]::ErrorGuaranteed>>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_interface/src/queries.rs:309:19
  58:     0x710821598a2c - rustc_driver_impl[3245b2fc008c51d3]::run_compiler::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_driver_impl/src/lib.rs:389:22
  59:     0x710821598a2c - rustc_interface[df967e2b539786db]::interface::run_compiler::<core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>, rustc_driver_impl[3245b2fc008c51d3]::run_compiler::{closure#0}>::{closure#0}::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_interface/src/interface.rs:457:31
  60:     0x710821598a2c - rustc_span[911f79266521dd07]::set_source_map::<core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>, rustc_interface[df967e2b539786db]::interface::run_compiler<core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>, rustc_driver_impl[3245b2fc008c51d3]::run_compiler::{closure#0}>::{closure#0}::{closure#0}>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_span/src/lib.rs:1298:5
  61:     0x7108215a631a - rustc_interface[df967e2b539786db]::interface::run_compiler::<core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>, rustc_driver_impl[3245b2fc008c51d3]::run_compiler::{closure#0}>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_interface/src/interface.rs:443:13
  62:     0x7108215a631a - rustc_interface[df967e2b539786db]::util::run_in_thread_pool_with_globals::<rustc_interface[df967e2b539786db]::interface::run_compiler<core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>, rustc_driver_impl[3245b2fc008c51d3]::run_compiler::{closure#0}>::{closure#0}, core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_interface/src/util.rs:127:13
  63:     0x7108215a631a - rustc_interface[df967e2b539786db]::util::run_in_thread_with_globals::<rustc_interface[df967e2b539786db]::util::run_in_thread_pool_with_globals<rustc_interface[df967e2b539786db]::interface::run_compiler<core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>, rustc_driver_impl[3245b2fc008c51d3]::run_compiler::{closure#0}>::{closure#0}, core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#0}, core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_interface/src/util.rs:87:69
  64:     0x7108215a631a - <scoped_tls[ce67bb9be36aec5f]::ScopedKey<rustc_span[911f79266521dd07]::SessionGlobals>>::set::<rustc_interface[df967e2b539786db]::util::run_in_thread_with_globals<rustc_interface[df967e2b539786db]::util::run_in_thread_pool_with_globals<rustc_interface[df967e2b539786db]::interface::run_compiler<core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>, rustc_driver_impl[3245b2fc008c51d3]::run_compiler::{closure#0}>::{closure#0}, core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#0}, core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}, core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>>
                               at /home/matthias/.cargo/registry/src/index.crates.io-6f17d22bba15001f/scoped-tls-1.0.1/src/lib.rs:137:9
  65:     0x7108215a631a - rustc_span[911f79266521dd07]::create_session_globals_then::<core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>, rustc_interface[df967e2b539786db]::util::run_in_thread_with_globals<rustc_interface[df967e2b539786db]::util::run_in_thread_pool_with_globals<rustc_interface[df967e2b539786db]::interface::run_compiler<core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>, rustc_driver_impl[3245b2fc008c51d3]::run_compiler::{closure#0}>::{closure#0}, core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#0}, core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}>
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_span/src/lib.rs:136:5
  66:     0x7108215a631a - rustc_interface[df967e2b539786db]::util::run_in_thread_with_globals::<rustc_interface[df967e2b539786db]::util::run_in_thread_pool_with_globals<rustc_interface[df967e2b539786db]::interface::run_compiler<core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>, rustc_driver_impl[3245b2fc008c51d3]::run_compiler::{closure#0}>::{closure#0}, core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#0}, core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#0}::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/compiler/rustc_interface/src/util.rs:87:17
  67:     0x7108215a631a - std[5dd5c2799579c4c8]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[df967e2b539786db]::util::run_in_thread_with_globals<rustc_interface[df967e2b539786db]::util::run_in_thread_pool_with_globals<rustc_interface[df967e2b539786db]::interface::run_compiler<core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>, rustc_driver_impl[3245b2fc008c51d3]::run_compiler::{closure#0}>::{closure#0}, core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#0}, core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>>
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/sys_common/backtrace.rs:155:18
  68:     0x710821578646 - <std[5dd5c2799579c4c8]::thread::Builder>::spawn_unchecked_::<rustc_interface[df967e2b539786db]::util::run_in_thread_with_globals<rustc_interface[df967e2b539786db]::util::run_in_thread_pool_with_globals<rustc_interface[df967e2b539786db]::interface::run_compiler<core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>, rustc_driver_impl[3245b2fc008c51d3]::run_compiler::{closure#0}>::{closure#0}, core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#0}, core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#1}::{closure#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/thread/mod.rs:523:17
  69:     0x710821578646 - <core[bf256ce745c7f201]::panic::unwind_safe::AssertUnwindSafe<<std[5dd5c2799579c4c8]::thread::Builder>::spawn_unchecked_<rustc_interface[df967e2b539786db]::util::run_in_thread_with_globals<rustc_interface[df967e2b539786db]::util::run_in_thread_pool_with_globals<rustc_interface[df967e2b539786db]::interface::run_compiler<core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>, rustc_driver_impl[3245b2fc008c51d3]::run_compiler::{closure#0}>::{closure#0}, core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#0}, core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#1}::{closure#0}> as core[bf256ce745c7f201]::ops::function::FnOnce<()>>::call_once
                               at /home/matthias/vcs/github/rust_debug_assertions/library/core/src/panic/unwind_safe.rs:272:9
  70:     0x710821578646 - std[5dd5c2799579c4c8]::panicking::try::do_call::<core[bf256ce745c7f201]::panic::unwind_safe::AssertUnwindSafe<<std[5dd5c2799579c4c8]::thread::Builder>::spawn_unchecked_<rustc_interface[df967e2b539786db]::util::run_in_thread_with_globals<rustc_interface[df967e2b539786db]::util::run_in_thread_pool_with_globals<rustc_interface[df967e2b539786db]::interface::run_compiler<core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>, rustc_driver_impl[3245b2fc008c51d3]::run_compiler::{closure#0}>::{closure#0}, core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#0}, core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#1}::{closure#0}>, core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>>
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/panicking.rs:552:40
  71:     0x710821578646 - std[5dd5c2799579c4c8]::panicking::try::<core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>, core[bf256ce745c7f201]::panic::unwind_safe::AssertUnwindSafe<<std[5dd5c2799579c4c8]::thread::Builder>::spawn_unchecked_<rustc_interface[df967e2b539786db]::util::run_in_thread_with_globals<rustc_interface[df967e2b539786db]::util::run_in_thread_pool_with_globals<rustc_interface[df967e2b539786db]::interface::run_compiler<core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>, rustc_driver_impl[3245b2fc008c51d3]::run_compiler::{closure#0}>::{closure#0}, core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#0}, core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#1}::{closure#0}>>
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/panicking.rs:516:19
  72:     0x710821578646 - std[5dd5c2799579c4c8]::panic::catch_unwind::<core[bf256ce745c7f201]::panic::unwind_safe::AssertUnwindSafe<<std[5dd5c2799579c4c8]::thread::Builder>::spawn_unchecked_<rustc_interface[df967e2b539786db]::util::run_in_thread_with_globals<rustc_interface[df967e2b539786db]::util::run_in_thread_pool_with_globals<rustc_interface[df967e2b539786db]::interface::run_compiler<core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>, rustc_driver_impl[3245b2fc008c51d3]::run_compiler::{closure#0}>::{closure#0}, core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#0}, core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#1}::{closure#0}>, core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>>
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/panic.rs:149:14
  73:     0x710821578646 - <std[5dd5c2799579c4c8]::thread::Builder>::spawn_unchecked_::<rustc_interface[df967e2b539786db]::util::run_in_thread_with_globals<rustc_interface[df967e2b539786db]::util::run_in_thread_pool_with_globals<rustc_interface[df967e2b539786db]::interface::run_compiler<core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>, rustc_driver_impl[3245b2fc008c51d3]::run_compiler::{closure#0}>::{closure#0}, core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#0}, core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#1}
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/thread/mod.rs:522:30
  74:     0x710821578646 - <<std[5dd5c2799579c4c8]::thread::Builder>::spawn_unchecked_<rustc_interface[df967e2b539786db]::util::run_in_thread_with_globals<rustc_interface[df967e2b539786db]::util::run_in_thread_pool_with_globals<rustc_interface[df967e2b539786db]::interface::run_compiler<core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>, rustc_driver_impl[3245b2fc008c51d3]::run_compiler::{closure#0}>::{closure#0}, core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#0}, core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[bf256ce745c7f201]::result::Result<(), rustc_span[911f79266521dd07]::ErrorGuaranteed>>::{closure#1} as core[bf256ce745c7f201]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
                               at /home/matthias/vcs/github/rust_debug_assertions/library/core/src/ops/function.rs:250:5
  75:     0x71081e962cfc - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h8359d578612435ff
                               at /home/matthias/vcs/github/rust_debug_assertions/library/alloc/src/boxed.rs:2018:9
  76:     0x71081e962cfc - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h3bef1189ba9d16a8
                               at /home/matthias/vcs/github/rust_debug_assertions/library/alloc/src/boxed.rs:2018:9
  77:     0x71081e92dd1b - std::sys::pal::unix::thread::Thread::new::thread_start::hff4d30634718def3
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/sys/pal/unix/thread.rs:108:17
  78:     0x71081e6e655a - <unknown>
  79:     0x71081e763a3c - <unknown>
  80:                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.79.0-dev running on x86_64-unknown-linux-gnu

note: compiler flags: -Z sanitizer=kcfi -C panic=abort -Z dump-mir-dir=dir

query stack during panic:
end of query stack
error: aborting due to 1 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. A-sanitizers Area: Sanitizers for correctness and code quality C-bug Category: This is a bug. labels Apr 9, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Apr 9, 2024
@jieyouxu jieyouxu added S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Apr 15, 2024
@bors bors closed this as completed in 7da4b2d Aug 21, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Aug 21, 2024
Rollup merge of rust-lang#129179 - compiler-errors:cfi-erase-transparent, r=davidtwco

CFI: Erase regions when projecting ADT to its transparent non-1zst field

The output from `FieldDef::ty` (or `TyCtxt::type_of`) may have free regions (well, `'static`) -- erase it.

Fixes rust-lang#129169
Fixes rust-lang#123685
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sanitizers Area: Sanitizers for correctness and code quality C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue 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.

3 participants