Skip to content

ICE when building Iron #17694

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
reem opened this issue Oct 1, 2014 · 6 comments
Closed

ICE when building Iron #17694

reem opened this issue Oct 1, 2014 · 6 comments
Labels
A-closures Area: Closures (`|…| { … }`) A-type-system Area: Type system I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@reem
Copy link
Contributor

reem commented Oct 1, 2014

Repo: https://github.com/iron/iron

Master at this time: iron/iron@18c0981

Backtrace:

~/h/iron git:master ❯❯❯ RUST_BACKTRACE=1 cargo build                                               
   Compiling iron v0.0.1 (file:///Users/Jonathan/rust/iron)
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 'no entry found for key', /Users/rustbuild/src/rust-buildbot/slave/nightly-mac/build/src/libstd/collections/hashmap/map.rs:1093

stack backtrace:
   1:        0x104d858f9 - rt::backtrace::imp::write::h57c4b9a5e0159c2as4q
   2:        0x104d88c31 - failure::on_fail::h9597b912f48b9b706kr
   3:        0x10500eff5 - unwind::begin_unwind_inner::hc2b5226ed0282dfeVRd
   4:        0x101a1a17c - unwind::begin_unwind::h11076168068521793063
   5:        0x101c054a3 - middle::expr_use_visitor::ExprUseVisitor<'d, 't, TYPER>::walk_captures::closure.113560
   6:        0x101bec161 - middle::ty::with_freevars::h5404199086317543483
   7:        0x101c01545 - middle::expr_use_visitor::ExprUseVisitor<'d, 't, TYPER>::walk_expr::h15577293082558427187
   8:        0x101c04ebb - middle::expr_use_visitor::ExprUseVisitor<'d, 't, TYPER>::consume_expr::h4543982797502329416
   9:        0x101c0255f - middle::expr_use_visitor::ExprUseVisitor<'d, 't, TYPER>::walk_expr::h15577293082558427187
  10:        0x101c04ebb - middle::expr_use_visitor::ExprUseVisitor<'d, 't, TYPER>::consume_expr::h4543982797502329416
  11:        0x101c010c0 - middle::expr_use_visitor::ExprUseVisitor<'d, 't, TYPER>::walk_block::h7824838697509637511
  12:        0x101bfa34d - middle::borrowck::gather_loans::gather_loans_in_fn::hf96f8c6647c1d7feR3h
  13:        0x101c21d45 - middle::borrowck::build_borrowck_dataflow_data::h73b392d294a7bcf7ZQj
  14:        0x101c1f26c - middle::borrowck::borrowck_fn::h4ddc1cc1afcff2c59Nj
  15:        0x101c21493 - visit::walk_item::h4401219305633436056
  16:        0x101c2105e - visit::walk_item::h4401219305633436056
  17:        0x101c1fb4a - middle::borrowck::check_crate::h4d6d565ad7aa1decXGj
  18:        0x101a37e86 - util::common::time::h3749222828850377650
  19:        0x10225734b - driver::driver::phase_3_run_analysis_passes::he1a1b07e6ec33f9dFWw
  20:        0x1022518d8 - driver::driver::compile_input::h1037c8fe7e200b41uDw
  21:        0x1022d07d4 - driver::run_compiler::h3f1264bcc2d33c04ytA
  22:        0x1022ce976 - driver::main_args::closure.146588
  23:        0x101a5062b - task::TaskBuilder<S>::try_future::closure.101381
  24:        0x101a50523 - task::TaskBuilder<S>::spawn_internal::closure.101352
  25:        0x1019d067d - task::spawn_opts::closure.8556
  26:        0x1050721ac - rust_try_inner
  27:        0x105072196 - rust_try
  28:        0x10500bfa7 - unwind::try::h87aabef6b705df27DGd
  29:        0x10500be3c - task::Task::run::hc0753fa4c82e7ec2uWc
  30:        0x1019d04d2 - task::spawn_opts::closure.8495
  31:        0x10500df4a - thread::thread_start::h88a63edf7f210ee3Zgd
  32:     0x7fff87f71899 - _pthread_body
  33:     0x7fff87f7172a - _pthread_struct_init

Could not compile `iron`.

To learn more, run the command again with --verbose.
@tomjakubowski
Copy link
Contributor

I got this same ICE, here's a smaller example:

#![feature(unboxed_closures)]

fn main() {
    let x = 123i;
    let _ = |&: | x;
}

Backtrace:

[tom@elbridge ~]$ rustc --version
rustc 0.12.0-dev (0c6679652 2014-09-29 21:12:16 +0000)
[tom@elbridge ~]$ RUST_BACKTRACE=1 rustc foo.rs
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 'no entry found for key', /build/rust-git/src/rust/src/libstd/collections/hashmap/map.rs:1093

stack backtrace:
   1:     0x7f6eff51a720 - rt::backtrace::imp::write::ha75ba269c80f79c9UVq
   2:     0x7f6eff51d8b0 - <unknown>
   3:     0x7f6effcd2090 - unwind::begin_unwind_inner::h99aec5f720e41c37SUd
   4:     0x7f6f000a42b0 - <unknown>
   5:     0x7f6f0027f010 - <unknown>
   6:     0x7f6f0027eef0 - <unknown>
   7:     0x7f6f00293040 - <unknown>
   8:     0x7f6f00292d20 - <unknown>
   9:     0x7f6f0028cfd0 - middle::borrowck::gather_loans::gather_loans_in_fn::h7ca090ca6cfae9d2P3h
  10:     0x7f6f002b3310 - <unknown>
  11:     0x7f6f002b07c0 - <unknown>
  12:     0x7f6f002b25b0 - <unknown>
  13:     0x7f6f002b0f70 - middle::borrowck::check_crate::h676a3166f3c656faVGj
  14:     0x7f6f000c1b40 - <unknown>
  15:     0x7f6f008f9670 - driver::driver::phase_3_run_analysis_passes::h7ab4d2823326c4fcaMw
  16:     0x7f6f008f4e80 - driver::driver::compile_input::h47be44a11fe49900Zsw
  17:     0x7f6f00976e10 - <unknown>
  18:     0x7f6f00976cf0 - <unknown>
  19:     0x7f6f000daad0 - <unknown>
  20:     0x7f6f000da8c0 - <unknown>
  21:     0x7f6f01282700 - <unknown>
  22:     0x7f6effd21590 - <unknown>
  23:     0x7f6effd21580 - rust_try
  24:     0x7f6effccf220 - unwind::try::had5a0109a3678a47AJd
  25:     0x7f6effccf0b0 - task::Task::run::h1ae56ff3a9ffb576UYc
  26:     0x7f6f01282470 - <unknown>
  27:     0x7f6effcd1130 - <unknown>
  28:     0x7f6efefe4250 - start_thread
  29:     0x7f6eff9a83b9 - clone
  30:                0x0 - <unknown>

@brson
Copy link
Contributor

brson commented Oct 2, 2014

This is unfortunate. I wonder if somebody can bisect and revert. Any changes to closure type checking recently that may have triggered this?

cc @pcwalton @nick29581 @eddyb

@brson brson added I-wrong I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ A-type-system Area: Type system and removed I-wrong labels Oct 2, 2014
@jgallagher
Copy link

I'm super new to rust, so I'll leave the reverting to you guys. I did do the bisect - the commit that introduced this is 2257e23

@huonw
Copy link
Member

huonw commented Oct 3, 2014

A work around (for @tomjakubowski's example at least) is using capture-by-move, e.g.

#![feature(unboxed_closures)]

fn main() {
    let x = 123i;
    let _ = move |&: | x;
}

@reem
Copy link
Contributor Author

reem commented Oct 3, 2014

That's what I tried in iron too, looks like it's working.

@huonw huonw added the A-closures Area: Closures (`|…| { … }`) label Oct 3, 2014
@huonw
Copy link
Member

huonw commented Oct 3, 2014

Closing as a dupe of #17655. (Thanks for bisecting @jgallagher!)

@huonw huonw closed this as completed Oct 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-closures Area: Closures (`|…| { … }`) A-type-system Area: Type system I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

5 participants