Skip to content

ICE when compiling image with ace517da0d1e356aa5b42f4cdee6854538591ef2 #41604

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
nox opened this issue Apr 28, 2017 · 9 comments · Fixed by #41651
Closed

ICE when compiling image with ace517da0d1e356aa5b42f4cdee6854538591ef2 #41604

nox opened this issue Apr 28, 2017 · 9 comments · Fixed by #41651
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@nox
Copy link
Contributor

nox commented Apr 28, 2017

error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'assertion failed: !unsize', /checkout/src/librustc_typeck/check/mod.rs:2185
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
             at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at /checkout/src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at /checkout/src/libstd/sys_common/backtrace.rs:60
             at /checkout/src/libstd/panicking.rs:355
   3: std::panicking::default_hook
             at /checkout/src/libstd/panicking.rs:365
   4: std::panicking::rust_panic_with_hook
             at /checkout/src/libstd/panicking.rs:549
   5: std::panicking::begin_panic
   6: rustc_typeck::check::FnCtxt::try_index_step
   7: rustc_typeck::check::method::confirm::ConfirmContext::confirm
   8: rustc_typeck::check::method::<impl rustc_typeck::check::FnCtxt<'a, 'gcx, 'tcx>>::lookup_method
   9: rustc_typeck::check::FnCtxt::check_expr_kind
  10: rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_lvalue_pref
  11: rustc_typeck::check::FnCtxt::check_stmt
  12: rustc_typeck::check::FnCtxt::check_block_with_expected::{{closure}}
  13: rustc_typeck::check::FnCtxt::check_block_with_expected
  14: rustc_typeck::check::FnCtxt::check_expr_kind
  15: rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_lvalue_pref
  16: rustc_typeck::check::FnCtxt::check_return_expr
  17: rustc_typeck::check::check_fn
  18: rustc_typeck::check::typeck_tables_of
  19: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_tables_of<'tcx>>::try_get
  20: rustc::ty::maps::TyCtxtAt::typeck_tables_of
  21: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::typeck_tables_of
  22: rustc_typeck::check::typeck_item_bodies
  23: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_item_bodies<'tcx>>::try_get
  24: rustc::ty::maps::TyCtxtAt::typeck_item_bodies
  25: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::typeck_item_bodies
  26: rustc_typeck::check_crate
  27: rustc_driver::driver::phase_3_run_analysis_passes::{{closure}}
  28: rustc_driver::driver::phase_3_run_analysis_passes
  29: rustc_driver::driver::compile_input
  30: rustc_driver::run_compiler
  31: std::panicking::try::do_call
  32: __rust_maybe_catch_panic
             at /checkout/src/libpanic_unwind/lib.rs:98
  33: <F as alloc::boxed::FnBox<A>>::call_box
  34: std::sys::imp::thread::Thread::new::thread_start
             at /checkout/src/liballoc/boxed.rs:658
             at /checkout/src/libstd/sys_common/thread.rs:21
             at /checkout/src/libstd/sys/unix/thread.rs:84
  35: start_thread
  36: clone
error: Could not compile `image`.

Cc @eddyb

@nox
Copy link
Contributor Author

nox commented Apr 28, 2017

Culprit is in b0a4074...ace517d

@nox
Copy link
Contributor Author

nox commented Apr 28, 2017

Cc @arielb1, I suspect a260df2.

@sfackler sfackler added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Apr 28, 2017
@TyOverby
Copy link
Contributor

I think I'm hitting this too, but with a different stack trace:

stack backtrace:
   0: <std::time::SystemTimeError as core::fmt::Display>::fmt
   1: std::panicking::Location::line
   2: std::panicking::Location::line
   3: std::panicking::rust_panic_with_hook
   4: <unknown>
   5: rustc_typeck::check::FnCtxt::field_ty
   6: rustc_typeck::check::method::confirm::<impl rustc_typeck::check::FnCtxt<'a, 'gcx, 'tcx>>::confirm_method
   7: rustc_typeck::check::method::<impl rustc_typeck::check::FnCtxt<'a, 'gcx, 'tcx>>::lookup_method
   8: rustc_typeck::check::FnCtxt::check_struct_path
   9: rustc_typeck::check::FnCtxt::check_struct_path
  10: rustc_typeck::check::FnCtxt::check_stmt
  11: rustc_typeck::check::FnCtxt::check_block_no_value
  12: rustc_typeck::check::FnCtxt::check_block_no_value
  13: rustc_typeck::check::FnCtxt::check_struct_path
  14: rustc_typeck::check::FnCtxt::check_struct_path
  15: rustc_typeck::check::FnCtxt::impl_self_ty
  16: <rustc_typeck::check::GatherLocalsVisitor<'a, 'gcx, 'tcx> as rustc::hir::intravisit::Visitor<'gcx>>::visit_pat
  17: rustc_typeck::check::provide
  18: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_tables_of<'tcx>>::try_get
  19: rustc::ty::maps::TyCtxtAt::typeck_tables_of
  20: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::typeck_tables_of
  21: rustc_typeck::check::check_item_bodies
  22: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_item_bodies<'tcx>>::try_get
  23: rustc::ty::maps::TyCtxtAt::typeck_item_bodies
  24: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::typeck_item_bodies
  25: rustc_typeck::check_crate
  26: rustc_driver::driver::count_nodes
  27: rustc_driver::driver::count_nodes
  28: rustc_driver::driver::compile_input
  29: rustc_driver::run_compiler
  30: <unknown>
  31: _rust_maybe_catch_panic
  32: <rustc_driver::derive_registrar::Finder as rustc::hir::itemlikevisit::ItemLikeVisitor<'v>>::visit_impl_item
  33: std::sys::imp::thread::Thread::new
  34: BaseThreadInitThunk

@sapphire-arches
Copy link
Contributor

sapphire-arches commented Apr 29, 2017

I'm also seeing this, compiling image-0.13.0 from crates.io:

Meta

$ rustc --version --verbose
rustc 1.18.0-nightly (128aa262e 2017-04-28)
binary: rustc
commit-hash: 128aa262e8fe445f5c4d5c1f15dd28a2007c0234
commit-date: 2017-04-28
host: x86_64-unknown-linux-gnu
release: 1.18.0-nightly
LLVM version: 4.0

@TyOverby
Copy link
Contributor

^ mine was compiling image 0.13.0 as well.

@sfackler sfackler added regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 30, 2017
@kennytm
Copy link
Member

kennytm commented Apr 30, 2017

The error manifests only when the webp feature of image is enabled. In particular it is the webp::vp8 module causing the ICE.

Edit: It is the VP8Decoder::init_partitions function.

Edit: Reduced test case:

struct B;

impl B {
    fn init(&mut self) {}
}

fn main() {
    let mut b = [B];
    b[1-1].init();
}

@arielb1
Copy link
Contributor

arielb1 commented Apr 30, 2017

I'm on it

arielb1 added a commit to arielb1/rust that referenced this issue Apr 30, 2017
bors added a commit that referenced this issue Apr 30, 2017
refactor the handling of lvalue ops

I think I got the code into a "mostly sane" situation.

Fixes #41604.

beta-nominating because fixes regression in #41578. I think I can do a smaller fix, but the previous code is too fragile.

r? @eddyb
@Nemo157
Copy link
Member

Nemo157 commented May 12, 2017

This bug appears to have made it into the latest beta (rustc 1.18.0-beta.2 (f4e8e81c3 2017-05-11)) according to this post on u.rl.o which links to this build log.

@eddyb
Copy link
Member

eddyb commented May 12, 2017

That's why #41651 is nominated for backporting to beta.

nikomatsakis pushed a commit to nikomatsakis/rust that referenced this issue May 22, 2017
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants