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 with -Zextra-const-ub-checks: normalization works on validated constants #100771

Closed
matthiaskrgr opened this issue Aug 19, 2022 · 4 comments · Fixed by #100861
Closed

ICE with -Zextra-const-ub-checks: normalization works on validated constants #100771

matthiaskrgr opened this issue Aug 19, 2022 · 4 comments · Fixed by #100861
Labels
C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. 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

code from rustc ./src/test/ui/consts/packed_pattern.rs

// run-pass

#[derive(PartialEq, Eq, Copy, Clone)]
#[repr(packed)]
struct Foo {
    field: (i64, u32, u32, u32),
}

const FOO: Foo = Foo {
    field: (5, 6, 7, 8),
};

fn main() {
    match FOO {
        Foo { field: (5, 6, 7, 8) } => {},
        FOO => unreachable!(), //~ WARNING unreachable pattern
        _ => unreachable!(),
    }
}

this causes a new panic when executed via miri:

Preparing a sysroot for Miri (target: x86_64-unknown-linux-gnu)... done
WARNING: Ignoring `RUSTC_WRAPPER` environment variable, Miri does not support wrapping.
    Finished dev [unoptimized + debuginfo] target(s) in 0.01s
     Running `/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo-miri runner target/miri/x86_64-unknown-linux-gnu/debug/ff`
thread 'rustc' panicked at 'normalization works on validated constants: InterpErrorInfo(InterpErrorInfoInner { kind: accessing memory with alignment 1, but alignment 8 is required, backtrace: None })', compiler/rustc_const_eval/src/const_eval/eval_queries.rs:132:36
stack backtrace:
   0:     0x7fc271d216d0 - std::backtrace_rs::backtrace::libunwind::trace::hdc27bfa6aa97f84d
                               at /rustc/0b79f758c9aa6646606662a6d623a0752286cd17/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   1:     0x7fc271d216d0 - std::backtrace_rs::backtrace::trace_unsynchronized::hd260a87da0307fa5
                               at /rustc/0b79f758c9aa6646606662a6d623a0752286cd17/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fc271d216d0 - std::sys_common::backtrace::_print_fmt::h789cb96c4a337f2c
                               at /rustc/0b79f758c9aa6646606662a6d623a0752286cd17/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7fc271d216d0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h36bc3de3612a60f5
                               at /rustc/0b79f758c9aa6646606662a6d623a0752286cd17/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7fc271d7c76e - core::fmt::write::h2db4bfe92ef037b0
                               at /rustc/0b79f758c9aa6646606662a6d623a0752286cd17/library/core/src/fmt/mod.rs:1202:17
   5:     0x7fc271d124d5 - std::io::Write::write_fmt::hcd345fc714a96537
                               at /rustc/0b79f758c9aa6646606662a6d623a0752286cd17/library/std/src/io/mod.rs:1672:15
   6:     0x7fc271d24393 - std::sys_common::backtrace::_print::hcf53c28899e66110
                               at /rustc/0b79f758c9aa6646606662a6d623a0752286cd17/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7fc271d24393 - std::sys_common::backtrace::print::hd8ec3e1ae139ef7a
                               at /rustc/0b79f758c9aa6646606662a6d623a0752286cd17/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7fc271d24393 - std::panicking::default_hook::{{closure}}::he70b99e2f9e5bd44
                               at /rustc/0b79f758c9aa6646606662a6d623a0752286cd17/library/std/src/panicking.rs:295:22
   9:     0x7fc271d2407f - std::panicking::default_hook::h8d91a23b91011754
                               at /rustc/0b79f758c9aa6646606662a6d623a0752286cd17/library/std/src/panicking.rs:314:9
  10:     0x7fc274563644 - <rustc_driver[d9adb13473fd7853]::DEFAULT_HOOK::{closure#0}::{closure#0} as core[97bb3a13db18d0cb]::ops::function::FnOnce<(&core[97bb3a13db18d0cb]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  11:     0x7fc271d24bcd - std::panicking::rust_panic_with_hook::h5af783bc1124b2c1
                               at /rustc/0b79f758c9aa6646606662a6d623a0752286cd17/library/std/src/panicking.rs:702:17
  12:     0x7fc271d24a27 - std::panicking::begin_panic_handler::{{closure}}::h234d8ef84a25d2ee
                               at /rustc/0b79f758c9aa6646606662a6d623a0752286cd17/library/std/src/panicking.rs:588:13
  13:     0x7fc271d21bdc - std::sys_common::backtrace::__rust_end_short_backtrace::he0cdebe1a4227e87
                               at /rustc/0b79f758c9aa6646606662a6d623a0752286cd17/library/std/src/sys_common/backtrace.rs:138:18
  14:     0x7fc271d24742 - rust_begin_unwind
                               at /rustc/0b79f758c9aa6646606662a6d623a0752286cd17/library/std/src/panicking.rs:584:5
  15:     0x7fc271d79283 - core::panicking::panic_fmt::hfb889492842f4bec
                               at /rustc/0b79f758c9aa6646606662a6d623a0752286cd17/library/core/src/panicking.rs:142:14
  16:     0x7fc271d795e3 - core::result::unwrap_failed::hecfa3811d2c0fa35
                               at /rustc/0b79f758c9aa6646606662a6d623a0752286cd17/library/core/src/result.rs:1814:5
  17:     0x7fc273f6346e - rustc_const_eval[22f532cf3fc8f4c3]::const_eval::eval_queries::op_to_const
  18:     0x7fc27414d4d0 - <alloc[d0a20223ecbdb9c4]::vec::Vec<rustc_middle[151dce3d5e114089]::mir::ConstantKind> as alloc[d0a20223ecbdb9c4]::vec::spec_from_iter::SpecFromIter<rustc_middle[151dce3d5e114089]::mir::ConstantKind, core[97bb3a13db18d0cb]::iter::adapters::GenericShunt<core[97bb3a13db18d0cb]::iter::adapters::map::Map<core[97bb3a13db18d0cb]::ops::range::Range<usize>, rustc_const_eval[22f532cf3fc8f4c3]::const_eval::try_destructure_mir_constant::{closure#0}>, core[97bb3a13db18d0cb]::result::Result<core[97bb3a13db18d0cb]::convert::Infallible, rustc_middle[151dce3d5e114089]::mir::interpret::error::InterpErrorInfo>>>>::from_iter
  19:     0x7fc274234066 - rustc_const_eval[22f532cf3fc8f4c3]::const_eval::try_destructure_mir_constant
  20:     0x7fc274233dd7 - <rustc_const_eval[22f532cf3fc8f4c3]::provide::{closure#1} as core[97bb3a13db18d0cb]::ops::function::FnOnce<(rustc_middle[151dce3d5e114089]::ty::context::TyCtxt, rustc_middle[151dce3d5e114089]::ty::ParamEnvAnd<rustc_middle[151dce3d5e114089]::mir::ConstantKind>)>>::call_once
  21:     0x7fc27423ad2c - <rustc_query_system[2040a19449a5eda6]::dep_graph::graph::DepGraph<rustc_middle[151dce3d5e114089]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[151dce3d5e114089]::ty::context::TyCtxt, rustc_middle[151dce3d5e114089]::ty::ParamEnvAnd<rustc_middle[151dce3d5e114089]::mir::ConstantKind>, core[97bb3a13db18d0cb]::option::Option<rustc_middle[151dce3d5e114089]::mir::query::DestructuredMirConstant>>
  22:     0x7fc2742398a1 - rustc_query_system[2040a19449a5eda6]::query::plumbing::get_query::<rustc_query_impl[b271cbf8bf993093]::queries::try_destructure_mir_constant, rustc_query_impl[b271cbf8bf993093]::plumbing::QueryCtxt>
  23:     0x7fc274238eed - <rustc_query_impl[b271cbf8bf993093]::Queries as rustc_middle[151dce3d5e114089]::ty::query::QueryEngine>::try_destructure_mir_constant
  24:     0x7fc273141dc6 - <rustc_middle[151dce3d5e114089]::ty::context::TyCtxt>::destructure_mir_constant
  25:     0x7fc27313e7ce - <rustc_mir_build[362d32de073b060d]::thir::pattern::const_to_pat::ConstToPat>::recur
  26:     0x7fc273142e7f - <core[97bb3a13db18d0cb]::iter::adapters::copied::Copied<core[97bb3a13db18d0cb]::slice::iter::Iter<rustc_middle[151dce3d5e114089]::mir::ConstantKind>> as core[97bb3a13db18d0cb]::iter::traits::iterator::Iterator>::try_fold::<(), <core[97bb3a13db18d0cb]::iter::adapters::enumerate::Enumerate<_> as core[97bb3a13db18d0cb]::iter::traits::iterator::Iterator>::try_fold::enumerate<rustc_middle[151dce3d5e114089]::mir::ConstantKind, (), core[97bb3a13db18d0cb]::ops::control_flow::ControlFlow<core[97bb3a13db18d0cb]::ops::control_flow::ControlFlow<rustc_middle[151dce3d5e114089]::thir::FieldPat>>, core[97bb3a13db18d0cb]::iter::adapters::map::map_try_fold<(usize, rustc_middle[151dce3d5e114089]::mir::ConstantKind), core[97bb3a13db18d0cb]::result::Result<rustc_middle[151dce3d5e114089]::thir::FieldPat, rustc_mir_build[362d32de073b060d]::thir::pattern::const_to_pat::fallback_to_const_ref::FallbackToConstRef>, (), core[97bb3a13db18d0cb]::ops::control_flow::ControlFlow<core[97bb3a13db18d0cb]::ops::control_flow::ControlFlow<rustc_middle[151dce3d5e114089]::thir::FieldPat>>, <rustc_mir_build[362d32de073b060d]::thir::pattern::const_to_pat::ConstToPat>::field_pats<core[97bb3a13db18d0cb]::iter::adapters::copied::Copied<core[97bb3a13db18d0cb]::slice::iter::Iter<rustc_middle[151dce3d5e114089]::mir::ConstantKind>>>::{closure#0}, <core[97bb3a13db18d0cb]::iter::adapters::GenericShunt<core[97bb3a13db18d0cb]::iter::adapters::map::Map<core[97bb3a13db18d0cb]::iter::adapters::enumerate::Enumerate<core[97bb3a13db18d0cb]::iter::adapters::copied::Copied<core[97bb3a13db18d0cb]::slice::iter::Iter<rustc_middle[151dce3d5e114089]::mir::ConstantKind>>>, <rustc_mir_build[362d32de073b060d]::thir::pattern::const_to_pat::ConstToPat>::field_pats<core[97bb3a13db18d0cb]::iter::adapters::copied::Copied<core[97bb3a13db18d0cb]::slice::iter::Iter<rustc_middle[151dce3d5e114089]::mir::ConstantKind>>>::{closure#0}>, core[97bb3a13db18d0cb]::result::Result<core[97bb3a13db18d0cb]::convert::Infallible, rustc_mir_build[362d32de073b060d]::thir::pattern::const_to_pat::fallback_to_const_ref::FallbackToConstRef>> as core[97bb3a13db18d0cb]::iter::traits::iterator::Iterator>::try_fold<(), core[97bb3a13db18d0cb]::iter::traits::iterator::Iterator::try_for_each::call<rustc_middle[151dce3d5e114089]::thir::FieldPat, core[97bb3a13db18d0cb]::ops::control_flow::ControlFlow<rustc_middle[151dce3d5e114089]::thir::FieldPat>, core[97bb3a13db18d0cb]::ops::control_flow::ControlFlow<rustc_middle[151dce3d5e114089]::thir::FieldPat>::Break>::{closure#0}, core[97bb3a13db18d0cb]::ops::control_flow::ControlFlow<rustc_middle[151dce3d5e114089]::thir::FieldPat>>::{closure#0}>::{closure#0}>::{closure#0}, core[97bb3a13db18d0cb]::ops::control_flow::ControlFlow<core[97bb3a13db18d0cb]::ops::control_flow::ControlFlow<rustc_middle[151dce3d5e114089]::thir::FieldPat>>>
  27:     0x7fc273142b8b - <alloc[d0a20223ecbdb9c4]::vec::Vec<rustc_middle[151dce3d5e114089]::thir::FieldPat> as alloc[d0a20223ecbdb9c4]::vec::spec_from_iter::SpecFromIter<rustc_middle[151dce3d5e114089]::thir::FieldPat, core[97bb3a13db18d0cb]::iter::adapters::GenericShunt<core[97bb3a13db18d0cb]::iter::adapters::map::Map<core[97bb3a13db18d0cb]::iter::adapters::enumerate::Enumerate<core[97bb3a13db18d0cb]::iter::adapters::copied::Copied<core[97bb3a13db18d0cb]::slice::iter::Iter<rustc_middle[151dce3d5e114089]::mir::ConstantKind>>>, <rustc_mir_build[362d32de073b060d]::thir::pattern::const_to_pat::ConstToPat>::field_pats<core[97bb3a13db18d0cb]::iter::adapters::copied::Copied<core[97bb3a13db18d0cb]::slice::iter::Iter<rustc_middle[151dce3d5e114089]::mir::ConstantKind>>>::{closure#0}>, core[97bb3a13db18d0cb]::result::Result<core[97bb3a13db18d0cb]::convert::Infallible, rustc_mir_build[362d32de073b060d]::thir::pattern::const_to_pat::fallback_to_const_ref::FallbackToConstRef>>>>::from_iter
  28:     0x7fc27313e817 - <rustc_mir_build[362d32de073b060d]::thir::pattern::const_to_pat::ConstToPat>::recur
  29:     0x7fc27313ce88 - <rustc_mir_build[362d32de073b060d]::thir::pattern::const_to_pat::ConstToPat>::to_pat
  30:     0x7fc27313c9be - <rustc_infer[f3ddb3e777d10305]::infer::InferCtxtBuilder>::enter::<rustc_middle[151dce3d5e114089]::thir::Pat, <rustc_mir_build[362d32de073b060d]::thir::pattern::PatCtxt>::const_to_pat::{closure#0}>
  31:     0x7fc27313c065 - <rustc_mir_build[362d32de073b060d]::thir::pattern::PatCtxt>::const_to_pat
  32:     0x7fc27313a909 - <rustc_mir_build[362d32de073b060d]::thir::pattern::PatCtxt>::lower_path
  33:     0x7fc273138218 - <rustc_mir_build[362d32de073b060d]::thir::pattern::PatCtxt>::lower_pattern
  34:     0x7fc2731f6c51 - <core[97bb3a13db18d0cb]::iter::adapters::map::Map<core[97bb3a13db18d0cb]::slice::iter::Iter<rustc_hir[15bf1790e6da2d76]::hir::Arm>, <rustc_mir_build[362d32de073b060d]::thir::pattern::check_match::MatchVisitor>::check_match::{closure#0}> as core[97bb3a13db18d0cb]::iter::traits::iterator::Iterator>::fold::<(), core[97bb3a13db18d0cb]::iter::traits::iterator::Iterator::for_each::call<rustc_mir_build[362d32de073b060d]::thir::pattern::usefulness::MatchArm, <alloc[d0a20223ecbdb9c4]::vec::Vec<rustc_mir_build[362d32de073b060d]::thir::pattern::usefulness::MatchArm> as alloc[d0a20223ecbdb9c4]::vec::spec_extend::SpecExtend<rustc_mir_build[362d32de073b060d]::thir::pattern::usefulness::MatchArm, core[97bb3a13db18d0cb]::iter::adapters::map::Map<core[97bb3a13db18d0cb]::slice::iter::Iter<rustc_hir[15bf1790e6da2d76]::hir::Arm>, <rustc_mir_build[362d32de073b060d]::thir::pattern::check_match::MatchVisitor>::check_match::{closure#0}>>>::spec_extend::{closure#0}>::{closure#0}>
  35:     0x7fc2731f6b4e - <alloc[d0a20223ecbdb9c4]::vec::Vec<rustc_mir_build[362d32de073b060d]::thir::pattern::usefulness::MatchArm> as alloc[d0a20223ecbdb9c4]::vec::spec_from_iter::SpecFromIter<rustc_mir_build[362d32de073b060d]::thir::pattern::usefulness::MatchArm, core[97bb3a13db18d0cb]::iter::adapters::map::Map<core[97bb3a13db18d0cb]::slice::iter::Iter<rustc_hir[15bf1790e6da2d76]::hir::Arm>, <rustc_mir_build[362d32de073b060d]::thir::pattern::check_match::MatchVisitor>::check_match::{closure#0}>>>::from_iter
  36:     0x7fc2731f3e27 - <rustc_mir_build[362d32de073b060d]::thir::pattern::check_match::MatchVisitor as rustc_hir[15bf1790e6da2d76]::intravisit::Visitor>::visit_expr
  37:     0x7fc2731f3a42 - <rustc_mir_build[362d32de073b060d]::thir::pattern::check_match::MatchVisitor as rustc_hir[15bf1790e6da2d76]::intravisit::Visitor>::visit_expr
  38:     0x7fc27388420a - rustc_mir_build[362d32de073b060d]::thir::pattern::check_match::check_match
  39:     0x7fc2739a1697 - <rustc_query_system[2040a19449a5eda6]::dep_graph::graph::DepGraph<rustc_middle[151dce3d5e114089]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[151dce3d5e114089]::ty::context::TyCtxt, rustc_span[8d4f92e92ba5c24b]::def_id::DefId, ()>
  40:     0x7fc2739a06ea - rustc_query_system[2040a19449a5eda6]::query::plumbing::try_execute_query::<rustc_query_impl[b271cbf8bf993093]::plumbing::QueryCtxt, rustc_query_system[2040a19449a5eda6]::query::caches::DefaultCache<rustc_span[8d4f92e92ba5c24b]::def_id::DefId, ()>>
  41:     0x7fc274465280 - <rustc_query_impl[b271cbf8bf993093]::Queries as rustc_middle[151dce3d5e114089]::ty::query::QueryEngine>::check_match
  42:     0x7fc273f38046 - rustc_data_structures[74351d4872850dbb]::sync::par_for_each_in::<&[rustc_span[8d4f92e92ba5c24b]::def_id::LocalDefId], <rustc_middle[151dce3d5e114089]::hir::map::Map>::par_body_owners<rustc_interface[67a969eeca26ae2c]::passes::analysis::{closure#1}::{closure#0}::{closure#0}::{closure#0}>::{closure#0}>
  43:     0x7fc273f378fb - <rustc_middle[151dce3d5e114089]::hir::map::Map>::par_body_owners::<rustc_interface[67a969eeca26ae2c]::passes::analysis::{closure#1}::{closure#0}::{closure#0}::{closure#0}>
  44:     0x7fc273f37693 - <rustc_session[a8a0b865530ef14d]::session::Session>::time::<(), rustc_interface[67a969eeca26ae2c]::passes::analysis::{closure#1}>
  45:     0x7fc273f367ee - rustc_interface[67a969eeca26ae2c]::passes::analysis
  46:     0x7fc2742fbfa2 - <rustc_query_system[2040a19449a5eda6]::dep_graph::graph::DepGraph<rustc_middle[151dce3d5e114089]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[151dce3d5e114089]::ty::context::TyCtxt, (), core[97bb3a13db18d0cb]::result::Result<(), rustc_errors[713e2db940a8ff0d]::ErrorGuaranteed>>
  47:     0x7fc2742fb727 - rustc_query_system[2040a19449a5eda6]::query::plumbing::try_execute_query::<rustc_query_impl[b271cbf8bf993093]::plumbing::QueryCtxt, rustc_query_system[2040a19449a5eda6]::query::caches::DefaultCache<(), core[97bb3a13db18d0cb]::result::Result<(), rustc_errors[713e2db940a8ff0d]::ErrorGuaranteed>>>
  48:     0x7fc2742fb21e - rustc_query_system[2040a19449a5eda6]::query::plumbing::get_query::<rustc_query_impl[b271cbf8bf993093]::queries::analysis, rustc_query_impl[b271cbf8bf993093]::plumbing::QueryCtxt>
  49:     0x7fc273d3ec0e - <rustc_interface[67a969eeca26ae2c]::passes::QueryContext>::enter::<rustc_driver[d9adb13473fd7853]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[97bb3a13db18d0cb]::result::Result<(), rustc_errors[713e2db940a8ff0d]::ErrorGuaranteed>>
  50:     0x7fc273d3a6ce - <rustc_interface[67a969eeca26ae2c]::interface::Compiler>::enter::<rustc_driver[d9adb13473fd7853]::run_compiler::{closure#1}::{closure#2}, core[97bb3a13db18d0cb]::result::Result<core[97bb3a13db18d0cb]::option::Option<rustc_interface[67a969eeca26ae2c]::queries::Linker>, rustc_errors[713e2db940a8ff0d]::ErrorGuaranteed>>
  51:     0x7fc273d361bc - rustc_span[8d4f92e92ba5c24b]::with_source_map::<core[97bb3a13db18d0cb]::result::Result<(), rustc_errors[713e2db940a8ff0d]::ErrorGuaranteed>, rustc_interface[67a969eeca26ae2c]::interface::create_compiler_and_run<core[97bb3a13db18d0cb]::result::Result<(), rustc_errors[713e2db940a8ff0d]::ErrorGuaranteed>, rustc_driver[d9adb13473fd7853]::run_compiler::{closure#1}>::{closure#1}>
  52:     0x7fc273d35ba2 - rustc_interface[67a969eeca26ae2c]::interface::create_compiler_and_run::<core[97bb3a13db18d0cb]::result::Result<(), rustc_errors[713e2db940a8ff0d]::ErrorGuaranteed>, rustc_driver[d9adb13473fd7853]::run_compiler::{closure#1}>
  53:     0x7fc273d34741 - <scoped_tls[e4311800d1c0ff57]::ScopedKey<rustc_span[8d4f92e92ba5c24b]::SessionGlobals>>::set::<rustc_interface[67a969eeca26ae2c]::interface::run_compiler<core[97bb3a13db18d0cb]::result::Result<(), rustc_errors[713e2db940a8ff0d]::ErrorGuaranteed>, rustc_driver[d9adb13473fd7853]::run_compiler::{closure#1}>::{closure#0}, core[97bb3a13db18d0cb]::result::Result<(), rustc_errors[713e2db940a8ff0d]::ErrorGuaranteed>>
  54:     0x7fc273d3442f - std[e5af5fec29962f4a]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[67a969eeca26ae2c]::util::run_in_thread_pool_with_globals<rustc_interface[67a969eeca26ae2c]::interface::run_compiler<core[97bb3a13db18d0cb]::result::Result<(), rustc_errors[713e2db940a8ff0d]::ErrorGuaranteed>, rustc_driver[d9adb13473fd7853]::run_compiler::{closure#1}>::{closure#0}, core[97bb3a13db18d0cb]::result::Result<(), rustc_errors[713e2db940a8ff0d]::ErrorGuaranteed>>::{closure#0}, core[97bb3a13db18d0cb]::result::Result<(), rustc_errors[713e2db940a8ff0d]::ErrorGuaranteed>>
  55:     0x7fc27438ae79 - <<std[e5af5fec29962f4a]::thread::Builder>::spawn_unchecked_<rustc_interface[67a969eeca26ae2c]::util::run_in_thread_pool_with_globals<rustc_interface[67a969eeca26ae2c]::interface::run_compiler<core[97bb3a13db18d0cb]::result::Result<(), rustc_errors[713e2db940a8ff0d]::ErrorGuaranteed>, rustc_driver[d9adb13473fd7853]::run_compiler::{closure#1}>::{closure#0}, core[97bb3a13db18d0cb]::result::Result<(), rustc_errors[713e2db940a8ff0d]::ErrorGuaranteed>>::{closure#0}, core[97bb3a13db18d0cb]::result::Result<(), rustc_errors[713e2db940a8ff0d]::ErrorGuaranteed>>::{closure#1} as core[97bb3a13db18d0cb]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  56:     0x7fc271d2e9c3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h374ee76b025338a5
                               at /rustc/0b79f758c9aa6646606662a6d623a0752286cd17/library/alloc/src/boxed.rs:1935:9
  57:     0x7fc271d2e9c3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h2bee731a5ba86295
                               at /rustc/0b79f758c9aa6646606662a6d623a0752286cd17/library/alloc/src/boxed.rs:1935:9
  58:     0x7fc271d2e9c3 - std::sys::unix::thread::Thread::new::thread_start::h44c172ae3f11ec1f
                               at /rustc/0b79f758c9aa6646606662a6d623a0752286cd17/library/std/src/sys/unix/thread.rs:108:17
  59:     0x7fc27198d78d - <unknown>
  60:     0x7fc271a0e8e4 - clone
  61:                0x0 - <unknown>

error: internal compiler error: unexpected panic

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 (0b79f758c 2022-08-18) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental -C target-cpu=native

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

query stack during panic:
#0 [try_destructure_mir_constant] destructuring mir constant
rust-lang/miri#1 [check_match] match-checki
@RalfJung
Copy link
Member

RalfJung commented Aug 19, 2022 via email

@matthiaskrgr
Copy link
Member Author

matthiaskrgr commented Aug 19, 2022

Yeah this just need "cargo miri run", no additional flags required.
Edit: oops, misread 😅

@matthiaskrgr
Copy link
Member Author

Right, this does also reproduce with rustc -Zextra-const-ub-checks. Do you want to move the issue?

@RalfJung RalfJung transferred this issue from rust-lang/miri Aug 19, 2022
@RalfJung
Copy link
Member

Yeah let's move this to the rustc repo.

@RalfJung RalfJung changed the title ICE: normalization works on validated constants ICE with -Zextra-const-ub-check: normalization works on validated constants Aug 19, 2022
@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. S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue labels Aug 19, 2022
@matthiaskrgr matthiaskrgr changed the title ICE with -Zextra-const-ub-check: normalization works on validated constants ICE with -Zextra-const-ub-checks: normalization works on validated constants Aug 21, 2022
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Aug 22, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Aug 23, 2022
@bors bors closed this as completed in f5fcac9 Aug 23, 2022
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. glacier ICE tracked in rust-lang/glacier. 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