Skip to content

ICE "Tried to access element 1 of array/slice with length 0" (librustc_mir) / const_eval / collect_and_partition_mono_items #53275

Closed

Description

When compiling

https://github.com/ralfbiedert/ffsvm-rust/tree/ICE (7ad7b9d78af0984bb909d07107ddcdfc2d3d6b67)

with the command cargo test --verbose I receive the following ICE:

       Fresh unicode-xid v0.0.4                                                                                                                                                                                                        
       Fresh quote v0.3.15
       Fresh cfg-if v0.1.4
       Fresh pest v1.0.6
       Fresh rand_core v0.2.0
       Fresh libc v0.2.33
       Fresh synom v0.11.3
       Fresh packed_simd v0.1.0
       Fresh rand v0.5.0
       Fresh syn v0.11.11
       Fresh simd_aligned v0.1.1
       Fresh pest_derive v1.0.7
   Compiling ffsvm v0.5.0 (file:///Users/rb/Documents/Development/Source/ffsvm-rust)
     Running `rustc --edition=2018 --crate-name svm_class tests/svm_class.rs --emit=dep-info,link -C debuginfo=2 --test -C metadata=90de23b263b45bd4 -C extra-filename=-90de23b263b45bd4 --out-dir /Users/rb/Documents/Development/Source/ffsvm-rust/target/debug/deps -C incremental=/Users/rb/Documents/Development/Source/ffsvm-rust/target/debug/incremental -L dependency=/Users/rb/Documents/Development/Source/ffsvm-rust/target/debug/deps --extern ffsvm=/Users/rb/Documents/Development/Source/ffsvm-rust/target/debug/deps/libffsvm-834cad704ea3a49b.rlib --extern packed_simd=/Users/rb/Documents/Development/Source/ffsvm-rust/target/debug/deps/libpacked_simd-9c5bec2e1902d981.rlib --extern pest=/Users/rb/Documents/Development/Source/ffsvm-rust/target/debug/deps/libpest-7a901ee692ed4e10.rlib --extern pest_derive=/Users/rb/Documents/Development/Source/ffsvm-rust/target/debug/deps/libpest_derive-041426730142ad62.dylib --extern rand=/Users/rb/Documents/Development/Source/ffsvm-rust/target/debug/deps/librand-cdbc2f99eb873b42.rlib --extern simd_aligned=/Users/rb/Documents/Development/Source/ffsvm-rust/target/debug/deps/libsimd_aligned-7595223b10c560f3.rlib`
thread 'main' panicked at 'Tried to access element 1 of array/slice with length 0', librustc_mir/interpret/place.rs:356:9
stack backtrace:
   0:        0x11330d93f - std::sys::unix::backtrace::tracing::imp::unwind_backtrace::hddb21f2cad89c6a8
   1:        0x1132e63cd - std::sys_common::backtrace::print::h7c325da5eb3eacf5
   2:        0x113316153 - std::panicking::default_hook::{{closure}}::h2e93eff8a7617ec5
   3:        0x113315edc - std::panicking::default_hook::h40768a378fefffb3
   4:        0x111ba22f8 - rustc::util::common::panic_hook::he5eb435dac7dfbda
   5:        0x113316898 - std::panicking::rust_panic_with_hook::h63bac89c0b130b1b
   6:        0x1133163ec - std::panicking::continue_panic_fmt::hca36ebb6f3aa63ac
   7:        0x113316340 - std::panicking::begin_panic_fmt::h96fd014b81747723
   8:        0x110e8a21e - rustc_mir::interpret::place::<impl rustc_mir::interpret::eval_context::EvalContext<'a, 'mir, 'tcx, M>>::eval_place_projection::hf3b9d24363224386
   9:        0x110e87235 - rustc_mir::interpret::place::<impl rustc_mir::interpret::eval_context::EvalContext<'a, 'mir, 'tcx, M>>::eval_place::hed294ac41836bd74
  10:        0x110e7e126 - <rustc_mir::interpret::eval_context::EvalContext<'a, 'mir, 'tcx, M>>::eval_operand::hd351bd4d141c9108
  11:        0x110e92835 - rustc_mir::interpret::step::<impl rustc_mir::interpret::eval_context::EvalContext<'a, 'mir, 'tcx, M>>::step::h01a5c690b0510e44
  12:        0x111068c4e - rustc_mir::interpret::const_eval::eval_body_using_ecx::h88f34245fce79395
  13:        0x11106d248 - rustc_mir::interpret::const_eval::const_eval_provider::h5ef6141b9554157b
  14:        0x1117c804a - rustc::ty::query::__query_compute::const_eval::h9236b07a3e0ec26e
  15:        0x1118c6a9f - rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::const_eval<'tcx>>::compute::h1f4fad381d0aa6a1
  16:        0x11180f7ad - rustc::ty::context::tls::with_context::h4b76755e2f0fe2db
  17:        0x111664048 - rustc::dep_graph::graph::DepGraph::with_task_impl::h897ac5cae53df68c
  18:        0x11186d7a5 - rustc::ty::context::tls::with_related_context::h56ab789e44ae51c4
  19:        0x1118efeee - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job::h67fc91e06e082bda
  20:        0x111a1c798 - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query::hf47ecd159ff15a20
  21:        0x111a39199 - rustc::ty::query::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::const_eval::hc3a415a2c796a3d7
  22:        0x110de9fb9 - rustc_mir::monomorphize::collector::collect_items_rec::hf39d32380d174656
  23:        0x110dea50f - rustc_mir::monomorphize::collector::collect_items_rec::hf39d32380d174656
  24:        0x110dea50f - rustc_mir::monomorphize::collector::collect_items_rec::hf39d32380d174656
  25:        0x110dea50f - rustc_mir::monomorphize::collector::collect_items_rec::hf39d32380d174656
  26:        0x110de90cb - rustc_mir::monomorphize::collector::collect_crate_mono_items::{{closure}}::hc609b4d426ba4e51
  27:        0x110de871c - rustc_mir::monomorphize::collector::collect_crate_mono_items::hd9daffd73591bcec
  28:        0x113f6c48d - rustc::util::common::time::h2b1d2925f85ed468
  29:        0x113ffdec1 - rustc_codegen_llvm::base::collect_and_partition_mono_items::h39da64cc48fe4cc2
  30:        0x1118c7c9b - rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::collect_and_partition_mono_items<'tcx>>::compute::h07a9a79a971990a0
  31:        0x111838f94 - rustc::ty::context::tls::with_context::he5ae8e3b22ab295c
  32:        0x11165802c - rustc::dep_graph::graph::DepGraph::with_task_impl::h6fcdb50ec53d7428
  33:        0x1118aa956 - rustc::ty::context::tls::with_related_context::hdd58ffbc49aa25ac
  34:        0x1118dd2fe - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job::h03c2eff4fe067538
  35:        0x1119625fb - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query::h19ee2c093427d6f4
  36:        0x1140060a2 - <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_utils::codegen_backend::CodegenBackend>::codegen_crate::h2e345914ae3b3be2
  37:        0x10fdc9e96 - rustc::util::common::time::hedb17545a14fc19e
  38:        0x10fdbe449 - rustc_driver::driver::phase_4_codegen::h96264e40ca32b6e0
  39:        0x10fe4237f - rustc_driver::driver::compile_input::{{closure}}::h25827bf457e1ef39
  40:        0x10fe40ba2 - rustc::ty::context::tls::enter_context::h68d33c1fab936a57
  41:        0x10fdfdc8b - <std::thread::local::LocalKey<T>>::with::hdc92bb8c6dd355c7
  42:        0x10fe5ffd0 - rustc::ty::context::TyCtxt::create_and_enter::h506b011c3ccdd4de
  43:        0x10fdb7e36 - rustc_driver::driver::compile_input::h86bf6ff92f6192bb
  44:        0x10fe46fb2 - rustc_driver::run_compiler_with_pool::h30bb2b1a0187a441
  45:        0x10fda509a - <scoped_tls::ScopedKey<T>>::set::he575ba7defbef56e
  46:        0x10fe170d5 - syntax::with_globals::hf29c42cdb37f02de
  47:        0x10fda441a - <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h0e78a384ed94d772
  48:        0x11332279e - __rust_maybe_catch_panic
  49:        0x10fe4428e - rustc_driver::run::hbcb2eda324f678cc
  50:        0x10fe51c4d - rustc_driver::main::hb15a8f8813bab914
  51:        0x10fd3adf5 - std::rt::lang_start::{{closure}}::h658e37a47d5caf6e
  52:        0x113316257 - std::panicking::try::do_call::h9acf80638e52ec84
  53:        0x11332279e - __rust_maybe_catch_panic
  54:        0x1132f6d8c - std::rt::lang_start_internal::h60412e610ba9720a
  55:        0x10fd3ae5b - main
query stack during panic:
#0 [const_eval] const-evaluating `svm_class::m_csvm_linear`
#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.30.0-nightly (73c78734b 2018-08-05) running on x86_64-apple-darwin

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

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

error: Could not compile `ffsvm`.

Caused by:
  process didn't exit successfully: `rustc --edition=2018 --crate-name svm_class tests/svm_class.rs --emit=dep-info,link -C debuginfo=2 --test -C metadata=90de23b263b45bd4 -C extra-filename=-90de23b263b45bd4 --out-dir /Users/rb/Documents/Development/Source/ffsvm-rust/target/debug/deps -C incremental=/Users/rb/Documents/Development/Source/ffsvm-rust/target/debug/incremental -L dependency=/Users/rb/Documents/Development/Source/ffsvm-rust/target/debug/deps --extern ffsvm=/Users/rb/Documents/Development/Source/ffsvm-rust/target/debug/deps/libffsvm-834cad704ea3a49b.rlib --extern packed_simd=/Users/rb/Documents/Development/Source/ffsvm-rust/target/debug/deps/libpacked_simd-9c5bec2e1902d981.rlib --extern pest=/Users/rb/Documents/Development/Source/ffsvm-rust/target/debug/deps/libpest-7a901ee692ed4e10.rlib --extern pest_derive=/Users/rb/Documents/Development/Source/ffsvm-rust/target/debug/deps/libpest_derive-041426730142ad62.dylib --extern rand=/Users/rb/Documents/Development/Source/ffsvm-rust/target/debug/deps/librand-cdbc2f99eb873b42.rlib --extern simd_aligned=/Users/rb/Documents/Development/Source/ffsvm-rust/target/debug/deps/libsimd_aligned-7595223b10c560f3.rlib` (exit code: 101)

rustup update reports:

info: syncing channel updates for 'stable-x86_64-apple-darwin'
info: syncing channel updates for 'nightly-x86_64-apple-darwin'
info: checking for self-updates

   stable-x86_64-apple-darwin unchanged - rustc 1.28.0 (9634041f0 2018-07-30)
  nightly-x86_64-apple-darwin unchanged - rustc 1.30.0-nightly (73c78734b 2018-08-05)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlA-const-evalArea: Constant evaluation (MIR interpretation)C-bugCategory: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions