Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICE on rustc 1.34.0-nightly (633d75ac1 2019-02-21): index out of bounds #58634

Closed
niklasad1 opened this issue Feb 22, 2019 · 6 comments · Fixed by #58784
Closed

ICE on rustc 1.34.0-nightly (633d75ac1 2019-02-21): index out of bounds #58634

niklasad1 opened this issue Feb 22, 2019 · 6 comments · Fixed by #58784
Assignees
Labels
A-const-eval Area: Constant evaluation, covers all const contexts (static, const fn, ...) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@niklasad1
Copy link

niklasad1 commented Feb 22, 2019

ICE when compiling parity-ethereum

➜  parity-ethereum git:(master) ✗ cargo build
   Compiling ethcore-miner v1.12.0 (...parity-ethereum/miner)
thread 'rustc' panicked at 'index out of bounds: the len is 2 but the index is 3', /rustc/633d75ac17fa1a1bdaf5923895e6d5b7f3040c92/src/libcore/slice/mod.rs:2539:10
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:70
   2: std::panicking::default_hook::{{closure}}
             at src/libstd/sys_common/backtrace.rs:58
             at src/libstd/panicking.rs:200
   3: std::panicking::default_hook
             at src/libstd/panicking.rs:215
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:482
   6: std::panicking::continue_panic_fmt
             at src/libstd/panicking.rs:385
   7: rust_begin_unwind
             at src/libstd/panicking.rs:312
   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_target::abi::TyLayout<'a, Ty>>::field
  11: rustc_mir::interpret::operand::<impl rustc_mir::interpret::eval_context::EvalContext<'a, 'mir, 'tcx, M>>::operand_field
  12: rustc_mir::interpret::operand::<impl rustc_mir::interpret::eval_context::EvalContext<'a, 'mir, 'tcx, M>>::eval_place_to_op
  13: rustc_mir::interpret::step::<impl rustc_mir::interpret::eval_context::EvalContext<'a, 'mir, 'tcx, M>>::run
  14: rustc_mir::const_eval::eval_body_using_ecx
  15: rustc_mir::const_eval::const_eval_raw_provider
  16: rustc::ty::query::__query_compute::const_eval_raw
  17: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::const_eval_raw<'tcx>>::compute
  18: rustc::dep_graph::graph::DepGraph::with_task_impl
  19: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
  20: rustc_mir::const_eval::const_eval_provider
  21: rustc::ty::query::__query_compute::const_eval
  22: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::const_eval<'tcx>>::compute
  23: rustc::dep_graph::graph::DepGraph::with_task_impl
  24: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
  25: rustc_mir::const_eval::const_eval_provider
  26: rustc::ty::query::__query_compute::const_eval
  27: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::const_eval<'tcx>>::compute
  28: rustc::dep_graph::graph::DepGraph::with_task_impl
  29: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
  30: rustc_mir::monomorphize::collector::collect_items_rec
  31: rustc_mir::monomorphize::collector::collect_crate_mono_items::{{closure}}
  32: rustc::util::common::time
  33: rustc_mir::monomorphize::collector::collect_crate_mono_items
  34: rustc::util::common::time
  35: rustc_mir::monomorphize::partitioning::collect_and_partition_mono_items
  36: rustc::ty::query::__query_compute::collect_and_partition_mono_items
  37: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::collect_and_partition_mono_items<'tcx>>::compute
  38: rustc::dep_graph::graph::DepGraph::with_task_impl
  39: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
  40: rustc_codegen_ssa::back::symbol_export::exported_symbols_provider_local
  41: rustc::ty::query::__query_compute::exported_symbols
  42: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::exported_symbols<'tcx>>::compute
  43: rustc::dep_graph::graph::DepGraph::with_task_impl
  44: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
  45: rustc_metadata::encoder::encode_metadata
  46: rustc_metadata::cstore_impl::<impl rustc::middle::cstore::CrateStore for rustc_metadata::cstore::CStore>::encode_metadata
  47: rustc::ty::context::TyCtxt::encode_metadata
  48: rustc_codegen_llvm::base::write_metadata
  49: rustc::util::common::time
  50: rustc_codegen_ssa::base::codegen_crate
  51: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_utils::codegen_backend::CodegenBackend>::codegen_crate
  52: rustc::util::common::time
  53: rustc_driver::driver::phase_4_codegen
  54: rustc_driver::driver::compile_input::{{closure}}
  55: <std::thread::local::LocalKey<T>>::with
  56: rustc::ty::context::TyCtxt::create_and_enter
  57: rustc_driver::driver::compile_input
  58: rustc_driver::run_compiler_with_pool
  59: <scoped_tls::ScopedKey<T>>::set
  60: rustc_driver::run_compiler
  61: syntax::with_globals
  62: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:87
  63: <F as alloc::boxed::FnBox<A>>::call_box
  64: std::sys::unix::thread::Thread::new::thread_start
             at /rustc/633d75ac17fa1a1bdaf5923895e6d5b7f3040c92/src/liballoc/boxed.rs:749
             at src/libstd/sys_common/thread.rs:14
             at src/libstd/sys/unix/thread.rs:81
  65: start_thread
  66: __clone
query stack during panic:
#0 [const_eval_raw] const-evaluating `message::Message::create`
#1 [const_eval] const-evaluating + checking `message::Message::create`
#2 [const_eval] const-evaluating + checking `message::Message::create`
#3 [collect_and_partition_mono_items] collect_and_partition_mono_items
#4 [exported_symbols] exported_symbols
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.34.0-nightly (633d75ac1 2019-02-21) running on x86_64-unknown-linux-gnu

note: compiler flags: -C debuginfo=2 -C incremental --crate-type lib

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

error: Could not compile `parity-whisper`.
warning: build failed, waiting for other jobs to finish...
error: build failed
@Centril Centril added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ A-const-eval Area: Constant evaluation, covers all const contexts (static, const fn, ...) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 22, 2019
@Centril
Copy link
Contributor

Centril commented Feb 22, 2019

cc @oli-obk @RalfJung

@oli-obk
Copy link
Contributor

oli-obk commented Feb 22, 2019

Is this a regression? Did it work with a previous nightly?

I'm currently looking through Message::create function (the ICE is during the evaluation of a promoted inside that function), but I can't find any promoteds 😕

@oli-obk
Copy link
Contributor

oli-obk commented Feb 22, 2019

I can't debug this right now, because a debugging compiler fails even earlier: #58638

@oli-obk
Copy link
Contributor

oli-obk commented Feb 22, 2019

So apparently

	pub fn create(params: CreateParams) -> Result<Self, EmptyTopics> {
		&Duration::from_millis(params.work);
		unimplemented!()
	}

still causes the ICE, but only inside the whisper crate. If I try to create an MCVE everything compiles just fine... Very confusing.

@oli-obk oli-obk self-assigned this Feb 23, 2019
@oli-obk oli-obk added regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. regression-from-stable-to-beta Performance or correctness regression from stable to beta. labels Feb 28, 2019
@pnkfelix
Copy link
Member

triage: P-high. Looks to be in good hands.

@pnkfelix pnkfelix added the P-high High priority label Feb 28, 2019
bors added a commit that referenced this issue Mar 10, 2019
Don't promote function calls to nonpromotable things

fixes #58767 and fixes #58634

r? @eddyb

should we additionally check the function call return type? It might be a promotable function (or any `const fn` inside a `const fn`), but its return type might contain interior mutability.
bors added a commit that referenced this issue Mar 11, 2019
Don't promote function calls to nonpromotable things

fixes #58767 and fixes #58634

r? @eddyb

should we additionally check the function call return type? It might be a promotable function (or any `const fn` inside a `const fn`), but its return type might contain interior mutability.
@niklasad1
Copy link
Author

Thanks, I can verify that it is fixed in rustc 1.35.0-nightly (e68bf8ae1 2019-03-11)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-eval Area: Constant evaluation, covers all const contexts (static, const fn, ...) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants