Skip to content

ICE index out of bounds: the len is 1 but the index is 1 #15608

@tomaka

Description

@tomaka

I get an ICE when compiling the lib.rs file here (warning: there's a lot of code).

The code was compiling perfectly, then I added some template parameters to types and traits that are being used almost everywhere, and after updating everything I have this ICE (the diff is here). I don't even know where to start if I had to simplify the case.

error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. 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
task 'rustc' failed at 'index out of bounds: the len is 1 but the index is 1', C:\bot\slave\nightly-win\build\src\librustc\middle\subst.rs:405

I'm using today's nightly (rustc 0.11.0-nightly (b57d272e9908e164a72bd1a688141031705e1208 2014-07-11 01:11:36 +0000) and I'm on Windows 7.

Here is the stack trace:

Breakpoint 1, 0x61f882a0 in rust_fail ()
   from C:\Compilation\Rust\bin\rustrt-4e7c5e5c.dll
(gdb) bt
#0  0x61f882a0 in rust_fail ()
   from C:\Compilation\Rust\bin\rustrt-4e7c5e5c.dll
#1  0x61f88b31 in unwind::begin_unwind_inner::hd5b74d0d9af0059cmId ()
   from C:\Compilation\Rust\bin\rustrt-4e7c5e5c.dll
#2  0x61f8863d in unwind::begin_unwind_fmt::h8fcff7e668106e5aPFd ()
   from C:\Compilation\Rust\bin\rustrt-4e7c5e5c.dll
#3  0x61f8846e in rust_begin_unwind ()
   from C:\Compilation\Rust\bin\rustrt-4e7c5e5c.dll
#4  0x61fd1018 in failure::begin_unwind::h5a3f5688938f2a07pqj ()
   from C:\Compilation\Rust\bin\rustrt-4e7c5e5c.dll
#5  0x61fd544f in failure::fail_bounds_check::h60523e43493e41dfBoj ()
   from C:\Compilation\Rust\bin\rustrt-4e7c5e5c.dll
#6  0x70f7d1dd in middle::ty_fold::ty..Region.TypeFoldable::fold_with::h16433011
332248510048 () from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#7  0x70f7d083 in middle::ty_fold::VecPerParamSpace$LT$T$GT$.TypeFoldable::fold_
with::closure.Name$LP$97406$RP$ ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#8  0x70f7be80 in _fu4272___ZN3vec10PTR_MARKER20h2f6eaa45629a18b5TDhE ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#9  0x70f7bc74 in middle::ty_fold::TypeFolder::fold_substs::h1698835327014201925
7 () from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#10 0x710df7b0 in middle::subst::T.Subst::subst_spanned::h10575283722499378383
    () from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#11 0x7119ddae in _fu1548___ZN9LOG_LEVEL20h8fa6e58be0a929cajiaE ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#12 0x710cdeba in _fu1402___ZN9LOG_LEVEL20h8fa6e58be0a929cajiaE ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#13 0x7119d74d in _fu4692___ZN3vec10PTR_MARKER20h2f6eaa45629a18b5TDhE ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#14 0x7119bf31 in _fu4690___ZN3vec10PTR_MARKER20h2f6eaa45629a18b5TDhE ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#15 0x7100594c in _fu4368___ZN3vec10PTR_MARKER20h2f6eaa45629a18b5TDhE ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#16 0x70f61a21 in middle::trans::base::get_res_dtor::h43536432cbfe0d4eclp ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#17 0x70f612f9 in middle::trans::glue::trans_struct_drop::h42859e59039df393i2c
    () from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#18 0x70f61229 in middle::trans::glue::trans_struct_drop_flag::closure.Name$LP$9
6957$RP$ () from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#19 0x70f61002 in middle::trans::base::with_cond::hdde4c7284044e5bdpdq ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#20 0x70f59920 in middle::trans::glue::make_drop_glue::as_closure.Name$LP$96921$
RP$ () from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#21 0x70f58ba3 in _fu4226___ZN3vec10PTR_MARKER20h2f6eaa45629a18b5TDhE ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#22 0x70f55238 in _fu9000___ZN11collections7hashmap5table25RawTable$LT$K$C$$x20V
$GT$8read_mut15__STATIC_FMTSTR20hbb022b69c160dbe0MKdE ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#23 0x70f54775 in middle::trans::glue::drop_ty::ha3b6364fb047419cgPc ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#24 0x70f64b18 in middle::trans::glue::drop_ty::as_closure.Name$LP$96985$RP$
    () from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#25 0x71006599 in middle::trans::base::iter_structural_ty::closure.Name$LP$10085
9$RP$ () from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#26 0x71005f0f in middle::trans::expr::with_field_tys::h11670827326678244581
    () from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#27 0x70f53ff3 in _fu7524___ZN6to_str10T.ToString9to_string15__STATIC_FMTSTR20h1
0d1156ed4fb4e120tdE () from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#28 0x70f599c9 in middle::trans::glue::make_drop_glue::as_closure.Name$LP$96921$
RP$ () from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#29 0x70f58ba3 in _fu4226___ZN3vec10PTR_MARKER20h2f6eaa45629a18b5TDhE ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#30 0x70f55238 in _fu9000___ZN11collections7hashmap5table25RawTable$LT$K$C$$x20V
$GT$8read_mut15__STATIC_FMTSTR20hbb022b69c160dbe0MKdE ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#31 0x70f54775 in middle::trans::glue::drop_ty::ha3b6364fb047419cgPc ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#32 0x710ab323 in middle::trans::cleanup::DropValue.Cleanup::trans::h9e58dd07218
58cdbJkJ () from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#33 0x70f63ee8 in _fu1225___ZN9LOG_LEVEL20h8fa6e58be0a929cajiaE ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#34 0x70fa2dcd in _fu4313___ZN3vec10PTR_MARKER20h2f6eaa45629a18b5TDhE ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#35 0x70f8e7db in _fu6998___ZN3vec12Vec$LT$T$GT$4push15__STATIC_FMTSTR20hbf8f0fb
3ab316886c2hE () from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#36 0x70f475b9 in _fu1201___ZN9LOG_LEVEL20h8fa6e58be0a929cajiaE ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#37 0x70f47a25 in middle::trans::controlflow::trans_block::h34e9413fdca19211oic
() from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#38 0x7100e36c in _fu1307___ZN9LOG_LEVEL20h8fa6e58be0a929cajiaE ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#39 0x70f19c46 in _fu1186___ZN9LOG_LEVEL20h8fa6e58be0a929cajiaE ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#40 0x70f1c180 in _fu1191___ZN9LOG_LEVEL20h8fa6e58be0a929cajiaE ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#41 0x70f71b98 in _fu12652___ZN3ast11LOCAL_CRATE20h254b1fc55dc8ccb0EfcE ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#42 0x70f6d2d6 in _fu1231___ZN9LOG_LEVEL20h8fa6e58be0a929cajiaE ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#43 0x70f7fe6c in _fu1246___ZN9LOG_LEVEL20h8fa6e58be0a929cajiaE ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#44 0x70f7fbdd in middle::trans::callee::trans_method_call::closure.Name$LP$9746
9$RP$ () from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#45 0x70f77f39 in middle::trans::callee::trans_call_inner::h72cbf70f83e61b01M2e
() from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#46 0x70f7f8c3 in _fu1245___ZN9LOG_LEVEL20h8fa6e58be0a929cajiaE ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#47 0x70f8e318 in _fu6998___ZN3vec12Vec$LT$T$GT$4push15__STATIC_FMTSTR20hbf8f0fb
3ab316886c2hE () from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#48 0x70f475b9 in _fu1201___ZN9LOG_LEVEL20h8fa6e58be0a929cajiaE ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#49 0x71048f13 in middle::trans::_match::store_local::closure.Name$LP$101895$RP$
 () from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#50 0x71048d0e in middle::trans::_match::mk_binding_alloca::h5956479867704565935
 () from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#51 0x71008812 in middle::trans::_match::store_local::h213fef90d26e8a57F4t ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#52 0x70f46aa4 in _fu1196___ZN9LOG_LEVEL20h8fa6e58be0a929cajiaE ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#53 0x70f46157 in _fu1193___ZN9LOG_LEVEL20h8fa6e58be0a929cajiaE ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#54 0x70f4793f in middle::trans::controlflow::trans_block::h34e9413fdca19211oic
() from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#55 0x7100e36c in _fu1307___ZN9LOG_LEVEL20h8fa6e58be0a929cajiaE ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#56 0x70f19c46 in _fu1186___ZN9LOG_LEVEL20h8fa6e58be0a929cajiaE ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#57 0x70f12e5c in _fu4202___ZN3vec10PTR_MARKER20h2f6eaa45629a18b5TDhE ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#58 0x70f12437 in middle::trans::base::trans_item::hc972132e3a4e27cf42q ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#59 0x70f12437 in middle::trans::base::trans_item::hc972132e3a4e27cf42q ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#60 0x7101f03f in _fu4399___ZN3vec10PTR_MARKER20h2f6eaa45629a18b5TDhE ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#61 0x71713a14 in driver::driver::phase_4_translate_to_llvm::h118acda94908ba87fV
q () from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#62 0x7170c994 in _fu6934___ZN4cell29Ref$LT$$x27b$C$$x20T$GT$.Drop4drop15__STATI
C_FMTSTR20haa0baa433b61d481cViE ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#63 0x717b2467 in _fu6208___ZN4cell32RefMut$LT$$x27b$C$$x20T$GT$.Drop4drop15__ST
ATIC_FMTSTR20haa0baa433b61d481tZiE ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#64 0x717af84d in driver::main_args::closure.Name$LP$134043$RP$ ()
   from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#65 0x717c1e7e in task::TaskBuilder$LT$S$GT$::try_future::closure.Name$LP$135192
$RP$ () from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#66 0x717c1d9c in task::TaskBuilder$LT$S$GT$::spawn_internal::closure.Name$LP$13
5169$RP$ () from C:\Compilation\Rust\bin\rustc-4e7c5e5c.dll
#67 0x70c301e8 in task::spawn_opts::closure.Name$LP$8439$RP$ ()
   from C:\Compilation\Rust\bin\native-4e7c5e5c.dll
#68 0x61f88295 in unwind::try::try_fn::h15894d0e8262efdc8yd ()
   from C:\Compilation\Rust\bin\rustrt-4e7c5e5c.dll
#69 0x61fe6636 in rust_try () from C:\Compilation\Rust\bin\rustrt-4e7c5e5c.dll
#70 0x61f85fd7 in unwind::try::hd8da966e728462f6Lwd ()
   from C:\Compilation\Rust\bin\rustrt-4e7c5e5c.dll
#71 0x61f85d6a in task::Task::run::h0062677dbabfc9b8bXc ()
   from C:\Compilation\Rust\bin\rustrt-4e7c5e5c.dll
#72 0x70c30087 in task::spawn_opts::closure.Name$LP$8385$RP$ ()
   from C:\Compilation\Rust\bin\native-4e7c5e5c.dll
#73 0x61f87def in thread::thread_start::h643f66d39f4ca9b1Jjd ()
   from C:\Compilation\Rust\bin\rustrt-4e7c5e5c.dll
#74 0x7520338a in KERNEL32!BaseThreadInitThunk ()
   from C:\Windows\syswow64\kernel32.dll
#75 0x77389f72 in ntdll!RtlInitializeExceptionChain ()
   from C:\Windows\system32\ntdll.dll
#76 0x77389f45 in ntdll!RtlInitializeExceptionChain ()
   from C:\Windows\system32\ntdll.dll
#77 0x00000000 in ?? ()

Metadata

Metadata

Assignees

No one assigned

    Labels

    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) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions