Skip to content

rustc build crash #140508

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

Open
lrobot opened this issue Apr 30, 2025 · 9 comments
Open

rustc build crash #140508

lrobot opened this issue Apr 30, 2025 · 9 comments
Labels
C-bug Category: This is a bug. E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc 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) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@lrobot
Copy link

lrobot commented Apr 30, 2025

Code

git@github.com:JohanChane/clashtui.git

Meta

rustc --version --verbose:

# rustc --version --verbose
rustc 1.86.0 (05f9846f8 2025-03-31)
binary: rustc
commit-hash: 05f9846f893b09a1be1fc8560e33fc3c815cfecb
commit-date: 2025-03-31
host: x86_64-unknown-linux-musl
release: 1.86.0
LLVM version: 19.1.7

Error output

   Compiling synstructure v0.13.1
   Compiling serde_derive v1.0.197
   Compiling zerovec-derive v0.10.3
   Compiling displaydoc v0.2.5
   Compiling zerofrom-derive v0.1.5
   Compiling yoke-derive v0.7.5
   Compiling writeable v0.5.5

thread 'rustc' panicked at compiler/rustc_metadata/src/rmeta/decoder.rs:1032:66:
index out of bounds: the len is 1 but the index is 2
stack backtrace:
   0: rust_begin_unwind
             at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library/std/src/panicking.rs:695:5
   1: core::panicking::panic_fmt
             at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library/core/src/panicking.rs:75:14
   2: core::panicking::panic_bounds_check
             at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library/core/src/panicking.rs:273:5
   3: <rustc_metadata::rmeta::decoder::DecodeContext as rustc_span::SpanDecoder>::decode_crate_num
   4: <rustc_metadata::rmeta::decoder::DecodeContext as rustc_span::SpanDecoder>::decode_expn_id
   5: <rustc_span::hygiene::ExpnData as rustc_serialize::serialize::Decodable<rustc_metadata::rmeta::decoder::DecodeContext>>::decode
   6: <rustc_metadata::rmeta::decoder::DecodeContext as rustc_span::SpanDecoder>::decode_expn_id
   7: <rustc_metadata::rmeta::decoder::DecodeContext as rustc_span::SpanDecoder>::decode_syntax_context
   8: <rustc_span::SpanData as rustc_serialize::serialize::Decodable<rustc_metadata::rmeta::decoder::DecodeContext>>::decode
   9: <rustc_metadata::rmeta::decoder::DecodeContext as rustc_span::SpanDecoder>::decode_span
  10: <rustc_ast::ast::MetaItemLit as rustc_serialize::serialize::Decodable<rustc_metadata::rmeta::decoder::DecodeContext>>::decode
  11: <rustc_hir::hir::Attribute as rustc_serialize::serialize::Decodable<rustc_metadata::rmeta::decoder::DecodeContext>>::decode
  12: <smallvec::SmallVec<[rustc_hir::hir::Attribute; 8]> as core::iter::traits::collect::Extend<rustc_hir::hir::Attribute>>::extend::<rustc_metadata::rmeta::decoder::DecodeIterator<rustc_hir::hir::Attribute>>
  13: rustc_metadata::rmeta::decoder::cstore_impl::provide_extern::attrs_for_def
      [... omitted 2 frames ...]
  14: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 16]>>>
  15: <rustc_const_eval::check_consts::check::Checker as rustc_middle::mir::visit::Visitor>::visit_terminator
  16: <rustc_const_eval::check_consts::check::Checker>::check_body
  17: rustc_mir_transform::mir_const_qualif
      [... omitted 2 frames ...]
  18: rustc_mir_transform::mir_promoted
      [... omitted 2 frames ...]
  19: rustc_borrowck::mir_borrowck
      [... omitted 2 frames ...]
  20: rustc_middle::query::plumbing::query_get_at::<rustc_data_structures::vec_cache::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::Erased<[u8; 8]>, rustc_query_system::dep_graph::graph::DepNodeIndex>>
  21: rustc_mir_transform::mir_drops_elaborated_and_const_checked
      [... omitted 2 frames ...]
  22: rustc_middle::query::plumbing::query_get_at::<rustc_data_structures::vec_cache::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::Erased<[u8; 8]>, rustc_query_system::dep_graph::graph::DepNodeIndex>>
  23: rustc_mir_transform::mir_for_ctfe
      [... omitted 2 frames ...]
  24: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>>
  25: <rustc_const_eval::interpret::eval_context::InterpCx<rustc_const_eval::const_eval::machine::CompileTimeMachine>>::load_mir
  26: rustc_const_eval::const_eval::eval_queries::eval_to_allocation_raw_provider
      [... omitted 2 frames ...]
  27: rustc_const_eval::const_eval::eval_queries::eval_to_const_value_raw_provider
      [... omitted 2 frames ...]
  28: <rustc_middle::hir::map::Map>::par_body_owners::<rustc_hir_analysis::check_crate::{closure#2}>::{closure#0}
  29: rustc_hir_analysis::check_crate
  30: rustc_interface::passes::analysis
      [... omitted 2 frames ...]
  31: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>::{closure#1}, core::option::Option<rustc_interface::queries::Linker>>::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>
  32: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}>
  33: <rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
  34: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  35: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>
  36: rustc_span::create_session_globals_then::<(), rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}>
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: rustc 1.86.0 (05f9846f8 2025-03-31) running on x86_64-unknown-linux-musl

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2

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

query stack during panic:
#0 [attrs_for_def] collecting attributes of `core::num::<impl u32>::ilog10`
#1 [mir_const_qualif] const checking `impls::<impl at /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/writeable-0.5.5/src/impls.rs:10:9: 10:38>::write_to::MAX_LEN`
#2 [mir_promoted] promoting constants in MIR for `impls::<impl at /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/writeable-0.5.5/src/impls.rs:10:9: 10:38>::write_to::MAX_LEN`
#3 [mir_borrowck] borrow-checking `impls::<impl at /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/writeable-0.5.5/src/impls.rs:10:9: 10:38>::write_to::MAX_LEN`
#4 [mir_drops_elaborated_and_const_checked] elaborating drops for `impls::<impl at /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/writeable-0.5.5/src/impls.rs:10:9: 10:38>::write_to::MAX_LEN`
#5 [mir_for_ctfe] caching mir of `impls::<impl at /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/writeable-0.5.5/src/impls.rs:10:9: 10:38>::write_to::MAX_LEN` for CTFE  |  = note: this failure-note originates in the macro `impl_write_num` (in Nightly builds, run with -Z macro-backtrace for more info)

#6 [eval_to_allocation_raw] const-evaluating + checking `impls::<impl at /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/writeable-0.5.5/src/impls.rs:10:9: 10:38>::write_to::MAX_LEN`
#7 [eval_to_const_value_raw] simplifying constant for the type system `impls::<impl at /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/writeable-0.5.5/src/impls.rs:10:9: 10:38>::write_to::MAX_LEN`
#8 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `writeable` (lib)

Caused by:
  process didn't exit successfully: `/root/.rustup/toolchains/stable-x86_64-unknown-linux-musl/bin/rustc --crate-name writeable --edition=2021 /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/writeable-0.5.5/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=254 --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("bench", "either"))' -C metadata=19b3ed98f11d9422 -C extra-filename=-1d25687a78a655bf --out-dir /etc/qdoor/clashtui/clashtui/target/debug/deps -L dependency=/etc/qdoor/clashtui/clashtui/target/debug/deps --cap-lints allow` (exit status: 101)

@lrobot lrobot 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 Apr 30, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Apr 30, 2025
@jieyouxu
Copy link
Member

Does this repro with cargo clean -> cargo build again?

@lrobot
Copy link
Author

lrobot commented Apr 30, 2025

cargo clean && cargo build #still got crash
rm -rf target && cargo build #stilll got crash 

@lrobot
Copy link
Author

lrobot commented Apr 30, 2025

this alpine linux, a few day before. I can build it success. but not know why today. I get this build crash result

qdoor:/opt/clashtui# cat /etc/*release
3.21.3
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.21.3
PRETTY_NAME="Alpine Linux v3.21"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"

@jieyouxu jieyouxu added E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Apr 30, 2025
@moxian

This comment has been minimized.

@lrobot
Copy link
Author

lrobot commented May 5, 2025

I use alpine system apk install rust got "rust-1.83.0-r0" which can cargo build successful.
but if I use rust office install by below cmd got rust-1.86.0, and cargo build will failed

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

attachment is Cargo.lock after I do cargo update,(still fail on cmd: cargo build)

err.log

Cargo.lock.txt

@saethlin
Copy link
Member

saethlin commented May 5, 2025

cargo clean && cargo build #still got crash
rm -rf target && cargo build #stilll got crash 

Did you get the same crash?

@saethlin
Copy link
Member

saethlin commented May 5, 2025

What is in your /root/.cargo/config?

@lrobot
Copy link
Author

lrobot commented May 6, 2025

cargo clean && cargo build #still got crash
rm -rf target && cargo build #stilll got crash 

Did you get the same crash?

yes it same crash, build writeable(pkg) crash

@lrobot
Copy link
Author

lrobot commented May 6, 2025

What is in your /root/.cargo/config?

qdoor:~# cat ~/.cargo/config.toml
[source.crates-io]
replace-with = 'rsproxy-sparse'
[source.rsproxy]
registry = "https://rsproxy.cn/crates.io-index"
[source.rsproxy-sparse]
registry = "sparse+https://rsproxy.cn/index/"
[registries.rsproxy]
index = "https://rsproxy.cn/crates.io-index"
[net]
git-fetch-with-cli = true

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. E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc 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) ❄️ 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

5 participants