Skip to content

Panic index out of bounds running cargo test (unreproducable) #73967

Closed

Description

@zhiburt

Follow the compiler's note I decided to unveil this issue 😄

After first time I get the crash I ran cargo test 2 times and each time it was a crash but after that it went normally. I wasn't able to reproduce it.

I don't provide here the code since I consider it unreproducable.

Meta

RUST_BACKTRACE=1 cargo test--verbose:

Backtrace:

thread 'rustc' panicked at 'index out of bounds: the len is 10 but the index is 10', src/librustc_middle/ty/query/on_disk_cache.rs:583:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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/blob/master/CONTRIB..

note: rustc 1.44.0 (49cae5576 2020-06-01) running on x86_64-unknown-linux-gnu

note: compiler flags: -C debuginfo=2 -C incremental

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

warning: 1 warning emitted

error: could not compile `rstext`.

To learn more, run the command again with —verbose.

rust-lang/rust
github.com
 
thread 'rustc' panicked at 'index out of bounds: the len is 10 but the index is 10', src/librustc_middle/ty/query/on_disk_cache.rs:583:18
stack backtrace:
0: backtrace::backtrace::libunwind::trace
at /cargo/registry/src/github.life-white.uk-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
1: backtrace::backtrace::trace_unsynchronized
at /cargo/registry/src/github.life-white.uk-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
2: std::sys_common::backtrace::_print_fmt
at src/libstd/sys_common/backtrace.rs:78
3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
at src/libstd/sys_common/backtrace.rs:59
4: core::fmt::write
at src/libcore/fmt/mod.rs:1069
5: std::io::Write::write_fmt
at src/libstd/io/mod.rs:1504
6: std::sys_common::backtrace::_print
at src/libstd/sys_common/backtrace.rs:62
7: std::sys_common::backtrace::print
at src/libstd/sys_common/backtrace.rs:49
8: std::panicking::default_hook::{{closure}}
at src/libstd/panicking.rs:198
9: std::panicking::default_hook
at src/libstd/panicking.rs:218
10: rustc_driver::report_ice
11: std::panicking::rust_panic_with_hook
at src/libstd/panicking.rs:515
12: rust_begin_unwind
at src/libstd/panicking.rs:419
13: core::panicking::panic_fmt
at src/libcore/panicking.rs:111
14: core::panicking::panic_bounds_check
at src/libcore/panicking.rs:69
15: <rustc_middle::ty::query::on_disk_cache::CacheDecoder as serialize::serialize::SpecializedDecoder<rustc_span::span_encoding::Span»::specialized_decode
16: <rustc_middle::mir::SourceInfo as serialize::serialize::Decodable>::decode
17: <rustc_middle::mir::Statement as serialize::serialize::Decodable>::decode
18: serialize::serialize::Decoder::read_seq
19: <rustc_middle::mir::BasicBlockData as serialize::serialize::Decodable>::decode
20: serialize::serialize::Decoder::read_seq
21: <rustc_middle::mir::Body as serialize::serialize::Decodable>::decode::{{closure}}
22: rustc_middle::ty::query::on_disk_cache::OnDiskCache::try_load_query_result
23: rustc_query_system::query::plumbing::get_query
24: rustc_middle::ty::<impl rustc_middle::ty::context::TyCtxt>::instance_mir
25: rustc_mir::monomorphize::collector::collect_items_rec
26: rustc_mir::monomorphize::collector::collect_items_rec
27: rustc_mir::monomorphize::collector::collect_crate_mono_items
28: rustc_mir::monomorphize::partitioning::collect_and_partition_mono_items
29: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::collect_and_partition_mono_items>::compute
30: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
31: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
32: rustc_query_system::query::plumbing::get_query
33: rustc_codegen_ssa::base::codegen_crate
34: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
35: rustc_session::utils::<impl rustc_session::session::Session>::time
36: rustc_interface::passes::start_codegen
37: rustc_middle::ty::context::tls::enter_global
38: rustc_interface::queries::Queries::ongoing_codegen
39: rustc_interface::interface::run_compiler_in_existing_thread_pool
40: scoped_tls::ScopedKey<T>::set
41: rustc_ast::attr::with_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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/blob/master/CONTRIB..

note: rustc 1.44.0 (49cae5576 2020-06-01) running on x86_64-unknown-linux-gnu

note: compiler flags: -C debuginfo=2 -C incremental

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

query stack during panic:
#0 [optimized_mir] processing `it_works::{{closure}}#0`
#1 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack
warning: 1 warning
 
emitted

error: could not compile `rstext`.

Caused by:
process didn't exit successfully: `rustc —crate-name test —edition=2018 tests/test.rs —error-format=json —json=diagnostic-rendered-ansi —emit=dep-info,link -C debuginfo=2 —test -C metadata=d3af2c6bb91399d2 -C extra-filename=-d3af2c6bb91399d2 —out-dir /home/zhiburt/proj/po-rs/target/debug/deps -C incremental=/home/zhiburt/proj/po-rs/target/debug/incremental -L dependency=/home/zhiburt/proj/po-rs/target/debug/deps —extern rstext=/home/zhiburt/proj/po-rs/target/debug/deps/librstext-96bd2310391f3aca.rlib` (exit code: 101)

Activity

  1. added
    A-incr-compArea: Incremental compilation
    E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Jul 2, 2020
  2. self-assigned this
    on Jul 3, 2020
  3. added a commit that references this issue on Nov 4, 2020
    b71e627
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-incr-compArea: Incremental compilationC-bugCategory: This is a bug.E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions