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 when using associated types in gfx-rs #18048

Closed
kvark opened this issue Oct 15, 2014 · 2 comments
Closed

ICE when using associated types in gfx-rs #18048

kvark opened this issue Oct 15, 2014 · 2 comments
Assignees
Labels
A-associated-items Area: Associated items (types, constants & functions) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@kvark
Copy link
Contributor

kvark commented Oct 15, 2014

Steps to repro:

git clone https://github.com/gfx-rs/gfx-rs
cd gfx-rs
wget https://gist.github.com/kvark/d58189f825f2aeb6ac25/raw/968557e154c2a18950d126bb996f390b34428419/gfx-associated-types.patch
patch -p1 <gfx-associated-types.patch
RUST_BACKTRACE=1 cargo build

Output:

Compiling gfx v0.1.0 (file:///mnt/code/3d/gfx-rs)
ERROR:rbml::reader: failed to find block with tag 1
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 'explicit failure', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/librbml/lib.rs:247

stack backtrace:
   1:     0x7f99f26b6360 - rt::backtrace::imp::write::hdbb48f4c53a7cc60gDq
   2:     0x7f99f26b94f0 - failure::on_fail::h664e14eeb2ff8c0bDYq
   3:     0x7f99f6e51900 - unwind::begin_unwind_inner::h810872eb101799beGxd
   4:     0x7f99f3365830 - unwind::begin_unwind::h14577076525426096402
   5:     0x7f99f3364870 - reader::get_doc::h34b9fee462c727a7RQa
   6:     0x7f99f7d521a0 - metadata::decoder::item_name::h065e40376150a870Pis
   7:     0x7f99f7d59fe0 - metadata::decoder::get_trait_item_name_and_kind::hcd0b77ba18b4f323DPs
   8:     0x7f99f77d9db0 - middle::resolve::Resolver<'a>::build_reduced_graph_for_external_crate_def::h91ada62ec8bccd47VOH
   9:     0x7f99f77dd690 - middle::resolve::Resolver<'a>::populate_external_module::closure.120614
  10:     0x7f99f7d56ec0 - metadata::decoder::each_child_of_item_or_crate::closure.142110
  11:     0x7f99f3365ea0 - reader::tagged_docs::h6d9e7a813995bf589Xa
  12:     0x7f99f7d56b90 - metadata::decoder::each_child_of_item_or_crate::h80a59bba09bd7674Eus
  13:     0x7f99f7d57df0 - metadata::decoder::each_child_of_item::hd56a96f9c5f9536esBs
  14:     0x7f99f77dd440 - metadata::csearch::each_child_of_item::hcf6fba917e21703bS0u
  15:     0x7f99f77dd890 - middle::resolve::Resolver<'a>::populate_module_if_necessary::he8010b784c77a28fL3H
  16:     0x7f99f78081e0 - middle::resolve::Resolver<'a>::resolve_definition_of_name_in_module::hf0b8aa7c1822c9a1UPM
  17:     0x7f99f7802a40 - middle::resolve::Resolver<'a>::resolve_path::h3d7dd52242dd1924KMM
  18:     0x7f99f77ff270 - middle::resolve::Resolver<'a>::resolve_trait_reference::h402b805e21bd9de7ZFL
  19:     0x7f99f77fc2e0 - middle::resolve::Resolver<'a>::resolve_type_parameters::h8a979e9b77aae05aXAL
  20:     0x7f99f7802300 - middle::resolve::Resolver<'a>::resolve_function::closure.121359
  21:     0x7f99f77d7d80 - middle::resolve::Resolver<'a>::with_type_parameter_rib::h86e4a332a99093b1OpL
  22:     0x7f99f77fff40 - middle::resolve::Resolver<'a>::resolve_function::h22b0d2a33d4e73feAvL
  23:     0x7f99f77ff8e0 - middle::resolve::Resolver<'a>::resolve_method::h86ca86fa7b1a55c5nOL
  24:     0x7f99f7806430 - middle::resolve::Resolver<'a>::resolve_implementation::closure.121399
  25:     0x7f99f78062f0 - middle::resolve::Resolver<'a>::with_current_self_type::h17301777680080738788
  26:     0x7f99f7805dd0 - middle::resolve::Resolver<'a>::resolve_implementation::closure.121393
  27:     0x7f99f77d7d80 - middle::resolve::Resolver<'a>::with_type_parameter_rib::h86e4a332a99093b1OpL
  28:     0x7f99f77bba70 - middle::resolve::Resolver<'a>.Visitor<'v>::visit_item::h04b6473cdf0352a8G6F
  29:     0x7f99f77fae30 - visit::Visitor::visit_mod::h3717781391814223201
  30:     0x7f99f7811430 - middle::resolve::resolve_crate::h25accb75d8c796c8lkO
  31:     0x7f99f7d8eb80 - driver::driver::phase_3_run_analysis_passes::hd7948c48dc1857d4Ptx
  32:     0x7f99f7d88ec0 - driver::driver::compile_input::h840323360e6605caBax
  33:     0x7f99f7e15b00 - driver::run_compiler::h7b2b99e1f7744388UYA
  34:     0x7f99f7e159b0 - driver::run::closure.147450
  35:     0x7f99f74d4770 - task::TaskBuilder<S>::try_future::closure.101573
  36:     0x7f99f74d4550 - task::TaskBuilder<S>::spawn_internal::closure.101544
  37:     0x7f99f719c690 - task::spawn_opts::closure.8447
  38:     0x7f99f6eabf00 - rust_try_inner
  39:     0x7f99f6eabef0 - rust_try
  40:     0x7f99f6e4f1c0 - unwind::try::h556dfbdc1d8ffbecomd
  41:     0x7f99f6e4f040 - task::Task::run::ha0065cc018d875382Bc
  42:     0x7f99f719c3d0 - task::spawn_opts::closure.8387
  43:     0x7f99f6e50910 - thread::thread_start::h340c482110725cecdWc
  44:     0x7f99f1a5f250 - start_thread
  45:     0x7f99f6b293b9 - clone
  46:                0x0 - <unknown>

Could not compile `gfx`.
@emberian emberian added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Oct 15, 2014
@tomjakubowski
Copy link
Contributor

Smaller reproduction with rustc 0.13.0-dev (b825b3496 2014-11-20 10:01:42 +0000):

// bar.rs
#![crate_type="lib"]
#![feature(associated_types)]

pub trait Bar {
    type T;
}
// foo.rs
#![crate_type="lib"]
#![feature(associated_types)]

extern crate bar;

pub use bar::Bar;

Then trying to compile foo.rs gives the same ICE and backtrace.

@nikomatsakis
Copy link
Contributor

I've got a fix for this narrow issue, but when I broaden the test just a smidgen I encounter a few more issues. Patches forthcoming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-associated-items Area: Associated items (types, constants & functions) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

5 participants