Skip to content
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

ICE: Example in the Intro #14243

Closed
thehydroimpulse opened this issue May 16, 2014 · 5 comments
Closed

ICE: Example in the Intro #14243

thehydroimpulse opened this issue May 16, 2014 · 5 comments

Comments

@thehydroimpulse
Copy link
Contributor

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
@sfackler
Copy link
Member

It seems to compile and run just fine on a slightly newer nightly:

rustc 0.11.0-pre-nightly (579e0a5 2014-05-15 01:02:11 -0700)
host: x86_64-apple-darwin

@thehydroimpulse
Copy link
Contributor Author

@sfackler Weird. Just upgraded to the newest nightly and it still results in an ICE.

rustc 0.11.0-pre-nightly (579e0a5 2014-05-15 01:02:11 -0700)
host: x86_64-apple-darwin

@sfackler
Copy link
Member

Where do you have the nightly installed? There have historically been some bad interactions involving symlinked .so's.

@thehydroimpulse
Copy link
Contributor Author

I have mine installed at the default location /usr/local. I used the mac installer to achieve it. I'll see if I can clean up some older rust files laying around (I have some 0.10 still around)

@thehydroimpulse
Copy link
Contributor Author

This has been fixed. Uninstalled Rust and removed any leftover files before reinstalling it. Thanks.

lnicola pushed a commit to lnicola/rust that referenced this issue Mar 13, 2023
feat: Diagnose unresolved field, method call and call expression
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants