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 compiling a package #51770

Closed
goddessfreya opened this issue Jun 25, 2018 · 3 comments · Fixed by #67654
Closed

ICE when compiling a package #51770

goddessfreya opened this issue Jun 25, 2018 · 3 comments · Fixed by #67654
Labels
C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@goddessfreya
Copy link
Contributor

goddessfreya commented Jun 25, 2018

The compiler panics.

I tried this code:
https://github.com/XavilPergis/birblike

I expected to see this happen: The program compiling or giving an error.

Instead, this happened: The program paniced

Meta

rustc --version --verbose:

rustc 1.28.0-nightly (01cc982e9 2018-06-24)
binary: rustc
commit-hash: 01cc982e936120acb0424e41de14e42ba2d88c6f
commit-date: 2018-06-24
host: x86_64-unknown-linux-gnu
release: 1.28.0-nightly
LLVM version: 6.0

Backtrace:

stack backtrace:
   0:     0x563761a8ce5c - backtrace::backtrace::trace::h472e449cde1c6db8
   1:     0x563761a8b842 - backtrace::capture::Backtrace::new_unresolved::ha5d86bb667abb4d6
   2:     0x563761a8b4b2 - failure::backtrace::internal::InternalBacktrace::new::h5aacf1ab9379901b
   3:     0x563761a8af11 - <failure::backtrace::Backtrace as core::default::Default>::default::h3338d50a42bee772
   4:     0x563761a8af68 - failure::backtrace::Backtrace::new::hd9cc93bbf7427c49
   5:     0x56376160f66a - cargo::util::process_builder::ProcessBuilder::exec::hd51ef9b28c6bd41a
   6:     0x5637617186bf - cargo::core::compiler::Executor::exec::hc21f154f92a53265
   7:     0x563761710796 - <F as cargo::core::compiler::job::FnBox<A, R>>::call_box::hece56ccf2a0ff770
   8:     0x5637616722f0 - <F as cargo::core::compiler::job::FnBox<A, R>>::call_box::h7da33457f01d1a28
   9:     0x5637616722f0 - <F as cargo::core::compiler::job::FnBox<A, R>>::call_box::h7da33457f01d1a28
  10:     0x56376167291b - cargo::core::compiler::job::Job::run::hf433aeb4ba83654f
  11:     0x5637616a03af - <F as crossbeam::FnBox>::call_box::ha53148e1d0135323
  12:     0x563761c82bb9 - __rust_maybe_catch_panic
                        at libpanic_unwind/lib.rs:105
  13:     0x5637615fdc49 - <F as alloc::boxed::FnBox<A>>::call_box::h98611f1a55834dbf
  14:     0x563761c6f2da - <alloc::boxed::Box<alloc::boxed::FnBox<A, Output$u3d$R$GT$$u20$$u2b$$u20$$u27$a$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::hbf81ad29f57ceb92
                        at /checkout/src/liballoc/boxed.rs:650
                         - std::sys_common::thread::start_thread::h9f808e1cb13674ec
                        at libstd/sys_common/thread.rs:24
  15:     0x563761c5c6e5 - std::sys::unix::thread::Thread::new::thread_start::h668a95d388fe6493
                        at libstd/sys/unix/thread.rs:90
  16:     0x7f73a1227074 - start_thread
  17:     0x7f73a0d4053e - clone
  18:                0x0 - <unknown>

stack backtrace:
   0:     0x563761a8ce5c - backtrace::backtrace::trace::h472e449cde1c6db8
   1:     0x563761a8b842 - backtrace::capture::Backtrace::new_unresolved::ha5d86bb667abb4d6
   2:     0x563761a8b4b2 - failure::backtrace::internal::InternalBacktrace::new::h5aacf1ab9379901b
   3:     0x563761a8af11 - <failure::backtrace::Backtrace as core::default::Default>::default::h3338d50a42bee772
   4:     0x563761a8af68 - failure::backtrace::Backtrace::new::hd9cc93bbf7427c49
   5:     0x5637616c8008 - <core::result::Result<T, E> as cargo::util::errors::CargoResultExt<T, E>>::chain_err::h5438d11452f469cd
   6:     0x5637617107b3 - <F as cargo::core::compiler::job::FnBox<A, R>>::call_box::hece56ccf2a0ff770
   7:     0x5637616722f0 - <F as cargo::core::compiler::job::FnBox<A, R>>::call_box::h7da33457f01d1a28
   8:     0x5637616722f0 - <F as cargo::core::compiler::job::FnBox<A, R>>::call_box::h7da33457f01d1a28
   9:     0x56376167291b - cargo::core::compiler::job::Job::run::hf433aeb4ba83654f
  10:     0x5637616a03af - <F as crossbeam::FnBox>::call_box::ha53148e1d0135323
  11:     0x563761c82bb9 - __rust_maybe_catch_panic
                        at libpanic_unwind/lib.rs:105
  12:     0x5637615fdc49 - <F as alloc::boxed::FnBox<A>>::call_box::h98611f1a55834dbf
  13:     0x563761c6f2da - <alloc::boxed::Box<alloc::boxed::FnBox<A, Output$u3d$R$GT$$u20$$u2b$$u20$$u27$a$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::hbf81ad29f57ceb92
                        at /checkout/src/liballoc/boxed.rs:650
                         - std::sys_common::thread::start_thread::h9f808e1cb13674ec
                        at libstd/sys_common/thread.rs:24
  14:     0x563761c5c6e5 - std::sys::unix::thread::Thread::new::thread_start::h668a95d388fe6493
                        at libstd/sys/unix/thread.rs:90
  15:     0x7f73a1227074 - start_thread
  16:     0x7f73a0d4053e - clone
  17:                0x0 - <unknown>
`
@goddessfreya
Copy link
Contributor Author

Full info attached
log.zip

@estebank estebank added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Jun 25, 2018
@jonas-schievink jonas-schievink added C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. labels Aug 6, 2019
@jonas-schievink
Copy link
Contributor

This builds fine on the current nightly. Getting a test case might be difficult though.

@rossmacarthur
Copy link
Contributor

Reduced to

#![feature(nll)]

use std::ops::Index;

pub struct Test<T> {
    a: T,
}

impl<T> Index<usize> for Test<T> {
    type Output = T;

    fn index(&self, _index: usize) -> &Self::Output {
        &self.a
    }
}

fn main() {}

This fails with the identical error

$ RUSTUP_TOOLCHAIN=nightly-2018-06-24 rustc issue-51770.rs
thread 'main' panicked at 'region_obligations not empty: [
    (
        NodeId(
            23
        ),
        RegionObligation(sub_region='_#1r, sup_type=T)
    )
]', librustc/infer/mod.rs:1057:9
note: Run with `RUST_BACKTRACE=1` for a backtrace.

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: rustc 1.28.0-nightly (60efbdead 2018-06-23) running on x86_64-apple-darwin

Submitting a PR now with this as a test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ 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.

4 participants