Skip to content

ICE on beta and nightly: index out of bounds in RestoreSubsliceArrayMoveOut MIR pass #59048

Closed
@koute

Description

@koute

The main crate of our profiler (commit d2ec7ae) stopped compiling on beta and nightly. The stable channel works fine, so this is a regression-from-stable-to-nightly and regression-from-stable-to-beta.

Relevant Travis jobs

nightly (failed) - https://travis-ci.org/nokia/not-perf/jobs/504003420
beta (failed) - https://travis-ci.org/nokia/not-perf/jobs/504003419
stable (which compiles successfully) - https://travis-ci.org/nokia/not-perf/jobs/504003418

Reproduction

$ git clone https://github.com/nokia/not-perf.git
$ cd not-perf
$ cargo build

cargo test and cargo check are fine and do not ICE (which is why I haven't noticed this sooner); only cargo build (both debug and release) is broken.

Compiler output

thread 'rustc' panicked at 'index out of bounds: the len is 3 but the index is 3', /rustc/2a65cbeea78c2c79b1030a0012cdea475104a44f/src/libcore/slice/mod.rs:2545:14
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
   1: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at src/libstd/sys_common/backtrace.rs:59
             at src/libstd/panicking.rs:197
   3: std::panicking::default_hook
             at src/libstd/panicking.rs:211
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:478
   6: std::panicking::continue_panic_fmt
             at src/libstd/panicking.rs:381
   7: rust_begin_unwind
             at src/libstd/panicking.rs:308
   8: core::panicking::panic_fmt
             at src/libcore/panicking.rs:85
   9: core::panicking::panic_bounds_check
             at src/libcore/panicking.rs:61
  10: rustc::mir::visit::Visitor::visit_place
  11: <rustc_mir::transform::uniform_array_move_out::RestoreDataCollector as rustc::mir::visit::Visitor<'tcx>>::visit_assign
  12: <rustc_mir::transform::uniform_array_move_out::RestoreSubsliceArrayMoveOut as rustc_mir::transform::MirPass>::run_pass
  13: rustc_mir::transform::run_passes::{{closure}}
  14: rustc_mir::transform::run_passes
  15: rustc_mir::transform::optimized_mir
  16: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::optimized_mir<'tcx>>::compute
  17: rustc::dep_graph::graph::DepGraph::with_task_impl
  18: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
  19: rustc_mir::monomorphize::collector::collect_items_rec
  20: rustc_mir::monomorphize::collector::collect_items_rec
  21: rustc_mir::monomorphize::collector::collect_items_rec
  22: rustc_mir::monomorphize::collector::collect_items_rec
  23: rustc_mir::monomorphize::collector::collect_items_rec
  24: rustc_mir::monomorphize::collector::collect_items_rec
  25: rustc_mir::monomorphize::collector::collect_crate_mono_items::{{closure}}
  26: rustc::util::common::time
  27: rustc_mir::monomorphize::collector::collect_crate_mono_items
  28: rustc::util::common::time
  29: rustc_mir::monomorphize::partitioning::collect_and_partition_mono_items
  30: rustc::ty::query::__query_compute::collect_and_partition_mono_items
  31: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::collect_and_partition_mono_items<'tcx>>::compute
  32: rustc::dep_graph::graph::DepGraph::with_task_impl
  33: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
  34: rustc_codegen_ssa::base::codegen_crate
  35: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_utils::codegen_backend::CodegenBackend>::codegen_crate
  36: rustc::util::common::time
  37: rustc_driver::driver::phase_4_codegen
  38: <std::thread::local::LocalKey<T>>::with
  39: rustc::ty::context::TyCtxt::create_and_enter
  40: rustc_driver::driver::compile_input
  41: rustc_driver::run_compiler_with_pool
  42: <scoped_tls::ScopedKey<T>>::set
  43: rustc_driver::run_compiler
  44: syntax::with_globals
  45: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:87
  46: <F as alloc::boxed::FnBox<A>>::call_box
  47: std::sys::unix::thread::Thread::new::thread_start
             at /rustc/2a65cbeea78c2c79b1030a0012cdea475104a44f/src/liballoc/boxed.rs:759
             at src/libstd/sys_common/thread.rs:14
             at src/libstd/sys/unix/thread.rs:80
  48: start_thread
  49: clone
query stack during panic:
#0 [optimized_mir] processing `ps::wait_for_process`
#1 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack
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.35.0-nightly (2a65cbeea 2019-03-08) running on x86_64-unknown-linux-gnu
note: compiler flags: -C debuginfo=2 -C incremental --crate-type bin
note: some of the compiler flags provided by cargo are hidden
error: Could not compile `nperf`.

Affected rustc versions

rustc 1.35.0-nightly (2a65cbe 2019-03-08)
rustc 1.34.0-beta.1 (744b374 2019-02-26)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlA-codegenArea: Code generationC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions