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: index out of bounds #32320

Closed
strega-nil opened this issue Mar 17, 2016 · 4 comments
Closed

ICE: index out of bounds #32320

strega-nil opened this issue Mar 17, 2016 · 4 comments
Assignees
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@strega-nil
Copy link
Contributor

   Compiling pinkc v0.1.0 (file:///Users/ubsan/src/workspace/rust/pink)
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
thread 'rustc' panicked at 'index out of bounds: the len is 15 but the index is 17', ../src/libcollections/vec.rs:1179
stack backtrace:
   1:        0x10c8de518 - sys::backtrace::tracing::imp::write::hd929d4e27d7189acGvv
   2:        0x10c8e7979 - panicking::default_handler::_$u7b$$u7b$closure$u7d$$u7d$::closure.44460
   3:        0x10c8e7497 - panicking::default_handler::h323e24f308b387b4U6z
   4:        0x10c8ac576 - sys_common::unwind::begin_unwind_inner::h3bfd460d0d96a1d2suu
   5:        0x10c8ad06e - sys_common::unwind::begin_unwind_fmt::he7cb7c739b04da34ytu
   6:        0x10c8dbdd7 - rust_begin_unwind
   7:        0x10c920c20 - panicking::panic_fmt::h8917bddd72ecec2e7mM
   8:        0x10c920e30 - panicking::panic_bounds_check::h93a3522a76b40c57dmM
   9:        0x10931b9e0 - middle::infer::InferCtxt<'a, 'tcx>::shallow_resolve::hd3812351ab4bfbe02jE
  10:        0x1093f59eb - middle::traits::fulfill::process_predicate::h825292a03af2b183FnU
  11:        0x1093f47d3 - obligation_forest::ObligationForest<O, T>::process_obligations::h12431531188540138369
  12:        0x1093efebc - middle::traits::fulfill::FulfillmentContext<'tcx>::select_where_possible::hdd4f708f72da3cd5KfU
  13:        0x1086a6694 - check::FnCtxt<'a, 'tcx>::select_obligations_where_possible::hb66eedf8825bdea3VIq
  14:        0x1086ba14c - check::FnCtxt<'a, 'tcx>::resolve_type_vars_if_possible::h71a8db5364f9d703jPp
  15:        0x1086d052a - check::demand::coerce::h246de84530e7134eWCf
  16:        0x1086cdf30 - check::check_argument_types::h1700393ff797f022T8q
  17:        0x1087483cd - check::callee::confirm_builtin_call::hc9f0878ba333a19fNkm
  18:        0x1086e6cb6 - check::callee::check_call::hd35b84bf2d6b58f7Sbm
  19:        0x1086d178a - check::check_expr_with_expectation_and_lvalue_pref::he337646483dc09cd8Hr
  20:        0x1087014bd - check::check_decl_initializer::h4ab29c1087c52ea8RUs
  21:        0x108701590 - check::check_decl_local::he9d8dbcafd84118f3Vs
  22:        0x108701825 - check::check_stmt::h9f0320269d23967cNXs
  23:        0x1086acd1a - check::check_block_with_expected::h8b413e75ec65de5eA1s
  24:        0x1086a3688 - check::check_fn::h3fd8a6bec4190345XWo
  25:        0x1086a0d6f - check::check_bare_fn::h245a5fd39660f1ecqMo
  26:        0x1086b1daa - check::check_method_body::he0085f6ddf3109464mp
  27:        0x10869bda9 - check::check_item_body::hb2b3af44521a0307Xbp
  28:        0x108694928 - check::check_item_bodies::h756f6be30ffaa021dKo
  29:        0x10868c405 - check_crate::h288f4573dd9eece3IGC
  30:        0x1084135b1 - driver::phase_3_run_analysis_passes::_$u7b$$u7b$closure$u7d$$u7d$::closure.29921
  31:        0x108411be9 - middle::ty::context::TyCtxt<'tcx>::create_and_enter::h14982197898393062399
  32:        0x10840e5ad - driver::phase_3_run_analysis_passes::h10469946015979689481
  33:        0x1083e178e - driver::compile_input::hfe917584d5fff413Pca
  34:        0x1083cedb7 - run_compiler::h01319ef2912a48felQc
  35:        0x1083cc462 - sys_common::unwind::try::try_fn::h5286116259890539823
  36:        0x10c8dbd6b - __rust_try
  37:        0x10c8dbcf3 - sys_common::unwind::inner_try::hab8f8e132b20c6f3uru
  38:        0x1083cccf9 - boxed::F.FnBox<A>::call_box::h2979158220400435295
  39:        0x10c8e67ec - sys::thread::Thread::new::thread_start::h78b200bc5c33e143Rkz
  40:     0x7fff89c0bc12 - _pthread_body
  41:     0x7fff89c0bb8f - _pthread_start

Could not compile `pinkc`.

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

compiling this crate: https://github.com/ubsan/pink/tree/c625d31661e3381f5173d2789ff4c8d809210d2f

@strega-nil
Copy link
Contributor Author

The issue is on src/ast/expr.rs:172. I make a new Vec, instead of a new HashMap.

@strega-nil
Copy link
Contributor Author

Ping @nikomatsakis, because it seems to be a bug in the Forest of Obligation

@sanxiyn sanxiyn added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Mar 18, 2016
@nikomatsakis nikomatsakis added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Mar 18, 2016
@nikomatsakis
Copy link
Contributor

triage: P-medium

@allan-simon
Copy link

an other code that seems to trigger the same ICE http://is.gd/bZ6QYu

arielb1 pushed a commit to arielb1/rust that referenced this issue May 24, 2016
Refactor `FnCtxt::autoderef` to use an external iterator and to not
register any obligation from the main autoderef loop, but rather to
register them after (and if) the loop successfully completes.

Fixes rust-lang#24819
Fixes rust-lang#25801
Fixes rust-lang#27631
Fixes rust-lang#31258
Fixes rust-lang#31964
Fixes rust-lang#32320
Fixes rust-lang#33515
Fixes rust-lang#33755
Manishearth added a commit to Manishearth/rust that referenced this issue May 28, 2016
refactor autoderef to avoid prematurely registering obligations

Refactor `FnCtxt::autoderef` to use an external iterator and to not
register any obligation from the main autoderef loop, but rather to
register them after (and if) the loop successfully completes.

Fixes rust-lang#24819
Fixes rust-lang#25801
Fixes rust-lang#27631
Fixes rust-lang#31258
Fixes rust-lang#31964
Fixes rust-lang#32320
Fixes rust-lang#33515
Fixes rust-lang#33755

r? @eddyb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants