Skip to content

ICE: Example in the Intro #14243

@thehydroimpulse

Description

@thehydroimpulse

One of the examples in the 30-minute introduction ICEs the compiler.

Example:

extern crate sync;
use sync::Arc;

fn main() {
    let numbers = ~[1,2,3];
    let numbers = Arc::new(numbers);

    for num in range(0, 3) {
        let (tx, rx)  = channel();
        tx.send(numbers.clone());

        spawn(proc() {
            let numbers = rx.recv();
            println!("{:d}", numbers[num as uint]);
        })
    }
}

Error:

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://static.rust-lang.org/doc/master/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'No triple in crate', /Users/rustbuild/src/rust-buildbot/slave/nightly-mac/build/src/libstd/option.rs:167

With backtracing:

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://static.rust-lang.org/doc/master/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'No triple in crate', /Users/rustbuild/src/rust-buildbot/slave/nightly-mac/build/src/libstd/option.rs:167
stack backtrace:
   1:        0x109f728e5 - rt::backtrace::imp::write::hbcaf678b0345cccaceG::v0.11.0.pre
   2:        0x109edd5cd - rt::unwind::begin_unwind_inner::h14156791aa49f4a6gOF::v0.11.0.pre
   3:        0x1070ded2d - rt::unwind::begin_unwind::h13817063666586038149::v0.11.0.pre
   4:        0x10787a00b - metadata::decoder::get_crate_triple::hfcfe3ec1b9abc16cKje::v0.11.0.pre
   5:        0x107896a4b - metadata::loader::Context<'a>::extract_one::hf5d19176f51236649Lg::v0.11.0.pre
   6:        0x10788e811 - metadata::loader::Context<'a>::find_library_crate::ha9b42fb937e4a7e8ffg::v0.11.0.pre
   7:        0x107889fef - metadata::loader::Context<'a>::load_library_crate::hec3e3d4de6523f8eD1f::v0.11.0.pre
   8:        0x107886170 - metadata::creader::resolve_crate::hc3859c99e8758a63VZe::v0.11.0.pre
   9:        0x10787da97 - metadata::creader::Env<'a>.visit..Visitor<(*>::visit_view_item::h37242e92fe44bdb8oye::v0.11.0.pre
  10:        0x10787cd9d - metadata::creader::read_crates::h3ab0d15b2426d55avxe::v0.11.0.pre
  11:        0x1074e7c36 - util::common::time::h14577185196876260643::v0.11.0.pre
  12:        0x1078a626e - driver::driver::phase_3_run_analysis_passes::hb59d0b3ba6e1d3bb8gi::v0.11.0.pre
  13:        0x1078a12ce - driver::driver::compile_input::hdf53daa1ef2f9400I6h::v0.11.0.pre
  14:        0x107941002 - driver::run_compiler::h0bd18c30b3e645ccKyk::v0.11.0.pre
  15:        0x10793f34d - driver::main_args::closure.92571
  16:        0x1079567f7 - driver::monitor::closure.93746
  17:        0x107950ffb - task::TaskBuilder::try::closure.93513
  18:        0x10954dfcc - task::spawn_opts::closure.7487
  19:        0x109f695f8 - rt::task::Task::run::closure.28524
  20:        0x109f8b1cc - rust_try
  21:        0x109f69477 - rt::task::Task::run::h709df42827b3a28enDD::v0.11.0.pre
  22:        0x10954de2f - task::spawn_opts::closure.7459
  23:        0x109f71116 - rt::t

Rustc:

rustc 0.11.0-pre-nightly (e162438 2014-05-12 23:11:45 -0700)
host: x86_64-apple-darwin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions