Skip to content

rustc bug - index out of bounds #73640

Closed

Description

@bestia-dev

short summary of the bug:
Unexpectedly the compiler return an error.
I compile on WSL1 Debian on Win10.

I tried this code in this commit:
https://github.com/LucianoBestia/crates_io_database/commit/18b625fe64c4a54d871fc0f21ad6e6994dc11fab

code sample that causes the bug:
I run this command:
$ clear; cargo test

I expected to see this happen:
tests pass or fail.

Instead, this happened:
\

thread 'rustc' panicked at 'index out of bounds: the len is 559 but the index is 560', /rustc/4fb7144ed159f94491249e86d5bbd033b5d60550/src/libcore/slice/mod.rs:2842:10
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/CONTRIBUTING.md#bug-reports

note: rustc 1.43.0 (4fb7144ed 2020-04-20) 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

Meta

rustc --version --verbose:
\

rustc 1.43.0 (4fb7144ed 2020-04-20)
binary: rustc
commit-hash: 4fb7144ed159f94491249e86d5bbd033b5d60550
commit-date: 2020-04-20
host: x86_64-unknown-linux-gnu
release: 1.43.0
LLVM version: 9.0

Backtrace:

stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.life-white.uk-1ecc6299db9ec823/backtrace-0.3.44/src/backtrace/libunwind.rs:86
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.life-white.uk-1ecc6299db9ec823/backtrace-0.3.44/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:1063
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1426
   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:204
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:224
  10: rustc_driver::report_ice
  11: <alloc::boxed::Box<F> as core::ops::function::Fn<A>>::call
             at /rustc/4fb7144ed159f94491249e86d5bbd033b5d60550/src/liballoc/boxed.rs:1031
  12: proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}::{{closure}}
             at /rustc/4fb7144ed159f94491249e86d5bbd033b5d60550/src/libproc_macro/bridge/client.rs:305
  13: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:474
  14: rust_begin_unwind
             at src/libstd/panicking.rs:378
  15: core::panicking::panic_fmt
             at src/libcore/panicking.rs:85
  16: core::panicking::panic_bounds_check
             at src/libcore/panicking.rs:63
  17: <rustc::ty::query::on_disk_cache::CacheDecoder as serialize::serialize::SpecializedDecoder<rustc_span::span_encoding::Span>>::specialized_decode
  18: <rustc::mir::SourceInfo as serialize::serialize::Decodable>::decode
  19: <rustc::mir::Statement as serialize::serialize::Decodable>::decode
  20: serialize::serialize::Decoder::read_seq
  21: <rustc::mir::BasicBlockData as serialize::serialize::Decodable>::decode
  22: serialize::serialize::Decoder::read_seq
  23: <rustc::mir::Body as serialize::serialize::Decodable>::decode::{{closure}}
  24: rustc::ty::query::on_disk_cache::OnDiskCache::try_load_query_result
  25: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  26: rustc::ty::<impl rustc::ty::context::TyCtxt>::instance_mir
  27: rustc_mir::monomorphize::collector::collect_items_rec
  28: rustc_mir::monomorphize::collector::collect_items_rec
  29: rustc_session::utils::<impl rustc_session::session::Session>::time
  30: rustc_mir::monomorphize::collector::collect_crate_mono_items
  31: rustc_mir::monomorphize::partitioning::collect_and_partition_mono_items
  32: rustc::ty::query::__query_compute::collect_and_partition_mono_items
  33: rustc::dep_graph::graph::DepGraph::with_task_impl
  34: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  35: rustc_codegen_ssa::base::codegen_crate
  36: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_utils::codegen_backend::CodegenBackend>::codegen_crate
  37: rustc_interface::passes::start_codegen
  38: rustc::ty::context::tls::enter_global
  39: rustc_interface::queries::Queries::ongoing_codegen
  40: rustc_interface::interface::run_compiler_in_existing_thread_pool
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/CONTRIBUTING.md#bug-reports

note: rustc 1.43.0 (4fb7144ed 2020-04-20) 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 `qvs20_table_mod::test::test_03_all_wrong_in_schema::{{closure}}#0`
#1 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack
error: could not compile `crates_io_database`.

Activity

  1. tesuji commented on Jun 23, 2020

    @tesuji
    Contributor

    Cannot reproduce in current nightly: rustc 1.46.0-nightly (6bb3dbf 2020-06-22)
    The rustc host was x86_64-unknown-linux-gnu.

  2. added
    A-metadataArea: Crate metadata
    C-bugCategory: This is a bug.
    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 Jun 23, 2020
  3. added
    E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
    on Jun 27, 2020
  4. 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

No one assigned

    Labels

    A-metadataArea: Crate metadataC-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