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

rust-1.75.0 fails to compile with ICE on aarch64 and various ppc arches with LTO enabled - error: could not compile memchr #121124

Open
bowlofeggs opened this issue Feb 15, 2024 · 12 comments
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-LTO Area: Link-time optimization (LTO) C-bug Category: This is a bug. E-needs-investigation Call for partcipation: This issues needs some investigation to determine current status 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) ❄️ I-unsound Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness O-AArch64 Armv8-A or later processors in AArch64 mode O-PowerPC Target: PowerPC processors P-high High priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@bowlofeggs
Copy link

bowlofeggs commented Feb 15, 2024

Greetings! A Gentoo user reported a build failure with Rust 1.75.0 on aarch64 when building with lto = "fat" in config.toml. Other users have found that LTO also causes build failures on ppc, ppc64, and ppc64le.

Meta

This is Rust 1.75.0, built on the end users' machines.

Error output

Caused by:
  process didn't exit successfully: `CARGO=/var/tmp/notmpfs/portage/dev-lang/rust-1.75.0-r1/work/rust-stage0/bin/cargo CARGO_CRATE_NAME=pkg_config CARGO_MANIFEST_DIR=/var/tmp/notmpfs/portage/dev-lang/rust-1.75.0-r1/work/rustc-1.75.0-src/vendor/pkg-config CARGO_PKG_AUTHORS='Alex Crichton <[alex@alexcrichton.com](mailto:alex@alexcrichton.com)>' CARGO_PKG_DESCRIPTION='A library to run the pkg-config system tool at build time in order to be used in
  Cargo build scripts.
  ' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE='MIT OR Apache-2.0' CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=pkg-config CARGO_PKG_README=README.md CARGO_PKG_REPOSITORY='https://github.com/rust-lang/pkg-config-rs' CARGO_PKG_RUST_VERSION=1.30 CARGO_PKG_VERSION=0.3.27 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=3 CARGO_PKG_VERSION_PATCH=27 CARGO_PKG_VERSION_PRE='' LD_LIBRARY_PATH='/var/tmp/notmpfs/portage/dev-lang/rust-1.75.0-r1/work/rustc-1.75.0-src/build/aarch64-unknown-linux-gnu/stage2-tools/release/deps:/var/tmp/notmpfs/portage/dev-lang/rust-1.75.0-r1/work/rustc-1.75.0-src/build/aarch64-unknown-linux-gnu/stage2/lib' /var/tmp/notmpfs/portage/dev-lang/rust-1.75.0-r1/work/rustc-1.75.0-src/build/bootstrap/debug/rustc --crate-name pkg_config /var/tmp/notmpfs/portage/dev-lang/rust-1.75.0-r1/work/rustc-1.75.0-src/vendor/pkg-config/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debug-assertions=off -Zunstable-options --check-cfg 'values(feature)' --check-cfg 'names()' --check-cfg 'values()' -C metadata=13f5ba3fd8dd7c11 -C extra-filename=-13f5ba3fd8dd7c11 --out-dir /var/tmp/notmpfs/portage/dev-lang/rust-1.75.0-r1/work/rustc-1.75.0-src/build/aarch64-unknown-linux-gnu/stage2-tools/release/deps -C linker=aarch64-unknown-linux-gnu-gcc -L dependency=/var/tmp/notmpfs/portage/dev-lang/rust-1.75.0-r1/work/rustc-1.75.0-src/build/aarch64-unknown-linux-gnu/stage2-tools/release/deps --cap-lints warn -Z binary-dep-depinfo` (exit status: 101)
thread 'rustc' panicked at compiler/rustc_const_eval/src/interpret/place.rs:633:57:
index out of bounds: the len is 1 but the index is 4294967040
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic_bounds_check
   3: <rustc_const_eval::interpret::eval_context::InterpCx<rustc_const_eval::const_eval::machine::CompileTimeInterpreter>>::write_immediate_no_validate::<rustc_const_eval::interpret::place::PlaceTy>
   4: <rustc_const_eval::interpret::eval_context::InterpCx<rustc_const_eval::const_eval::machine::CompileTimeInterpreter>>::eval_rvalue_into_place
   5: rustc_const_eval::const_eval::eval_queries::eval_in_interpreter
   6: rustc_const_eval::const_eval::eval_queries::eval_to_allocation_raw_provider
      [... omitted 2 frames ...]
   7: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::ParamEnvAnd<rustc_middle::mir::interpret::GlobalId>, rustc_middle::query::erase::Erased<[u8; 24]>>>
   8: rustc_const_eval::const_eval::eval_queries::eval_to_const_value_raw_provider
      [... omitted 2 frames ...]
   9: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::ParamEnvAnd<rustc_middle::mir::interpret::GlobalId>, rustc_middle::query::erase::Erased<[u8; 24]>>>
  10: <rustc_middle::ty::context::TyCtxt>::const_eval_global_id
  11: <rustc_middle::ty::context::TyCtxt>::const_eval_resolve
  12: <rustc_const_eval::interpret::eval_context::InterpCx<rustc_const_eval::const_eval::machine::CompileTimeInterpreter>>::push_stack_frame
  13: rustc_const_eval::const_eval::eval_queries::eval_in_interpreter
  14: rustc_const_eval::const_eval::eval_queries::eval_to_allocation_raw_provider
      [... omitted 2 frames ...]
  15: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::ParamEnvAnd<rustc_middle::mir::interpret::GlobalId>, rustc_middle::query::erase::Erased<[u8; 24]>>>
  16: rustc_const_eval::const_eval::eval_queries::eval_to_const_value_raw_provider
      [... omitted 2 frames ...]
  17: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::ParamEnvAnd<rustc_middle::mir::interpret::GlobalId>, rustc_middle::query::erase::Erased<[u8; 24]>>>
  18: <rustc_middle::ty::context::TyCtxt>::const_eval_global_id
  19: <rustc_middle::ty::context::TyCtxt>::const_eval_resolve
  20: <rustc_const_eval::interpret::eval_context::InterpCx<rustc_const_eval::const_eval::machine::CompileTimeInterpreter>>::push_stack_frame
  21: rustc_const_eval::const_eval::eval_queries::eval_in_interpreter
  22: rustc_const_eval::const_eval::eval_queries::eval_to_allocation_raw_provider
      [... omitted 2 frames ...]
  23: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::ParamEnvAnd<rustc_middle::mir::interpret::GlobalId>, rustc_middle::query::erase::Erased<[u8; 24]>>>
  24: rustc_const_eval::const_eval::eval_queries::eval_to_const_value_raw_provider
      [... omitted 2 frames ...]
  25: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::ParamEnvAnd<rustc_middle::mir::interpret::GlobalId>, rustc_middle::query::erase::Erased<[u8; 24]>>>
  26: <rustc_middle::ty::context::TyCtxt>::const_eval_global_id
  27: <rustc_middle::ty::context::TyCtxt>::const_eval_resolve
  28: <rustc_middle::mir::consts::Const>::try_eval_scalar_int
  29: <rustc_middle::mir::consts::Const>::try_eval_bits
  30: <rustc_const_eval::transform::promote_consts::Validator>::validate_local
  31: <core::iter::adapters::copied::Copied<core::slice::iter::Iter<rustc_const_eval::transform::promote_consts::Candidate>> as core::iter::traits::iterator::Iterator>::try_fold::<(), core::iter::traits::iterator::Iterator::find::check<rustc_const_eval::transform::promote_consts::Candidate, &mut rustc_const_eval::transform::promote_consts::validate_candidates::{closure#0}>::{closure#0}, core::ops::control_flow::ControlFlow<rustc_const_eval::transform::promote_consts::Candidate>>
  32: <alloc::vec::Vec<rustc_const_eval::transform::promote_consts::Candidate> as alloc::vec::spec_from_iter::SpecFromIter<rustc_const_eval::transform::promote_consts::Candidate, core::iter::adapters::filter::Filter<core::iter::adapters::copied::Copied<core::slice::iter::Iter<rustc_const_eval::transform::promote_consts::Candidate>>, rustc_const_eval::transform::promote_consts::validate_candidates::{closure#0}>>>::from_iter
  33: <rustc_const_eval::transform::promote_consts::PromoteTemps as rustc_middle::mir::MirPass>::run_pass
  34: rustc_mir_transform::pass_manager::run_passes_inner
  35: rustc_mir_transform::mir_promoted
      [... omitted 1 frame ...]
  36: rustc_borrowck::mir_borrowck
      [... omitted 1 frame ...]
  37: rustc_interface::passes::analysis
      [... omitted 1 frame ...]
  38: <rustc_interface::queries::QueryResult<&rustc_middle::ty::context::GlobalCtxt>>::enter::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#6}>
  39: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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: please attach the file at `/var/tmp/notmpfs/portage/dev-lang/rust-1.75.0-r1/work/rustc-1.75.0-src/vendor/memchr/rustc-ice-2024-02-11T16_22_27-21317.txt` to your bug report

note: compiler flags: --crate-type lib -C opt-level=3 -C embed-bitcode=no -Z unstable-options -C linker=aarch64-unknown-linux-gnu-gcc -C symbol-mangling-version=v0 -Z unstable-options -Z macro-backtrace -C split-debuginfo=off -Z binary-dep-depinfo -Z tls-model=initial-exec

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

query stack during panic:
#0 [eval_to_allocation_raw] const-evaluating + checking `core::num::<impl usize>::MAX`
#1 [eval_to_const_value_raw] simplifying constant for the type system `core::num::<impl usize>::MAX`  |  = note: this failure-note originates in the macro `uint_impl` (in Nightly builds, run with -Z macro-backtrace for more info)

#2 [eval_to_allocation_raw] const-evaluating + checking `core::num::<impl usize>::BITS`
#3 [eval_to_const_value_raw] simplifying constant for the type system `core::num::<impl usize>::BITS`
#4 [eval_to_allocation_raw] const-evaluating + checking `arch::all::memchr::USIZE_BYTES`
#5 [eval_to_const_value_raw] simplifying constant for the type system `arch::all::memchr::USIZE_BYTES`
#6 [mir_promoted] promoting constants in MIR for `arch::all::memchr::<impl at /rust/deps/memchr/src/arch/all/memchr.rs:40:1: 40:9>::find_raw`
#7 [mir_borrowck] borrow-checking `arch::all::memchr::<impl at /rust/deps/memchr/src/arch/all/memchr.rs:40:1: 40:9>::find_raw`
#8 [analysis] running analysis passes on this crate
end of query stack

Did not run successfully: exit status: 101
Backtrace

This is the ice file that the output requested:

thread 'rustc' panicked at compiler/rustc_const_eval/src/interpret/place.rs:633:57:
index out of bounds: the len is 1 but the index is 4294967040
stack backtrace:
   0:     0x400006ff8bc0 - std::backtrace::Backtrace::create::hb2aee29319b06e8e
   1:     0x400001a11a50 - <alloc[90ae2a520ce139ee]::boxed::Box<rustc_driver_impl[c9c7a953b4411394]::install_ice_hook::{closure#0}> as core[5a6fd8bb0fda964d]::ops::function::Fn<(&dyn for<'a, 'b> core[5a6fd8bb0fda964d]::ops::function::Fn<(&'a core[5a6fd8bb0fda964d]::panic::panic_info::PanicInfo<'b>,), Output = ()> + core[5a6fd8bb0fda964d]::marker::Send + core[5a6fd8bb0fda964d]::marker::Sync, &core[5a6fd8bb0fda964d]::panic::panic_info::PanicInfo)>>::call
   2:     0x400007011a54 - std::panicking::rust_panic_with_hook::h9c163f1d9c1cbb36
   3:     0x4000070117cc - std::panicking::begin_panic_handler::{{closure}}::h6b0448d5499b219f
   4:     0x40000700ef80 - std::sys_common::backtrace::__rust_end_short_backtrace::hbd2c6bb647b1e398
   5:     0x400007011558 - rust_begin_unwind
   6:     0x400006fdce38 - core::panicking::panic_fmt::h4078202a72ed11d6
   7:     0x400006fdcfc4 - core::panicking::panic_bounds_check::hbc8259532743cd37
   8:     0x4000018c93fc - <rustc_const_eval[f31644989ab683b2]::interpret::eval_context::InterpCx<rustc_const_eval[f31644989ab683b2]::const_eval::machine::CompileTimeInterpreter>>::write_immediate_no_validate::<rustc_const_eval[f31644989ab683b2]::interpret::place::PlaceTy>
   9:     0x4000018ec07c - <rustc_const_eval[f31644989ab683b2]::interpret::eval_context::InterpCx<rustc_const_eval[f31644989ab683b2]::const_eval::machine::CompileTimeInterpreter>>::eval_rvalue_into_place
  10:     0x400001993bb4 - rustc_const_eval[f31644989ab683b2]::const_eval::eval_queries::eval_in_interpreter
  11:     0x40000199ea44 - rustc_const_eval[f31644989ab683b2]::const_eval::eval_queries::eval_to_allocation_raw_provider
  12:     0x40000293f784 - rustc_query_impl[7d02d90d958f3807]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7d02d90d958f3807]::query_impl::eval_to_allocation_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 24usize]>>
  13:     0x4000029b2ae0 - <rustc_query_impl[7d02d90d958f3807]::query_impl::eval_to_allocation_raw::dynamic_query::{closure#2} as core[5a6fd8bb0fda964d]::ops::function::FnOnce<(rustc_middle[808545804f58c292]::ty::context::TyCtxt, rustc_middle[808545804f58c292]::ty::ParamEnvAnd<rustc_middle[808545804f58c292]::mir::interpret::GlobalId>)>>::call_once
  14:     0x400002911c38 - rustc_query_system[51331249ee775339]::query::plumbing::try_execute_query::<rustc_query_impl[7d02d90d958f3807]::DynamicConfig<rustc_query_system[51331249ee775339]::query::caches::DefaultCache<rustc_middle[808545804f58c292]::ty::ParamEnvAnd<rustc_middle[808545804f58c292]::mir::interpret::GlobalId>, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[7d02d90d958f3807]::plumbing::QueryCtxt, false>
  15:     0x4000029b2754 - rustc_query_impl[7d02d90d958f3807]::query_impl::eval_to_allocation_raw::get_query_non_incr::__rust_end_short_backtrace
  16:     0x40000199e71c - rustc_middle[808545804f58c292]::query::plumbing::query_get_at::<rustc_query_system[51331249ee775339]::query::caches::DefaultCache<rustc_middle[808545804f58c292]::ty::ParamEnvAnd<rustc_middle[808545804f58c292]::mir::interpret::GlobalId>, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 24usize]>>>
  17:     0x40000199d730 - rustc_const_eval[f31644989ab683b2]::const_eval::eval_queries::eval_to_const_value_raw_provider
  18:     0x40000293fca8 - rustc_query_impl[7d02d90d958f3807]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7d02d90d958f3807]::query_impl::eval_to_const_value_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 24usize]>>
  19:     0x4000029b3a8c - <rustc_query_impl[7d02d90d958f3807]::query_impl::eval_to_const_value_raw::dynamic_query::{closure#2} as core[5a6fd8bb0fda964d]::ops::function::FnOnce<(rustc_middle[808545804f58c292]::ty::context::TyCtxt, rustc_middle[808545804f58c292]::ty::ParamEnvAnd<rustc_middle[808545804f58c292]::mir::interpret::GlobalId>)>>::call_once
  20:     0x400002911c38 - rustc_query_system[51331249ee775339]::query::plumbing::try_execute_query::<rustc_query_impl[7d02d90d958f3807]::DynamicConfig<rustc_query_system[51331249ee775339]::query::caches::DefaultCache<rustc_middle[808545804f58c292]::ty::ParamEnvAnd<rustc_middle[808545804f58c292]::mir::interpret::GlobalId>, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[7d02d90d958f3807]::plumbing::QueryCtxt, false>
  21:     0x4000029b383c - rustc_query_impl[7d02d90d958f3807]::query_impl::eval_to_const_value_raw::get_query_non_incr::__rust_end_short_backtrace
  22:     0x400002288c70 - rustc_middle[808545804f58c292]::query::plumbing::query_get_at::<rustc_query_system[51331249ee775339]::query::caches::DefaultCache<rustc_middle[808545804f58c292]::ty::ParamEnvAnd<rustc_middle[808545804f58c292]::mir::interpret::GlobalId>, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 24usize]>>>
  23:     0x400002288a60 - <rustc_middle[808545804f58c292]::ty::context::TyCtxt>::const_eval_global_id
  24:     0x4000022aab40 - <rustc_middle[808545804f58c292]::ty::context::TyCtxt>::const_eval_resolve
  25:     0x4000018d0cd4 - <rustc_const_eval[f31644989ab683b2]::interpret::eval_context::InterpCx<rustc_const_eval[f31644989ab683b2]::const_eval::machine::CompileTimeInterpreter>>::push_stack_frame
  26:     0x400001993950 - rustc_const_eval[f31644989ab683b2]::const_eval::eval_queries::eval_in_interpreter
  27:     0x40000199ea44 - rustc_const_eval[f31644989ab683b2]::const_eval::eval_queries::eval_to_allocation_raw_provider
  28:     0x40000293f784 - rustc_query_impl[7d02d90d958f3807]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7d02d90d958f3807]::query_impl::eval_to_allocation_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 24usize]>>
  29:     0x4000029b2ae0 - <rustc_query_impl[7d02d90d958f3807]::query_impl::eval_to_allocation_raw::dynamic_query::{closure#2} as core[5a6fd8bb0fda964d]::ops::function::FnOnce<(rustc_middle[808545804f58c292]::ty::context::TyCtxt, rustc_middle[808545804f58c292]::ty::ParamEnvAnd<rustc_middle[808545804f58c292]::mir::interpret::GlobalId>)>>::call_once
  30:     0x400002911c38 - rustc_query_system[51331249ee775339]::query::plumbing::try_execute_query::<rustc_query_impl[7d02d90d958f3807]::DynamicConfig<rustc_query_system[51331249ee775339]::query::caches::DefaultCache<rustc_middle[808545804f58c292]::ty::ParamEnvAnd<rustc_middle[808545804f58c292]::mir::interpret::GlobalId>, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[7d02d90d958f3807]::plumbing::QueryCtxt, false>
  31:     0x4000029b2754 - rustc_query_impl[7d02d90d958f3807]::query_impl::eval_to_allocation_raw::get_query_non_incr::__rust_end_short_backtrace
  32:     0x40000199e71c - rustc_middle[808545804f58c292]::query::plumbing::query_get_at::<rustc_query_system[51331249ee775339]::query::caches::DefaultCache<rustc_middle[808545804f58c292]::ty::ParamEnvAnd<rustc_middle[808545804f58c292]::mir::interpret::GlobalId>, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 24usize]>>>
  33:     0x40000199d730 - rustc_const_eval[f31644989ab683b2]::const_eval::eval_queries::eval_to_const_value_raw_provider
  34:     0x40000293fca8 - rustc_query_impl[7d02d90d958f3807]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7d02d90d958f3807]::query_impl::eval_to_const_value_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 24usize]>>
  35:     0x4000029b3a8c - <rustc_query_impl[7d02d90d958f3807]::query_impl::eval_to_const_value_raw::dynamic_query::{closure#2} as core[5a6fd8bb0fda964d]::ops::function::FnOnce<(rustc_middle[808545804f58c292]::ty::context::TyCtxt, rustc_middle[808545804f58c292]::ty::ParamEnvAnd<rustc_middle[808545804f58c292]::mir::interpret::GlobalId>)>>::call_once
  36:     0x400002911c38 - rustc_query_system[51331249ee775339]::query::plumbing::try_execute_query::<rustc_query_impl[7d02d90d958f3807]::DynamicConfig<rustc_query_system[51331249ee775339]::query::caches::DefaultCache<rustc_middle[808545804f58c292]::ty::ParamEnvAnd<rustc_middle[808545804f58c292]::mir::interpret::GlobalId>, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[7d02d90d958f3807]::plumbing::QueryCtxt, false>
  37:     0x4000029b383c - rustc_query_impl[7d02d90d958f3807]::query_impl::eval_to_const_value_raw::get_query_non_incr::__rust_end_short_backtrace
  38:     0x400002288c70 - rustc_middle[808545804f58c292]::query::plumbing::query_get_at::<rustc_query_system[51331249ee775339]::query::caches::DefaultCache<rustc_middle[808545804f58c292]::ty::ParamEnvAnd<rustc_middle[808545804f58c292]::mir::interpret::GlobalId>, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 24usize]>>>
  39:     0x400002288a60 - <rustc_middle[808545804f58c292]::ty::context::TyCtxt>::const_eval_global_id
  40:     0x4000022aab40 - <rustc_middle[808545804f58c292]::ty::context::TyCtxt>::const_eval_resolve
  41:     0x4000018d0cd4 - <rustc_const_eval[f31644989ab683b2]::interpret::eval_context::InterpCx<rustc_const_eval[f31644989ab683b2]::const_eval::machine::CompileTimeInterpreter>>::push_stack_frame
  42:     0x400001993950 - rustc_const_eval[f31644989ab683b2]::const_eval::eval_queries::eval_in_interpreter
  43:     0x40000199ea44 - rustc_const_eval[f31644989ab683b2]::const_eval::eval_queries::eval_to_allocation_raw_provider
  44:     0x40000293f784 - rustc_query_impl[7d02d90d958f3807]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7d02d90d958f3807]::query_impl::eval_to_allocation_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 24usize]>>
  45:     0x4000029b2ae0 - <rustc_query_impl[7d02d90d958f3807]::query_impl::eval_to_allocation_raw::dynamic_query::{closure#2} as core[5a6fd8bb0fda964d]::ops::function::FnOnce<(rustc_middle[808545804f58c292]::ty::context::TyCtxt, rustc_middle[808545804f58c292]::ty::ParamEnvAnd<rustc_middle[808545804f58c292]::mir::interpret::GlobalId>)>>::call_once
  46:     0x400002911c38 - rustc_query_system[51331249ee775339]::query::plumbing::try_execute_query::<rustc_query_impl[7d02d90d958f3807]::DynamicConfig<rustc_query_system[51331249ee775339]::query::caches::DefaultCache<rustc_middle[808545804f58c292]::ty::ParamEnvAnd<rustc_middle[808545804f58c292]::mir::interpret::GlobalId>, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[7d02d90d958f3807]::plumbing::QueryCtxt, false>
  47:     0x4000029b2754 - rustc_query_impl[7d02d90d958f3807]::query_impl::eval_to_allocation_raw::get_query_non_incr::__rust_end_short_backtrace
  48:     0x40000199e71c - rustc_middle[808545804f58c292]::query::plumbing::query_get_at::<rustc_query_system[51331249ee775339]::query::caches::DefaultCache<rustc_middle[808545804f58c292]::ty::ParamEnvAnd<rustc_middle[808545804f58c292]::mir::interpret::GlobalId>, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 24usize]>>>
  49:     0x40000199d730 - rustc_const_eval[f31644989ab683b2]::const_eval::eval_queries::eval_to_const_value_raw_provider
  50:     0x40000293fca8 - rustc_query_impl[7d02d90d958f3807]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7d02d90d958f3807]::query_impl::eval_to_const_value_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 24usize]>>
  51:     0x4000029b3a8c - <rustc_query_impl[7d02d90d958f3807]::query_impl::eval_to_const_value_raw::dynamic_query::{closure#2} as core[5a6fd8bb0fda964d]::ops::function::FnOnce<(rustc_middle[808545804f58c292]::ty::context::TyCtxt, rustc_middle[808545804f58c292]::ty::ParamEnvAnd<rustc_middle[808545804f58c292]::mir::interpret::GlobalId>)>>::call_once
  52:     0x400002911c38 - rustc_query_system[51331249ee775339]::query::plumbing::try_execute_query::<rustc_query_impl[7d02d90d958f3807]::DynamicConfig<rustc_query_system[51331249ee775339]::query::caches::DefaultCache<rustc_middle[808545804f58c292]::ty::ParamEnvAnd<rustc_middle[808545804f58c292]::mir::interpret::GlobalId>, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[7d02d90d958f3807]::plumbing::QueryCtxt, false>
  53:     0x4000029b383c - rustc_query_impl[7d02d90d958f3807]::query_impl::eval_to_const_value_raw::get_query_non_incr::__rust_end_short_backtrace
  54:     0x400002288c70 - rustc_middle[808545804f58c292]::query::plumbing::query_get_at::<rustc_query_system[51331249ee775339]::query::caches::DefaultCache<rustc_middle[808545804f58c292]::ty::ParamEnvAnd<rustc_middle[808545804f58c292]::mir::interpret::GlobalId>, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 24usize]>>>
  55:     0x400002288b30 - <rustc_middle[808545804f58c292]::ty::context::TyCtxt>::const_eval_global_id
  56:     0x4000022aab40 - <rustc_middle[808545804f58c292]::ty::context::TyCtxt>::const_eval_resolve
  57:     0x400001986b6c - <rustc_middle[808545804f58c292]::mir::consts::Const>::try_eval_scalar_int
  58:     0x400001986778 - <rustc_middle[808545804f58c292]::mir::consts::Const>::try_eval_bits
  59:     0x400001985780 - <rustc_const_eval[f31644989ab683b2]::transform::promote_consts::Validator>::validate_local
  60:     0x400001908388 - <core[5a6fd8bb0fda964d]::iter::adapters::copied::Copied<core[5a6fd8bb0fda964d]::slice::iter::Iter<rustc_const_eval[f31644989ab683b2]::transform::promote_consts::Candidate>> as core[5a6fd8bb0fda964d]::iter::traits::iterator::Iterator>::try_fold::<(), core[5a6fd8bb0fda964d]::iter::traits::iterator::Iterator::find::check<rustc_const_eval[f31644989ab683b2]::transform::promote_consts::Candidate, &mut rustc_const_eval[f31644989ab683b2]::transform::promote_consts::validate_candidates::{closure#0}>::{closure#0}, core[5a6fd8bb0fda964d]::ops::control_flow::ControlFlow<rustc_const_eval[f31644989ab683b2]::transform::promote_consts::Candidate>>
  61:     0x4000019034ac - <alloc[90ae2a520ce139ee]::vec::Vec<rustc_const_eval[f31644989ab683b2]::transform::promote_consts::Candidate> as alloc[90ae2a520ce139ee]::vec::spec_from_iter::SpecFromIter<rustc_const_eval[f31644989ab683b2]::transform::promote_consts::Candidate, core[5a6fd8bb0fda964d]::iter::adapters::filter::Filter<core[5a6fd8bb0fda964d]::iter::adapters::copied::Copied<core[5a6fd8bb0fda964d]::slice::iter::Iter<rustc_const_eval[f31644989ab683b2]::transform::promote_consts::Candidate>>, rustc_const_eval[f31644989ab683b2]::transform::promote_consts::validate_candidates::{closure#0}>>>::from_iter
  62:     0x40000198b328 - <rustc_const_eval[f31644989ab683b2]::transform::promote_consts::PromoteTemps as rustc_middle[808545804f58c292]::mir::MirPass>::run_pass
  63:     0x400002621438 - rustc_mir_transform[5e8ad041f5dad077]::pass_manager::run_passes_inner
  64:     0x40000262ec74 - rustc_mir_transform[5e8ad041f5dad077]::mir_promoted
  65:     0x40000293d014 - rustc_query_impl[7d02d90d958f3807]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7d02d90d958f3807]::query_impl::mir_promoted::dynamic_query::{closure#2}::{closure#0}, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 16usize]>>
  66:     0x40000291dfd8 - rustc_query_system[51331249ee775339]::query::plumbing::try_execute_query::<rustc_query_impl[7d02d90d958f3807]::DynamicConfig<rustc_query_system[51331249ee775339]::query::caches::VecCache<rustc_span[41bcdfd57efa771a]::def_id::LocalDefId, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[7d02d90d958f3807]::plumbing::QueryCtxt, false>
  67:     0x40000299e398 - rustc_query_impl[7d02d90d958f3807]::query_impl::mir_promoted::get_query_non_incr::__rust_end_short_backtrace
  68:     0x40000149c1c4 - rustc_borrowck[710e2f5ce73b6fd1]::mir_borrowck
  69:     0x40000293cfc4 - rustc_query_impl[7d02d90d958f3807]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7d02d90d958f3807]::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 8usize]>>
  70:     0x40000291f578 - rustc_query_system[51331249ee775339]::query::plumbing::try_execute_query::<rustc_query_impl[7d02d90d958f3807]::DynamicConfig<rustc_query_system[51331249ee775339]::query::caches::VecCache<rustc_span[41bcdfd57efa771a]::def_id::LocalDefId, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[7d02d90d958f3807]::plumbing::QueryCtxt, false>
  71:     0x4000029af354 - rustc_query_impl[7d02d90d958f3807]::query_impl::mir_borrowck::get_query_non_incr::__rust_end_short_backtrace
  72:     0x400002005cdc - rustc_interface[db4590941cd866b]::passes::analysis
  73:     0x400002940df8 - rustc_query_impl[7d02d90d958f3807]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7d02d90d958f3807]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 1usize]>>
  74:     0x40000290d120 - rustc_query_system[51331249ee775339]::query::plumbing::try_execute_query::<rustc_query_impl[7d02d90d958f3807]::DynamicConfig<rustc_query_system[51331249ee775339]::query::caches::SingleCache<rustc_middle[808545804f58c292]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[7d02d90d958f3807]::plumbing::QueryCtxt, false>
  75:     0x400002997c94 - rustc_query_impl[7d02d90d958f3807]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  76:     0x4000019e6bd4 - <rustc_interface[db4590941cd866b]::queries::QueryResult<&rustc_middle[808545804f58c292]::ty::context::GlobalCtxt>>::enter::<core[5a6fd8bb0fda964d]::result::Result<(), rustc_span[41bcdfd57efa771a]::ErrorGuaranteed>, rustc_driver_impl[c9c7a953b4411394]::run_compiler::{closure#1}::{closure#2}::{closure#6}>
  77:     0x400001a055ec - <scoped_tls[bc883fe07799d80a]::ScopedKey<rustc_span[41bcdfd57efa771a]::SessionGlobals>>::set::<rustc_interface[db4590941cd866b]::interface::run_compiler<core[5a6fd8bb0fda964d]::result::Result<(), rustc_span[41bcdfd57efa771a]::ErrorGuaranteed>, rustc_driver_impl[c9c7a953b4411394]::run_compiler::{closure#1}>::{closure#0}, core[5a6fd8bb0fda964d]::result::Result<(), rustc_span[41bcdfd57efa771a]::ErrorGuaranteed>>
  78:     0x400001a09058 - std[bf926301822f3e32]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[db4590941cd866b]::util::run_in_thread_with_globals<rustc_interface[db4590941cd866b]::interface::run_compiler<core[5a6fd8bb0fda964d]::result::Result<(), rustc_span[41bcdfd57efa771a]::ErrorGuaranteed>, rustc_driver_impl[c9c7a953b4411394]::run_compiler::{closure#1}>::{closure#0}, core[5a6fd8bb0fda964d]::result::Result<(), rustc_span[41bcdfd57efa771a]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[5a6fd8bb0fda964d]::result::Result<(), rustc_span[41bcdfd57efa771a]::ErrorGuaranteed>>
  79:     0x400001a02f70 - <<std[bf926301822f3e32]::thread::Builder>::spawn_unchecked_<rustc_interface[db4590941cd866b]::util::run_in_thread_with_globals<rustc_interface[db4590941cd866b]::interface::run_compiler<core[5a6fd8bb0fda964d]::result::Result<(), rustc_span[41bcdfd57efa771a]::ErrorGuaranteed>, rustc_driver_impl[c9c7a953b4411394]::run_compiler::{closure#1}>::{closure#0}, core[5a6fd8bb0fda964d]::result::Result<(), rustc_span[41bcdfd57efa771a]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[5a6fd8bb0fda964d]::result::Result<(), rustc_span[41bcdfd57efa771a]::ErrorGuaranteed>>::{closure#1} as core[5a6fd8bb0fda964d]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  80:     0x40000701acd0 - std::sys::unix::thread::Thread::new::thread_start::h13adca5242298a37
  81:     0x400007152cbc - <unknown>
  82:     0x4000071bb2dc - <unknown>
  83:                0x0 - <unknown>


rustc version: 1.75.0 (82e1608df 2023-12-21) (gentoo)
platform: aarch64-unknown-linux-gnu

query stack during panic:
#0 [eval_to_allocation_raw] const-evaluating + checking `core::num::<impl usize>::MAX`
#1 [eval_to_const_value_raw] simplifying constant for the type system `core::num::<impl usize>::MAX`
#2 [eval_to_allocation_raw] const-evaluating + checking `core::num::<impl usize>::BITS`
#3 [eval_to_const_value_raw] simplifying constant for the type system `core::num::<impl usize>::BITS`
#4 [eval_to_allocation_raw] const-evaluating + checking `arch::all::memchr::USIZE_BYTES`
#5 [eval_to_const_value_raw] simplifying constant for the type system `arch::all::memchr::USIZE_BYTES`
#6 [mir_promoted] promoting constants in MIR for `arch::all::memchr::<impl at /rust/deps/memchr/src/arch/all/memchr.rs:40:1: 40:9>::find_raw`
#7 [mir_borrowck] borrow-checking `arch::all::memchr::<impl at /rust/deps/memchr/src/arch/all/memchr.rs:40:1: 40:9>::find_raw`
#8 [analysis] running analysis passes on this crate
end of query stack

Users have found disabling lto in the build config.toml allows them to build Rust successfully

@bowlofeggs bowlofeggs 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 Feb 15, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 15, 2024
@saethlin saethlin added A-const-eval Area: Constant evaluation, covers all const contexts (static, const fn, ...) and removed A-const-eval Area: Constant evaluation, covers all const contexts (static, const fn, ...) labels Feb 15, 2024
@saethlin
Copy link
Member

saethlin commented Feb 15, 2024

Honestly this looks like the const-eval interpreter has been miscompiled. That index is 0x00ffffff00000000 which is a suspicious bit pattern. And if that index were valid, it would be the number of locals or frames in the interpter, either is extremely unlikely to have actually happened.

The other user is reporting a smattering of errors, but like the above ICE, they're all from a misbehaving const eval interpreter.

@Noratrieb
Copy link
Member

Noratrieb commented Feb 15, 2024

By the way, rustc is not faster when compiled with fat LTO than with thin LTO (which, unlike the fat LTO config, is well tested, as we distribute our release artifacts with that). #103453

@Noratrieb
Copy link
Member

Noratrieb commented Feb 15, 2024

Other people have hit miscompilations in the past too with fat LTO compiling rustc (#110564
). Given that it's not faster and less correct, we should probably remove fat LTO entirely, or at least require the user to pass some sort of "i know what I'm doing" flag.
Where knowing what someone is doing could mean debugging those miscompilations because I definitely don't want to imply that those aren't bad bugs!

@jieyouxu jieyouxu added O-PowerPC Target: PowerPC processors A-LTO Area: Link-time optimization (LTO) O-AArch64 Armv8-A or later processors in AArch64 mode labels Feb 15, 2024
@saethlin saethlin added I-unsound Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness regression-from-stable-to-stable Performance or correctness regression from one stable version to another. labels Feb 15, 2024
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Feb 15, 2024
@saethlin saethlin added regression-from-stable-to-beta Performance or correctness regression from stable to beta. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. regression-from-stable-to-stable Performance or correctness regression from one stable version to another. labels Feb 15, 2024
@apiraino
Copy link
Contributor

WG-prioritization assigning priority (Zulip discussion).

@rustbot label -I-prioritize +P-critical

@rustbot rustbot added P-critical Critical priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Feb 15, 2024
@nikic nikic added the A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. label Feb 19, 2024
@nikic
Copy link
Contributor

nikic commented Feb 19, 2024

Is it possible to verify whether this still happens on nightly (which has LLVM 18)?

@apiraino
Copy link
Contributor

Is it possible to verify whether this still happens on nightly (which has LLVM 18)?

cc: @bowlofeggs

@bowlofeggs
Copy link
Author

I posted on our ticket to ask if anyone can check. I don't personally have affected hardware to check myself.

@apiraino
Copy link
Contributor

downgrading to P-high as per T-compiler triage meeting (on Zulip).

@rustbot label -P-critical +P-high

@rustbot rustbot added P-high High priority and removed P-critical Critical priority labels Feb 29, 2024
@Mark-Simulacrum Mark-Simulacrum added regression-from-stable-to-stable Performance or correctness regression from one stable version to another. and removed regression-from-stable-to-beta Performance or correctness regression from stable to beta. labels Mar 15, 2024
bowlofeggs added a commit to bowlofeggs/gentoo that referenced this issue Mar 17, 2024
We've had a few issues with lto on, and it isn't on by default generally
among Gentoo packages, so this commit flips it to be off by default.

Additionally, in an upstream ticket[0] it was suggested to use thin LTO
rather than fat LTO, so this commit makes that adjustment as well.

[0] rust-lang/rust#121124

Bug: https://bugs.gentoo.org/924301
Signed-off-by: Randy Barlow <randy@electronsweatshop.com>
gentoo-bot pushed a commit to gentoo/gentoo that referenced this issue Mar 21, 2024
We've had a few issues with lto on, and it isn't on by default generally
among Gentoo packages, so this commit flips it to be off by default.

Additionally, in an upstream ticket[0] it was suggested to use thin LTO
rather than fat LTO, so this commit makes that adjustment as well.

[0] rust-lang/rust#121124

[sam: Note that there's a risk of miscompilations with non-thin LTO, per the
upstream bug(s).]

Bug: https://bugs.gentoo.org/924301
Signed-off-by: Randy Barlow <randy@electronsweatshop.com>
Closes: #35796
Signed-off-by: Sam James <sam@gentoo.org>
@bowlofeggs
Copy link
Author

thin

We switched to using thin LTO in some testing builds recently, and a user reported to me that thin LTO fails on RISC-V, where fat LTO succeeds.

@saethlin
Copy link
Member

Can you link to an issue report? Or provide any details? Or a reproducer of the problem?

@bowlofeggs
Copy link
Author

bowlofeggs commented Mar 22, 2024

Can you link to an issue report? Or provide any details? Or a reproducer of the problem?

This is from the user reporting issues with thin LTO on RISC-V:

error: rustc interrupted by SIGSEGV, printing backtrace
 
/var/tmp/portage/dev-lang/rust-1.76.0-r1/work/rustc-1.76.0-src/build/riscv64gc-unknown-linux-gnu/stage1/lib/librustc_driver-6033eea214516925.so(+0x82c3d0)[0x3fbb02c3d0]
linux-vdso.so.1(__vdso_rt_sigreturn+0x0)[0x3fbe5015b0]
/lib64/libc.so.6(__libc_free+0x8)[0x3fba61df8a]
/usr/lib/llvm/17/lib64/libLLVM-17.so(_ZN4llvm15ScalarEvolutionD1Ev+0x420)[0x3fb4d118b0]
/usr/lib/llvm/17/lib64/libLLVM-17.so(+0x15f170c)[0x3fb41f170c]
/usr/lib/llvm/17/lib64/libLLVM-17.so(_ZN4llvm15AnalysisManagerINS_8FunctionEJEE10invalidateERS1_RKNS_17PreservedAnalysesE+0x476)[0x3fb37c8506]
/usr/lib/llvm/17/lib64/libLLVM-17.so(+0x2d5799e)[0x3fb595799e]
/usr/lib/llvm/17/lib64/libLLVM-17.so(_ZN4llvm26CGSCCToFunctionPassAdaptor3runERNS_13LazyCallGraph3SCCERNS_15AnalysisManagerIS2_JRS1_EEES5_RNS_17CGSCCUpdateResultE+0x2f4)[0x3fb4b56a86]
/usr/lib/llvm/17/lib64/libLLVM-17.so(+0x2d4224c)[0x3fb594224c]
/usr/lib/llvm/17/lib64/libLLVM-17.so(_ZN4llvm11PassManagerINS_13LazyCallGraph3SCCENS_15AnalysisManagerIS2_JRS1_EEEJS4_RNS_17CGSCCUpdateResultEEE3runERS2_RS5_S4_S7_+0x122)[0x3fb4b539cc]
/usr/lib/llvm/17/lib64/libLLVM-17.so(+0x1cca23c)[0x3fb48ca23c]
/usr/lib/llvm/17/lib64/libLLVM-17.so(_ZN4llvm21DevirtSCCRepeatedPass3runERNS_13LazyCallGraph3SCCERNS_15AnalysisManagerIS2_JRS1_EEES5_RNS_17CGSCCUpdateResultE+0x160)[0x3fb4b5758e]
/usr/lib/llvm/17/lib64/libLLVM-17.so(+0x1cca1fa)[0x3fb48ca1fa]
/usr/lib/llvm/17/lib64/libLLVM-17.so(_ZN4llvm33ModuleToPostOrderCGSCCPassAdaptor3runERNS_6ModuleERNS_15AnalysisManagerIS1_JEEE+0xa24)[0x3fb4b54528]
/usr/lib/llvm/17/lib64/libLLVM-17.so(_ZN4llvm24ModuleInlinerWrapperPass3runERNS_6ModuleERNS_15AnalysisManagerIS1_JEEE+0x254)[0x3fb48cce9e]
/usr/lib/llvm/17/lib64/libLLVM-17.so(+0x401a806)[0x3fb6c1a806]
/usr/lib/llvm/17/lib64/libLLVM-17.so(_ZN4llvm11PassManagerINS_6ModuleENS_15AnalysisManagerIS1_JEEEJEE3runERS1_RS3_+0x37c)[0x3fb37c55c2]
/var/tmp/portage/dev-lang/rust-1.76.0-r1/work/rustc-1.76.0-src/build/riscv64gc-unknown-linux-gnu/stage1/lib/librustc_driver-6033eea214516925.so(LLVMRustOptimize+0xd02)[0x3fbb329df4]
/var/tmp/portage/dev-lang/rust-1.76.0-r1/work/rustc-1.76.0-src/build/riscv64gc-unknown-linux-gnu/stage1/lib/librustc_driver-6033eea214516925.so(+0xb11ba2)[0x3fbb311ba2]
/var/tmp/portage/dev-lang/rust-1.76.0-r1/work/rustc-1.76.0-src/build/riscv64gc-unknown-linux-gnu/stage1/lib/librustc_driver-6033eea214516925.so(+0xb12174)[0x3fbb312174]
/var/tmp/portage/dev-lang/rust-1.76.0-r1/work/rustc-1.76.0-src/build/riscv64gc-unknown-linux-gnu/stage1/lib/librustc_driver-6033eea214516925.so(+0xa44af4)[0x3fbb244af4]
/var/tmp/portage/dev-lang/rust-1.76.0-r1/work/rustc-1.76.0-src/build/riscv64gc-unknown-linux-gnu/stage1/lib/librustc_driver-6033eea214516925.so(+0xac488e)[0x3fbb2c488e]
/var/tmp/portage/dev-lang/rust-1.76.0-r1/work/rustc-1.76.0-src/build/riscv64gc-unknown-linux-gnu/stage1/lib/librustc_driver-6033eea214516925.so(+0xb0899a)[0x3fbb30899a]
/var/tmp/portage/dev-lang/rust-1.76.0-r1/work/rustc-1.76.0-src/build/riscv64gc-unknown-linux-gnu/stage1/lib/librustc_driver-6033eea214516925.so(+0xb1a312)[0x3fbb31a312]
/var/tmp/portage/dev-lang/rust-1.76.0-r1/work/rustc-1.76.0-src/build/riscv64gc-unknown-linux-gnu/stage1/lib/librustc_driver-6033eea214516925.so(+0xa461f8)[0x3fbb2461f8]
/var/tmp/portage/dev-lang/rust-1.76.0-r1/work/rustc-1.76.0-src/build/riscv64gc-unknown-linux-gnu/stage1/lib/libstd-119f0871fd3a88fa.so(rust_metadata_std_13990566ce80a7ec+0x771d0)[0x3fba7771d0]
/lib64/libc.so.6(+0x6b0b0)[0x3fba6110b0]
/lib64/libc.so.6(+0xb6dfc)[0x3fba65cdfc]
 
note: we would appreciate a report at https://github.com/rust-lang/rust
note: backtrace dumped due to SIGSEGV! resuming signal
rustc exited with signal: 11 (SIGSEGV)
error: could not compile `rustc_middle` (lib)

They also mentioned that they are using the system-provided LLVM rather than the rust provided one, and they indicated that they think that might be related.

@pnkfelix
Copy link
Member

pnkfelix commented Mar 22, 2024

I think I might be able to reproduce some related problems here on my Mac M1 (now that I have compiled the compiler with LTO=fat turned on).

In particular: I have not seen the bootstrap itself fail (at least not when doing x.py build --stage 2), but a huge number of UI tests (4,925 tests out of 16,107) fail on a rustc built with LTO=fat, and a quick skim indicates their stacktraces all point to a similar spot in the const-eval system.

I have to go AFK for a bit but I'll poke at this more later.

@jieyouxu jieyouxu added E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example E-needs-investigation Call for partcipation: This issues needs some investigation to determine current status labels Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-LTO Area: Link-time optimization (LTO) C-bug Category: This is a bug. E-needs-investigation Call for partcipation: This issues needs some investigation to determine current status 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) ❄️ I-unsound Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness O-AArch64 Armv8-A or later processors in AArch64 mode O-PowerPC Target: PowerPC processors P-high High priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. 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

9 participants