Skip to content

thread 'rustc' panicked at 'index out of bounds: the len is 60 but the index is 66', ../src/libcollections/vec.rs:1040 #27848

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
enginespot opened this issue Aug 15, 2015 · 9 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@enginespot
Copy link

the error reproduced #20913

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

extern crate regex;

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

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

Cargo.toml

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

'''
RUST_BACKTRACE=1 cargo build
   Compiling regex-syntax v0.2.1
   Compiling libc v0.1.8
   Compiling memchr v0.1.3
   Compiling aho-corasick v0.3.0
   Compiling regex v0.1.41
   Compiling regex_macros v0.1.21
   Compiling hello_world v0.0.1 (file:///Users/edwin/Desktop/outofround)
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:1040

stack backtrace:
   1:        0x103ef0f50 - sys::backtrace::write::h06479201c280533dX8r
   2:        0x103ef8ff1 - panicking::on_panic::h708366cd9af58c5eeLw
   3:        0x103ebcd42 - rt::unwind::begin_unwind_inner::h3d24f7ebda310c3ergw
   4:        0x103ebdad7 - rt::unwind::begin_unwind_fmt::h390e14ebe566c38cxfw
   5:        0x103ef8be7 - rust_begin_unwind
   6:        0x103f3c790 - panicking::panic_fmt::h4d9c502ae8b21c5c41D
   7:        0x103f36890 - panicking::panic_bounds_check::h541f99073d46b27fa1D
   8:        0x108cd55e0 - parse::token::InternedString::new_from_name::h2118f79f5b2c5ff47uT
   9:        0x108d9401c - parse::parser::Parser<'a>::lit_from_token::h5e63eff71b0f496cBXG
  10:        0x108d98674 - parse::parser::Parser<'a>::parse_lit::h523e95e14437ffebF1G
  11:        0x108d9eba8 - parse::parser::Parser<'a>::parse_bottom_expr::h7354ec39bb561768MwH
  12:        0x108da2d4d - parse::parser::Parser<'a>::parse_dot_or_call_expr::h9bd3d87b8df34dbbl0H
  13:        0x108da70ff - parse::parser::Parser<'a>::parse_prefix_expr::h866df018931bf521ytI
  14:        0x108da808d - parse::parser::Parser<'a>::parse_binops::h2cda77ab17aa15f5pEI
  15:        0x108da8a8e - parse::parser::Parser<'a>::parse_assign_expr::h8c7c5e5fe0c2ab9ehKI
  16:        0x108d75e7c - parse::parser::Parser<'a>::parse_expr::hd848c168e2afac06feF
  17:        0x1081120b5 - parse::hdcfa6cf9ed309efdpfe
  18:        0x10811187c - native::h07acbd776b19d433Oaa
  19:        0x10874f699 - ext::base::F.TTMacroExpander::expand::h8908149877291271609
  20:        0x101915613 - ext::expand::expand_expr::closure.67387
  21:        0x10190f4a5 - ext::expand::expand_expr::h7b5890896e16ac04xub
  22:        0x101926994 - ext::expand::expand_item_underscore::h1f92daaaefce98b920b
  23:        0x10197b5aa - fold::noop_fold_item_simple::h16842886341315843757
  24:        0x10197b139 - fold::noop_fold_item::h15896533011605023666
  25:        0x1019242e7 - ext::expand::expand_annotatable::h5ce15f3070d97e0bzxc
  26:        0x10191fc5c - ext::expand::expand_item::he31229fb52bb2447r0b
  27:        0x10192c715 - iter::FlatMap<I, U, F>.Iterator::next::h2562911406533808273
  28:        0x10192c24c - vec::Vec<T>.FromIterator<T>::from_iter::h8778905134923064386
  29:        0x10192bf7a - fold::noop_fold_mod::h8378389276969869859
  30:        0x101926d47 - ext::expand::expand_item_underscore::h1f92daaaefce98b920b
  31:        0x10197b5aa - fold::noop_fold_item_simple::h16842886341315843757
  32:        0x10197b139 - fold::noop_fold_item::h15896533011605023666
  33:        0x101924f1d - ext::expand::expand_annotatable::h5ce15f3070d97e0bzxc
  34:        0x10191fc5c - ext::expand::expand_item::he31229fb52bb2447r0b
  35:        0x101985690 - ext::expand::expand_crate::h6e83998778bd1651q1c
  36:        0x100402783 - driver::phase_2_configure_and_expand::closure.26008
  37:        0x1003b83c0 - driver::phase_2_configure_and_expand::h437db8579a2dc2e5ita
  38:        0x1003a8fcb - driver::compile_input::hd814df6f8348abfeTba
  39:        0x100487a4e - run_compiler::h283a07bbfde37a6dC7b
  40:        0x10048563b - boxed::F.FnBox<A>::call_box::h14577586819962330318
  41:        0x100484f92 - rt::unwind::try::try_fn::h5552038356682966148
  42:        0x103ef8b98 - __rust_try
  43:        0x103ee52f0 - rt::unwind::try::inner_try::h315b50009a67cb2ckcw
  44:        0x100485152 - boxed::F.FnBox<A>::call_box::h14301902851584304785
  45:        0x103ef7e4d - sys::thread::Thread::new::thread_start::h179ff9c79ff58b662Av
  46:     0x7fff9acba059 - _pthread_body
  47:     0x7fff9acb9fd6 - _pthread_start

Could not compile `hello_world`.

To learn more, run the command again with --verbose.
@jdm jdm added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Aug 15, 2015
@nerdrew
Copy link

nerdrew commented Sep 22, 2015

With:

% ./x86_64-apple-darwin/stage2/bin/rustc --version
rustc 1.5.0-nightly (2a6f6f26f 2015-09-22)

I get this error instead:

       Fresh libc v0.1.10
       Fresh regex-syntax v0.2.2
       Fresh memchr v0.1.6
       Fresh aho-corasick v0.3.2
       Fresh regex v0.1.41
   Compiling bad-rust-plugin v0.1.0 (file:///Users/lazarus/dev/tmp/bad-rust-plugin)
     Running `./x86_64-apple-darwin/stage2/bin/rustc /Users/lazarus/dev/tmp/bad-rust-plugin/src/main.rs --crate-name bad_rust_plugin --crate-type bin -g --out-dir /Users/lazarus/dev/tmp/bad-rust-plugin/target/debug --emit=dep-info,link -L dependency=/Users/lazarus/dev/tmp/bad-rust-plugin/target/debug -L dependency=/Users/lazarus/dev/tmp/bad-rust-plugin/target/debug/deps --extern regex_macros=/Users/lazarus/dev/tmp/bad-rust-plugin/target/debug/deps/libregex_macros-ed47cfffdeca22b7.dylib --extern regex=/Users/lazarus/dev/tmp/bad-rust-plugin/target/debug/deps/libregex-c5abedf84fe61ddb.rlib`
       Fresh regex_macros v0.1.21
/Users/lazarus/dev/tmp/bad-rust-plugin/src/main.rs:6:26: 6:31 error: macro undefined: 'regex!'
/Users/lazarus/dev/tmp/bad-rust-plugin/src/main.rs:6 static R: regex::Regex = regex!("boom");
                                                                              ^~~~~
error: aborting due to previous error
Could not compile `bad-rust-plugin`.

Caused by:
  Process didn't exit successfully: `./x86_64-apple-darwin/stage2/bin/rustc /Users/lazarus/dev/tmp/bad-rust-plugin/src/main.rs --crate-name bad_rust_plugin --crate-type bin -g --out-dir /Users/lazarus/dev/tmp/bad-rust-plugin/target/debug --emit=dep-info,link -L dependency=/Users/lazarus/dev/tmp/bad-rust-plugin/target/debug -L dependency=/Users/lazarus/dev/tmp/bad-rust-plugin/target/debug/deps --extern regex_macros=/Users/lazarus/dev/tmp/bad-rust-plugin/target/debug/deps/libregex_macros-ed47cfffdeca22b7.dylib --extern regex=/Users/lazarus/dev/tmp/bad-rust-plugin/target/debug/deps/libregex-c5abedf84fe61ddb.rlib` (exit code: 101)

@apasel422
Copy link
Contributor

I can't reproduce this on nightly.

@alexcrichton
Copy link
Member

Yay!

@nerdrew
Copy link

nerdrew commented Sep 28, 2015

Still ICE's for me.

% cat Cargo.toml
[package]
name = "bad-rust-plugin"
version = "0.1.0"
authors = ["Andrew Lazarus <lazarus@squareup.com>"]

[dependencies]
regex = "*"
regex_macros = "*"
% cat src/main.rs
#![feature(plugin)]
#![plugin(regex_macros)]

extern crate regex;

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

fn main() {
    println!("Hello, world!");
}
% cargo build --verbose
    Updating registry `https://github.com/rust-lang/crates.io-index`
   Compiling libc v0.1.10
     Running `rustc /Users/lazarus/.cargo/registry/src/github.com-0a35038f75765ae4/libc-0.1.10/rust/src/liblibc/lib.rs --crate-name libc --crate-type lib -g --cfg feature=\"default\" --cfg feature=\"cargo-build\" -C metadata=144c435538abd757 -C extra-filename=-144c435538abd757 --out-dir /Users/lazarus/dev/tmp/bad-rust-plugin/target/debug/deps --emit=dep-info,link -L dependency=/Users/lazarus/dev/tmp/bad-rust-plugin/target/debug/deps -L dependency=/Users/lazarus/dev/tmp/bad-rust-plugin/target/debug/deps --cap-lints allow`
   Compiling regex-syntax v0.2.2
     Running `rustc /Users/lazarus/.cargo/registry/src/github.com-0a35038f75765ae4/regex-syntax-0.2.2/src/lib.rs --crate-name regex_syntax --crate-type lib -g -C metadata=6d9e9f3bd76497d4 -C extra-filename=-6d9e9f3bd76497d4 --out-dir /Users/lazarus/dev/tmp/bad-rust-plugin/target/debug/deps --emit=dep-info,link -L dependency=/Users/lazarus/dev/tmp/bad-rust-plugin/target/debug/deps -L dependency=/Users/lazarus/dev/tmp/bad-rust-plugin/target/debug/deps --cap-lints allow`
   Compiling memchr v0.1.6
     Running `rustc /Users/lazarus/.cargo/registry/src/github.com-0a35038f75765ae4/memchr-0.1.6/src/lib.rs --crate-name memchr --crate-type lib -g -C metadata=1ef94c8f78e37fc7 -C extra-filename=-1ef94c8f78e37fc7 --out-dir /Users/lazarus/dev/tmp/bad-rust-plugin/target/debug/deps --emit=dep-info,link -L dependency=/Users/lazarus/dev/tmp/bad-rust-plugin/target/debug/deps -L dependency=/Users/lazarus/dev/tmp/bad-rust-plugin/target/debug/deps --extern libc=/Users/lazarus/dev/tmp/bad-rust-plugin/target/debug/deps/liblibc-144c435538abd757.rlib --cap-lints allow`
   Compiling aho-corasick v0.3.2
     Running `rustc /Users/lazarus/.cargo/registry/src/github.com-0a35038f75765ae4/aho-corasick-0.3.2/src/lib.rs --crate-name aho_corasick --crate-type lib -g -C metadata=4235a5ba781fe1b1 -C extra-filename=-4235a5ba781fe1b1 --out-dir /Users/lazarus/dev/tmp/bad-rust-plugin/target/debug/deps --emit=dep-info,link -L dependency=/Users/lazarus/dev/tmp/bad-rust-plugin/target/debug/deps -L dependency=/Users/lazarus/dev/tmp/bad-rust-plugin/target/debug/deps --extern memchr=/Users/lazarus/dev/tmp/bad-rust-plugin/target/debug/deps/libmemchr-1ef94c8f78e37fc7.rlib --cap-lints allow`
   Compiling regex v0.1.41
     Running `rustc /Users/lazarus/.cargo/registry/src/github.com-0a35038f75765ae4/regex-0.1.41/src/lib.rs --crate-name regex --crate-type lib -g --cfg feature=\"pattern\" -C metadata=c5abedf84fe61ddb -C extra-filename=-c5abedf84fe61ddb --out-dir /Users/lazarus/dev/tmp/bad-rust-plugin/target/debug/deps --emit=dep-info,link -L dependency=/Users/lazarus/dev/tmp/bad-rust-plugin/target/debug/deps -L dependency=/Users/lazarus/dev/tmp/bad-rust-plugin/target/debug/deps --extern aho_corasick=/Users/lazarus/dev/tmp/bad-rust-plugin/target/debug/deps/libaho_corasick-4235a5ba781fe1b1.rlib --extern memchr=/Users/lazarus/dev/tmp/bad-rust-plugin/target/debug/deps/libmemchr-1ef94c8f78e37fc7.rlib --extern regex_syntax=/Users/lazarus/dev/tmp/bad-rust-plugin/target/debug/deps/libregex_syntax-6d9e9f3bd76497d4.rlib --cap-lints allow`
   Compiling regex_macros v0.1.21
     Running `rustc /Users/lazarus/.cargo/registry/src/github.com-0a35038f75765ae4/regex_macros-0.1.21/src/lib.rs --crate-name regex_macros --crate-type dylib -C prefer-dynamic -g -C metadata=ed47cfffdeca22b7 -C extra-filename=-ed47cfffdeca22b7 --out-dir /Users/lazarus/dev/tmp/bad-rust-plugin/target/debug/deps --emit=dep-info,link -L dependency=/Users/lazarus/dev/tmp/bad-rust-plugin/target/debug/deps -L dependency=/Users/lazarus/dev/tmp/bad-rust-plugin/target/debug/deps --extern regex=/Users/lazarus/dev/tmp/bad-rust-plugin/target/debug/deps/libregex-c5abedf84fe61ddb.rlib --cap-lints allow`
   Compiling bad-rust-plugin v0.1.0 (file:///Users/lazarus/dev/tmp/bad-rust-plugin)
     Running `rustc src/main.rs --crate-name bad_rust_plugin --crate-type bin -g --out-dir /Users/lazarus/dev/tmp/bad-rust-plugin/target/debug --emit=dep-info,link -L dependency=/Users/lazarus/dev/tmp/bad-rust-plugin/target/debug -L dependency=/Users/lazarus/dev/tmp/bad-rust-plugin/target/debug/deps --extern regex=/Users/lazarus/dev/tmp/bad-rust-plugin/target/debug/deps/libregex-c5abedf84fe61ddb.rlib --extern regex_macros=/Users/lazarus/dev/tmp/bad-rust-plugin/target/debug/deps/libregex_macros-ed47cfffdeca22b7.dylib`
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: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'index out of bounds: the len is 60 but the index is 66', ../src/libcollections/vec.rs:1037

Could not compile `bad-rust-plugin`.

Caused by:
  Process didn't exit successfully: `rustc src/main.rs --crate-name bad_rust_plugin --crate-type bin -g --out-dir /Users/lazarus/dev/tmp/bad-rust-plugin/target/debug --emit=dep-info,link -L dependency=/Users/lazarus/dev/tmp/bad-rust-plugin/target/debug -L dependency=/Users/lazarus/dev/tmp/bad-rust-plugin/target/debug/deps --extern regex=/Users/lazarus/dev/tmp/bad-rust-plugin/target/debug/deps/libregex-c5abedf84fe61ddb.rlib --extern regex_macros=/Users/lazarus/dev/tmp/bad-rust-plugin/target/debug/deps/libregex_macros-ed47cfffdeca22b7.dylib` (exit code: 101)
% rustc --version
rustc 1.5.0-nightly (219eca11b 2015-09-27)
% cargo --version
cargo 0.6.0-nightly (c76e9d1 2015-09-26)

@apasel422
Copy link
Contributor

This might be OSX-specific, then. I can't reproduce on Ubuntu with the same rustc and cargo versions.

@nerdrew
Copy link

nerdrew commented Sep 28, 2015

Ya, seems probable based on some of the other open issues: #28089, #27271

@enginespot
Copy link
Author

@apasel422 , Yes , the bug reproduced on my OS X Yosemite 10.10.5

@nerdrew
Copy link

nerdrew commented Dec 15, 2015

@enginespot Did you repro using a homebrew installed version of rust?

@enginespot
Copy link
Author

yes

I use homebrew

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