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: transmute_generic_consts: Size::bits ... bytes in bits doesn't fit in u64 #112505

Closed
matthiaskrgr opened this issue Jun 10, 2023 · 1 comment · Fixed by #112520
Closed

ice: transmute_generic_consts: Size::bits ... bytes in bits doesn't fit in u64 #112505

matthiaskrgr opened this issue Jun 10, 2023 · 1 comment · Fixed by #112520
Assignees
Labels
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.

Comments

@matthiaskrgr
Copy link
Member

Code

#![feature(transmute_generic_consts)]

fn overflow(v: [[[u32; 8888888]; 9999999]; 777777777]) -> [[[u32; 9999999]; 777777777]; 239] {
    unsafe { std::mem::transmute(v) }
}

Meta

rustc --version --verbose:

rustc 1.72.0-nightly (43062c43d 2023-06-09)
binary: rustc
commit-hash: 43062c43d2a63cf4e261c6eddc417575c4f3062f
commit-date: 2023-06-09
host: x86_64-unknown-linux-gnu
release: 1.72.0-nightly
LLVM version: 16.0.5

Error output

<output>
Backtrace

thread 'rustc' panicked at 'Size::bits: 7435554804564445188 bytes in bits doesn't fit in u64', compiler/rustc_abi/src/lib.rs:459:13
stack backtrace:
   0:     0x7f5bc7568c41 - trace
                               at /rustc/43062c43d2a63cf4e261c6eddc417575c4f3062f/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f5bc7568c41 - trace_unsynchronized<std::sys_common::backtrace::_print_fmt::{closure_env#1}>
                               at /rustc/43062c43d2a63cf4e261c6eddc417575c4f3062f/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f5bc7568c41 - _print_fmt
                               at /rustc/43062c43d2a63cf4e261c6eddc417575c4f3062f/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f5bc7568c41 - fmt
                               at /rustc/43062c43d2a63cf4e261c6eddc417575c4f3062f/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f5bc75c95ff - fmt
                               at /rustc/43062c43d2a63cf4e261c6eddc417575c4f3062f/library/core/src/fmt/rt.rs:138:9
   5:     0x7f5bc75c95ff - write
                               at /rustc/43062c43d2a63cf4e261c6eddc417575c4f3062f/library/core/src/fmt/mod.rs:1094:21
   6:     0x7f5bc755bee1 - write_fmt<std::sys::unix::stdio::Stderr>
                               at /rustc/43062c43d2a63cf4e261c6eddc417575c4f3062f/library/std/src/io/mod.rs:1713:15
   7:     0x7f5bc7568a55 - _print
                               at /rustc/43062c43d2a63cf4e261c6eddc417575c4f3062f/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f5bc7568a55 - print
                               at /rustc/43062c43d2a63cf4e261c6eddc417575c4f3062f/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f5bc756b737 - {closure#1}
  10:     0x7f5bc756b524 - default_hook
                               at /rustc/43062c43d2a63cf4e261c6eddc417575c4f3062f/library/std/src/panicking.rs:288:9
  11:     0x7f5bca7e4ceb - rustc_driver_impl[d0821492cae6a3a8]::install_ice_hook::{closure#0}
  12:     0x7f5bc756be7d - call<(&core::panic::panic_info::PanicInfo), (dyn core::ops::function::Fn<(&core::panic::panic_info::PanicInfo), Output=()> + core::marker::Send + core::marker::Sync), alloc::alloc::Global>
                               at /rustc/43062c43d2a63cf4e261c6eddc417575c4f3062f/library/alloc/src/boxed.rs:1999:9
  13:     0x7f5bc756be7d - rust_panic_with_hook
                               at /rustc/43062c43d2a63cf4e261c6eddc417575c4f3062f/library/std/src/panicking.rs:709:13
  14:     0x7f5bc756bc17 - {closure#0}
                               at /rustc/43062c43d2a63cf4e261c6eddc417575c4f3062f/library/std/src/panicking.rs:597:13
  15:     0x7f5bc7569076 - __rust_end_short_backtrace<std::panicking::begin_panic_handler::{closure_env#0}, !>
                               at /rustc/43062c43d2a63cf4e261c6eddc417575c4f3062f/library/std/src/sys_common/backtrace.rs:151:18
  16:     0x7f5bc756b962 - begin_panic_handler
                               at /rustc/43062c43d2a63cf4e261c6eddc417575c4f3062f/library/std/src/panicking.rs:593:5
  17:     0x7f5bc75c5883 - panic_fmt
                               at /rustc/43062c43d2a63cf4e261c6eddc417575c4f3062f/library/core/src/panicking.rs:67:14
  18:     0x7f5bca39ac85 - <rustc_abi[8dc2c2c062e45bd0]::Size>::bits::overflow
  19:     0x7f5bca97d1e5 - <rustc_hir_typeck[540acb189a8d256b]::fn_ctxt::FnCtxt>::check_transmute::{closure#2}
  20:     0x7f5bc9db7ae6 - <rustc_hir_typeck[540acb189a8d256b]::fn_ctxt::FnCtxt>::check_transmute
  21:     0x7f5bc9292a54 - rustc_hir_typeck[540acb189a8d256b]::typeck
  22:     0x7f5bc8826d0e - rustc_query_impl[ead61cf3be1d21dc]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[ead61cf3be1d21dc]::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[5f3e0edc8316c59d]::query::erase::Erased<[u8; 8usize]>>
  23:     0x7f5bc8826cde - <rustc_query_impl[ead61cf3be1d21dc]::query_impl::typeck::dynamic_query::{closure#2} as core[d3915b1385eeee84]::ops::function::FnOnce<(rustc_middle[5f3e0edc8316c59d]::ty::context::TyCtxt, rustc_span[8dceba2d8f32b518]::def_id::LocalDefId)>>::call_once
  24:     0x7f5bc88ef70d - rustc_query_system[b1cad9b13541f961]::query::plumbing::try_execute_query::<rustc_query_impl[ead61cf3be1d21dc]::DynamicConfig<rustc_query_system[b1cad9b13541f961]::query::caches::VecCache<rustc_span[8dceba2d8f32b518]::def_id::LocalDefId, rustc_middle[5f3e0edc8316c59d]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[ead61cf3be1d21dc]::plumbing::QueryCtxt, false>
  25:     0x7f5bca164eb1 - rustc_query_impl[ead61cf3be1d21dc]::query_impl::typeck::get_query_non_incr::__rust_end_short_backtrace
  26:     0x7f5bc892924d - rustc_query_impl[ead61cf3be1d21dc]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[ead61cf3be1d21dc]::query_impl::used_trait_imports::dynamic_query::{closure#2}::{closure#0}, rustc_middle[5f3e0edc8316c59d]::query::erase::Erased<[u8; 8usize]>>
  27:     0x7f5bc89291ae - <rustc_query_impl[ead61cf3be1d21dc]::query_impl::used_trait_imports::dynamic_query::{closure#2} as core[d3915b1385eeee84]::ops::function::FnOnce<(rustc_middle[5f3e0edc8316c59d]::ty::context::TyCtxt, rustc_span[8dceba2d8f32b518]::def_id::LocalDefId)>>::call_once
  28:     0x7f5bc88ef70d - rustc_query_system[b1cad9b13541f961]::query::plumbing::try_execute_query::<rustc_query_impl[ead61cf3be1d21dc]::DynamicConfig<rustc_query_system[b1cad9b13541f961]::query::caches::VecCache<rustc_span[8dceba2d8f32b518]::def_id::LocalDefId, rustc_middle[5f3e0edc8316c59d]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[ead61cf3be1d21dc]::plumbing::QueryCtxt, false>
  29:     0x7f5bca164fb1 - rustc_query_impl[ead61cf3be1d21dc]::query_impl::used_trait_imports::get_query_non_incr::__rust_end_short_backtrace
  30:     0x7f5bc9c7e184 - rustc_hir_analysis[893db6da0ea67cd6]::check_crate
  31:     0x7f5bc9c78d2d - rustc_interface[5db37c687d653f71]::passes::analysis
  32:     0x7f5bc9d0130a - rustc_query_impl[ead61cf3be1d21dc]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[ead61cf3be1d21dc]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[5f3e0edc8316c59d]::query::erase::Erased<[u8; 1usize]>>
  33:     0x7f5bc9d012f9 - <rustc_query_impl[ead61cf3be1d21dc]::query_impl::analysis::dynamic_query::{closure#2} as core[d3915b1385eeee84]::ops::function::FnOnce<(rustc_middle[5f3e0edc8316c59d]::ty::context::TyCtxt, ())>>::call_once
  34:     0x7f5bc9e7f728 - rustc_query_system[b1cad9b13541f961]::query::plumbing::try_execute_query::<rustc_query_impl[ead61cf3be1d21dc]::DynamicConfig<rustc_query_system[b1cad9b13541f961]::query::caches::SingleCache<rustc_middle[5f3e0edc8316c59d]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[ead61cf3be1d21dc]::plumbing::QueryCtxt, false>
  35:     0x7f5bc9e7f4f9 - rustc_query_impl[ead61cf3be1d21dc]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  36:     0x7f5bc9e583b5 - <rustc_middle[5f3e0edc8316c59d]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[d0821492cae6a3a8]::run_compiler::{closure#1}::{closure#2}::{closure#4}, core[d3915b1385eeee84]::result::Result<(), rustc_span[8dceba2d8f32b518]::ErrorGuaranteed>>
  37:     0x7f5bc9aa83bf - <rustc_interface[5db37c687d653f71]::interface::Compiler>::enter::<rustc_driver_impl[d0821492cae6a3a8]::run_compiler::{closure#1}::{closure#2}, core[d3915b1385eeee84]::result::Result<core[d3915b1385eeee84]::option::Option<rustc_interface[5db37c687d653f71]::queries::Linker>, rustc_span[8dceba2d8f32b518]::ErrorGuaranteed>>
  38:     0x7f5bc9aa5f59 - <scoped_tls[db132b8948264e24]::ScopedKey<rustc_span[8dceba2d8f32b518]::SessionGlobals>>::set::<rustc_interface[5db37c687d653f71]::interface::run_compiler<core[d3915b1385eeee84]::result::Result<(), rustc_span[8dceba2d8f32b518]::ErrorGuaranteed>, rustc_driver_impl[d0821492cae6a3a8]::run_compiler::{closure#1}>::{closure#0}, core[d3915b1385eeee84]::result::Result<(), rustc_span[8dceba2d8f32b518]::ErrorGuaranteed>>
  39:     0x7f5bc9aa53c6 - std[30357d997d387a25]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[5db37c687d653f71]::util::run_in_thread_pool_with_globals<rustc_interface[5db37c687d653f71]::interface::run_compiler<core[d3915b1385eeee84]::result::Result<(), rustc_span[8dceba2d8f32b518]::ErrorGuaranteed>, rustc_driver_impl[d0821492cae6a3a8]::run_compiler::{closure#1}>::{closure#0}, core[d3915b1385eeee84]::result::Result<(), rustc_span[8dceba2d8f32b518]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[d3915b1385eeee84]::result::Result<(), rustc_span[8dceba2d8f32b518]::ErrorGuaranteed>>
  40:     0x7f5bc9aa5175 - <<std[30357d997d387a25]::thread::Builder>::spawn_unchecked_<rustc_interface[5db37c687d653f71]::util::run_in_thread_pool_with_globals<rustc_interface[5db37c687d653f71]::interface::run_compiler<core[d3915b1385eeee84]::result::Result<(), rustc_span[8dceba2d8f32b518]::ErrorGuaranteed>, rustc_driver_impl[d0821492cae6a3a8]::run_compiler::{closure#1}>::{closure#0}, core[d3915b1385eeee84]::result::Result<(), rustc_span[8dceba2d8f32b518]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[d3915b1385eeee84]::result::Result<(), rustc_span[8dceba2d8f32b518]::ErrorGuaranteed>>::{closure#1} as core[d3915b1385eeee84]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  41:     0x7f5bc75763a5 - call_once<(), dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global>
                               at /rustc/43062c43d2a63cf4e261c6eddc417575c4f3062f/library/alloc/src/boxed.rs:1985:9
  42:     0x7f5bc75763a5 - call_once<(), alloc::boxed::Box<dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global>, alloc::alloc::Global>
                               at /rustc/43062c43d2a63cf4e261c6eddc417575c4f3062f/library/alloc/src/boxed.rs:1985:9
  43:     0x7f5bc75763a5 - thread_start
                               at /rustc/43062c43d2a63cf4e261c6eddc417575c4f3062f/library/std/src/sys/unix/thread.rs:108:17
  44:     0x7f5bc730f44b - <unknown>
  45:     0x7f5bc7392e40 - <unknown>
  46:                0x0 - <unknown>

error: 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.72.0-nightly (43062c43d 2023-06-09) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [typeck] type-checking `overflow`
#1 [used_trait_imports] finding used_trait_imports `overflow`
#2 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error

For more information about this error, try `rustc --explain E0601`.

@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. labels Jun 10, 2023
@matthiaskrgr
Copy link
Member Author

Caused by #106281

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