Skip to content

rustc panic: libsyntax/lib.rs: index out of bounds: the len is 61 but the index is 247 #20913

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

Closed
ajf opened this issue Jan 11, 2015 · 2 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@ajf
Copy link

ajf commented Jan 11, 2015

$ RUST_BACKTRACE=1 cargo test
   Compiling regex v0.1.10
   Compiling regex_macros v0.1.5
   Compiling plotter v0.0.1 (file:///Users/andrew/git/libplotter-rust)
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'index out of bounds: the len is 61 but the index is 247', /Users/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-mac/build/src/libsyntax/lib.rs:1

stack backtrace:
   1:        0x10b2524b5 - sys::backtrace::write::h64ca2fb259c4ae97lCt
   2:        0x10b27494f - failure::on_fail::h64ff5ae6887860cc0Hz
   3:        0x10b1e05ca - rt::unwind::begin_unwind_inner::h1d4bc098fd350446Qpz
   4:        0x10b1e07c4 - rt::unwind::begin_unwind_fmt::h2787666abdf9afbbnoz
   5:        0x10b2743be - rust_begin_unwind
   6:        0x10b2bf627 - panicking::panic_fmt::h147727a519895962pfl
   7:        0x10b2c8db1 - panicking::panic_bounds_check::h7f4dce76ef1e56a3qel
   8:        0x11b67d488 - util::interner::StrInterner::get::ha9c64a5684118022cqa
   9:        0x11b68a9c8 - ast::Name::as_str::h59668c74008d81d5CQb
  10:        0x11b7407ed - parse::parser::Parser<'a>::lit_from_token::hbf5030500dd119fatOK
  11:        0x11b744c03 - parse::parser::Parser<'a>::parse_lit::hdcc025c3b7cd024axSK
  12:        0x11b74971e - parse::parser::Parser<'a>::parse_bottom_expr::ha2664df4b03a3ed6BbL
  13:        0x11b74cab3 - parse::parser::Parser<'a>::parse_dot_or_call_expr::hbe0d8d40c61ea79fytL
  14:        0x11b74fdb6 - parse::parser::Parser<'a>::parse_prefix_expr::haea27a000f1d4221gQL
  15:        0x11b750193 - parse::parser::Parser<'a>::parse_binops::ha6c755070e3c6b58BWL
  16:        0x11b7507c3 - parse::parser::Parser<'a>::parse_assign_expr::h7da939d5e0adb6f1a1L
  17:        0x11b67f802 - parse::parser::Parser<'a>::parse_expr::h98ff7e711bf6dbacUeM
  18:        0x1169967ca - parse::h4a7f28cd74a858a1STe
  19:        0x1169960ff - native::hf56668b93453df4c3aa
  20:        0x11b06c440 - ext::base::F.TTMacroExpander::expand::h9755274305956037081
  21:        0x10906a625 - ext::expand::expand_expr::unboxed_closure.55815
  22:        0x109069b72 - ext::expand::expand_expr::h4823b5576ddbb90asSd
  23:        0x10901d5d7 - ext::expand::MacroExpander<'a, 'b>.Folder::fold_expr::h0d386cd2b9a9fb6aGVe
  24:        0x109072f21 - fold::noop_fold_expr::unboxed_closure.55879
  25:        0x10908851c - ext::expand::expand_non_macro_stmt::unboxed_closure.56104
  26:        0x109087a5d - ext::expand::expand_non_macro_stmt::unboxed_closure.56102
  27:        0x109086331 - ext::expand::expand_stmt::h5c75f021c3ff26faOue
  28:        0x1090877f7 - ext::expand::MacroExpander<'a, 'b>.Folder::fold_stmt::h56018a99a3d29580yXe
  29:        0x1090aee4f - ext::expand::expand_block_elts::unboxed_closure.56405
  30:        0x1090aed69 - option::Option<T>::map::h6631393528970113854
  31:        0x1090aea7b - vec::Vec<T>.FromIterator<T>::from_iter::h1786273657078117735
  32:        0x1090ade9c - ptr::P<T>::map::h4968813950356056212
  33:        0x1090adbcb - ext::expand::expand_block::h04844853f5b48176IEe
  34:        0x109073661 - ext::expand::expand_and_rename_fn_decl_and_block::hf593166bbd7e4fa7tTe
  35:        0x1090d0d19 - ptr::P<T>::and_then::h2557855331020783439
  36:        0x109082491 - ext::expand::MacroExpander<'a, 'b>.Folder::fold_method::hd8b42f33e6bc3181CYe
  37:        0x10907ab6a - ext::expand::expand_item_underscore::h95d78afeac10acfcAje
  38:        0x1090784de - fold::noop_fold_item_simple::h6478299046903735577
  39:        0x1090781ad - ptr::P<T>::map::h5396002592945969675
  40:        0x10907489c - ext::expand::expand_item::hbf1a39c4ad6c0eea4be
  41:        0x10907f212 - ext::expand::MacroExpander<'a, 'b>.Folder::fold_item::h22ac4da365d6867akWe
  42:        0x10907ef70 - fold::noop_fold_mod::unboxed_closure.55994
  43:        0x10907ef09 - option::Option<T>::map::h12796966290915212443
  44:        0x10907ec1b - vec::Vec<T>.FromIterator<T>::from_iter::h13783601339641917247
  45:        0x10907dbbc - fold::noop_fold_mod::h624287961893558278
  46:        0x109079cf2 - ext::expand::expand_item_underscore::h95d78afeac10acfcAje
  47:        0x1090784de - fold::noop_fold_item_simple::h6478299046903735577
  48:        0x1090781ad - ptr::P<T>::map::h5396002592945969675
  49:        0x109074b99 - ext::expand::expand_item::hbf1a39c4ad6c0eea4be
  50:        0x10907f212 - ext::expand::MacroExpander<'a, 'b>.Folder::fold_item::h22ac4da365d6867akWe
  51:        0x10907ef70 - fold::noop_fold_mod::unboxed_closure.55994
  52:        0x10907ef09 - option::Option<T>::map::h12796966290915212443
  53:        0x10907ec1b - vec::Vec<T>.FromIterator<T>::from_iter::h13783601339641917247
  54:        0x10907dbbc - fold::noop_fold_mod::h624287961893558278
  55:        0x109079cf2 - ext::expand::expand_item_underscore::h95d78afeac10acfcAje
  56:        0x1090784de - fold::noop_fold_item_simple::h6478299046903735577
  57:        0x1090781ad - ptr::P<T>::map::h5396002592945969675
  58:        0x109074b99 - ext::expand::expand_item::hbf1a39c4ad6c0eea4be
  59:        0x10907f212 - ext::expand::MacroExpander<'a, 'b>.Folder::fold_item::h22ac4da365d6867akWe
  60:        0x1090d482b - ext::expand::expand_crate::hb7274d563b739079B0e
  61:        0x107aa56af - driver::phase_2_configure_and_expand::unboxed_closure.18501
  62:        0x107a63eeb - driver::phase_2_configure_and_expand::h1a066e68344edf12Xja
  63:        0x107a553e7 - driver::compile_input::h31580cbd7ea87613xba
  64:        0x107b21fda - monitor::unboxed_closure.22557
  65:        0x107b20735 - thunk::F.Invoke<A, R>::invoke::h6367419564961841226
  66:        0x107b1f510 - rt::unwind::try::try_fn::h7763956589852599824
  67:        0x10b2db2a9 - rust_try_inner
  68:        0x10b2db296 - rust_try
  69:        0x107b1fc0c - thunk::F.Invoke<A, R>::invoke::h16724184168577887652
  70:        0x10b262154 - sys::thread::thread_start::hbd8f2f8bdd3a3baadrw
  71:     0x7fff8f4ad268 - _pthread_body
  72:     0x7fff8f4ad1e5 - _pthread_body

Build failed, waiting for other jobs to finish...

Versions:

$ rustc --version
rustc 1.0.0-nightly (44a287e6e 2015-01-08 17:03:40 -0800)
$ cargo --version
cargo 0.0.1-pre-nightly (8c01b6b 2015-01-08 20:52:43 +0000)

Minimal code (error is index out of bounds: the len is 61 but the index is 66):

#[plugin]
extern crate regex_macros;
extern crate regex;

static R : regex::Regex = regex!(r".+");

fn main() {
    println!("Hello, world!");
}

Cargo.toml:

[dependencies]
regex = "0.1.10"
regex_macros = "0.1.5"
log = "0.1.9"
@kmcallister kmcallister added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Jan 11, 2015
@tamird
Copy link
Contributor

tamird commented Apr 21, 2015

Unable to repro:

#![feature(plugin)]
#![plugin(regex_macros)]

extern crate regex;

static R : regex::Regex = regex!(r".+");

fn main() {
    println!("Hello, world!");
}

Compiles now.

Seems like the ICE was somewhere in regex-macros, and is now either fixed or worked around. @steveklabnik maybe close this? Doesn't look actionable.

@enginespot
Copy link

[package]
name = "hello_world"
version = "0.0.1"
authors = [ "Your name <you@example.com>" ]
[dependencies]
regex = "0.1.8"
regex_macros = "0.1.8"

the bug occur again

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 60 but the index is 66', ../src/libcollections/vec.rs:1263

stack backtrace:
   1:        0x10bb99b10 - sys::backtrace::write::hd55ab9ea9b602d10yws
   2:        0x10bba1d51 - panicking::on_panic::hd39d541ff0f0a91dzax
   3:        0x10bb65102 - rt::unwind::begin_unwind_inner::hfeb8eb2381958d15AFw
   4:        0x10bb65cf7 - rt::unwind::begin_unwind_fmt::hc97fa885aeb052d8GEw
   5:        0x10bba1947 - rust_begin_unwind
   6:        0x10bbed5f0 - panicking::panic_fmt::hed2a91b19970d30dqgC
   7:        0x10bbe89e0 - panicking::panic_bounds_check::h4b850c152f83bdddwfC
   8:        0x110f3be80 - parse::token::InternedString::new_from_name::h6ac50891a6d1538cqtT
   9:        0x110ffad9c - parse::parser::Parser<'a>::lit_from_token::h81e0338f54cfe402UVG
  10:        0x110fff3f4 - parse::parser::Parser<'a>::parse_lit::h2d3585ebb29b6419YZG
  11:        0x111005928 - parse::parser::Parser<'a>::parse_bottom_expr::h9eb11589d01302ca5uH
  12:        0x111009acd - parse::parser::Parser<'a>::parse_dot_or_call_expr::h7ea24d0d85e36381EYH
  13:        0x11100de7f - parse::parser::Parser<'a>::parse_prefix_expr::hb693898eab38ecadRrI
  14:        0x11100ee0d - parse::parser::Parser<'a>::parse_binops::h6468f59fda6455faICI
  15:        0x11100f80e - parse::parser::Parser<'a>::parse_assign_expr::h22b387af6ce7d486AII
  16:        0x110fdcbfc - parse::parser::Parser<'a>::parse_expr::ha1d1a094a9e8bc35ycF
  17:        0x10d4050b5 - parse::he2454624aa8950b9pfe
  18:        0x10d40487c - native::hf8fe1f594d820587Oaa
  19:        0x1109b8079 - ext::base::F.TTMacroExpander::expand::h1156222205761249190
  20:        0x1095bba8d - ext::expand::expand_expr::closure.67689
  21:        0x1095b5945 - ext::expand::expand_expr::he7f631e2a6756354Qsb
  22:        0x1095ce61d - ext::expand::expand_item_underscore::hf4ad7058627d3835mZb
  23:        0x109621cea - fold::noop_fold_item_simple::h12659161660526533640
  24:        0x109621879 - fold::noop_fold_item::h10847006839623481285
  25:        0x1095cbf77 - ext::expand::expand_annotatable::h5607d1f88b990a30Tvc
  26:        0x1095c78ec - ext::expand::expand_item::h055bf60ae8164737LYb
  27:        0x1095d4435 - iter::FlatMap<I, U, F>.Iterator::next::h12186547700541527931
  28:        0x1095d3f6c - vec::Vec<T>.FromIterator<T>::from_iter::h1052554477831759431
  29:        0x1095d3c9a - fold::noop_fold_mod::h6045941732705183073
  30:        0x1095cea76 - ext::expand::expand_item_underscore::hf4ad7058627d3835mZb
  31:        0x109621cea - fold::noop_fold_item_simple::h12659161660526533640
  32:        0x109621879 - fold::noop_fold_item::h10847006839623481285
  33:        0x1095ccbad - ext::expand::expand_annotatable::h5607d1f88b990a30Tvc
  34:        0x1095c78ec - ext::expand::expand_item::h055bf60ae8164737LYb
  35:        0x10962bdd0 - ext::expand::expand_crate::h79ff848875ed4ca0KZc
  36:        0x1080b60d3 - driver::phase_2_configure_and_expand::closure.26217
  37:        0x10806bda0 - driver::phase_2_configure_and_expand::h7db94f2f6299002cita
  38:        0x10805cafb - driver::compile_input::h2dcf2542220faeb3Tba
  39:        0x10813b09e - run_compiler::h4f62e6aa9c953a9fC7b
  40:        0x108138c8b - boxed::F.FnBox<A>::call_box::h16801768484572870575
  41:        0x1081385e2 - rt::unwind::try::try_fn::h15641500112529980395
  42:        0x10bba18f8 - __rust_try
  43:        0x10bb8da60 - rt::unwind::try::inner_try::h919d558e288762e9tBw
  44:        0x1081387a2 - boxed::F.FnBox<A>::call_box::h12543525262198032502
  45:        0x10bba0bad - sys::thread::Thread::new::thread_start::hb70673fe9975221bOZv
  46:     0x7fff8dd3a267 - _pthread_body
  47:     0x7fff8dd3a1e4 - _pthread_start

Could not compile `hello_world`.

rustc version
rustc 1.4.0-nightly (5aca49c 2015-08-10)

cargo version
cargo 0.4.0-nightly (c033770 2015-08-09) (built 2015-08-09)

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) ❄️
Projects
None yet
Development

No branches or pull requests

5 participants