Closed jobafr closed 1 week ago
IIRC there were several bug fixes to metadata encoding in that period of time
Given that this does not appear to affect latest stable and that it's 1.74.1 and multiple changes to how metadata is encoded has occurred over subsequent releases, I'm inclined to close this as not actionable -- it lacks a reproduction on latest stable and multiple changes to metadata encoding has happened in the time frame.
Feel free to reopen if this still happens on latest stable.
Code
Empty binary (straight from
cargo new
), with a dependency to this serde version.Meta
rustc --version --verbose
:Operating System is Ubuntu 22.04. Computer is a Radxa Rock 5b (Single-Board computer based on Rockchip rk3588). The bug does not happen in nightly and stable (1.82.0), but for some reason, I can build the same code on Ubuntu 20.04 with Rust 1.74.1 without problems. It does not make a difference whether or not I use
--release
.Error output
Backtrace
``` $ RUST_BACKTRACE=1 cargo build --release Compiling proc-macro2 v1.0.89 thread 'rustc' panicked at compiler/rustc_metadata/src/rmeta/decoder.rs:999:66: index out of bounds: the len is 1 but the index is 114 stack backtrace: 0: rust_begin_unwind at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/std/src/panicking.rs:597:5 1: core::panicking::panic_fmt at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/core/src/panicking.rs:72:14 2: core::panicking::panic_bounds_check at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/core/src/panicking.rs:180:5 3:>::decode
4: >::decode
5: >::decode
6: as rustc_serialize::serialize::Decodable>::decode
7: >::decode
8: rustc_metadata::rmeta::decoder::cstore_impl::provide_extern::optimized_mir
[... omitted 2 frames ...]
9: rustc_middle::query::plumbing::query_get_at::>>
10: ::instance_mir
11: rustc_monomorphize::collector::collect_used_items
12: rustc_monomorphize::collector::collect_items_rec
13: rustc_monomorphize::collector::collect_items_rec
14: rustc_monomorphize::collector::collect_items_rec
15: rustc_monomorphize::collector::collect_items_rec
16: rustc_monomorphize::collector::collect_items_rec
17: rustc_monomorphize::collector::collect_items_rec
18: rustc_monomorphize::collector::collect_items_rec
19: rustc_monomorphize::collector::collect_items_rec
20: rustc_monomorphize::collector::collect_items_rec
21: rustc_monomorphize::collector::collect_items_rec
22: rustc_monomorphize::collector::collect_items_rec
23: , rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}::{closure#0}>::{closure#0}::{closure#0}::{closure#0}> as core::ops::function::FnOnce<()>>::call_once
24: rustc_data_structures::sync::parallel::disabled::par_for_each_in::, rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}::{closure#0}>
25: ::time::<(), rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}>
26: rustc_monomorphize::collector::collect_crate_mono_items
27: rustc_monomorphize::partitioning::collect_and_partition_mono_items
[... omitted 2 frames ...]
28: rustc_codegen_ssa::back::symbol_export::exported_symbols_provider_local
[... omitted 2 frames ...]
29: ::encode_crate_root
30: rustc_metadata::rmeta::encoder::encode_metadata_impl
31: rustc_data_structures::sync::parallel::disabled::join::
32: rustc_metadata::rmeta::encoder::encode_metadata
33: rustc_metadata::fs::encode_and_write_metadata
34: rustc_interface::passes::start_codegen
35: ::enter::<::ongoing_codegen::{closure#0}, core::result::Result, rustc_span::ErrorGuaranteed>>
36: ::ongoing_codegen
37: rustc_span::set_source_map::, rustc_interface::interface::run_compiler, rustc_driver_impl::run_compiler::{closure#1}>::{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.74.1 (a28077b28 2023-12-04) running on aarch64-unknown-linux-gnu
note: compiler flags: --crate-type lib -C embed-bitcode=no -C debug-assertions=off
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [optimized_mir] optimizing MIR for `core::str::pattern::TwoWaySearcher::next`
#1 [collect_and_partition_mono_items] collect_and_partition_mono_items
#2 [exported_symbols] collecting exported symbols for crate `0`
end of query stack
error: could not compile `proc-macro2` (lib)
```