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

futures-rs tests ICE on nightly #43853

Closed
sfackler opened this issue Aug 13, 2017 · 4 comments
Closed

futures-rs tests ICE on nightly #43853

sfackler opened this issue Aug 13, 2017 · 4 comments
Labels
C-bug Category: This is a bug. 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

@sfackler
Copy link
Member

Seems to be a different ICE than what's on beta (#43852).

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.21.0-nightly (f774bced5 2017-08-12) running on x86_64-unknown-linux-gnu                                                                                                                                                                  
                                                                                                                                                                                                                                                       
note: run with `RUST_BACKTRACE=1` for a backtrace                                                                                                                                                                                                      
                                                                                                                                                                                                                                                       
thread 'rustc' panicked at 'index out of bounds: the len is 6319 but the index is 4294967295', /checkout/src/liballoc/vec.rs:1555:10                                                                                                                   
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.                                                                                                                                                                
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:380                                                                                                                                                                                                  
   3: std::panicking::default_hook                                                                                                                                                                                                                     
             at /checkout/src/libstd/panicking.rs:390                                                                                                                                                                                                  
   4: std::panicking::rust_panic_with_hook                                                                                                                                                                                                             
             at /checkout/src/libstd/panicking.rs:610                                                                                                                                                                                                  
   5: std::panicking::begin_panic                                                                                                                                                                                                                      
             at /checkout/src/libstd/panicking.rs:571                                                                                                                                                                                                  
   6: std::panicking::begin_panic_fmt                                                                                                                                                                                                                  
             at /checkout/src/libstd/panicking.rs:521                                                                                                                                                                                                  
   7: rust_begin_unwind                                                                                                                                                                                                                                
             at /checkout/src/libstd/panicking.rs:497                                                                                                                                                                                                  
   8: core::panicking::panic_fmt                                                                                                                                                                                                                       
             at /checkout/src/libcore/panicking.rs:71                                                                                                                                                                                                  
   9: core::panicking::panic_bounds_check                                                                                                                                                                                                              
             at /checkout/src/libcore/panicking.rs:58                                                                                                                                                                                                  
  10: rustc::ty::context::TyCtxt::lint_level_at_node                                                                                                                                                                                                   
  11: rustc::ty::context::TyCtxt::lint_node                                                                                                                                                                                                            
  12: rustc::traits::select::SelectionContext::select                                                                                                                                                                                                  
  13: rustc::traits::trans::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'tcx>>::trans_fulfill_obligation::{{closure}}                                                                                                                                   
  14: rustc::traits::trans::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'tcx>>::trans_fulfill_obligation                                                                                                                                                
  15: rustc_trans::monomorphize::resolve                                                                                                                                                                                                               
  16: <rustc_trans::collector::MirNeighborCollector<'a, 'tcx> as rustc::mir::visit::Visitor<'tcx>>::visit_terminator_kind                                                                                                                              
  17: rustc::mir::visit::Visitor::visit_mir                                                                                                                                                                                                            
  18: rustc_trans::collector::collect_items_rec                                                                                                                                                                                                        
  19: rustc_trans::collector::collect_items_rec                                                                                                                                                                                                        
  20: rustc_trans::collector::collect_items_rec                                                                                                                                                                                                        
  21: rustc_trans::collector::collect_items_rec                                                                                                                                                                                                        
  22: rustc_trans::collector::collect_items_rec                                                                                                                                                                                                        
  23: rustc_trans::collector::collect_items_rec                                                                                                                                                                                                        
  24: rustc_trans::collector::collect_items_rec                                                                                                                                                                                                        
  25: rustc_trans::collector::collect_items_rec                                                                                                                                                                                                        
  26: rustc_trans::collector::collect_items_rec                                                                                                                                                                                                        
  27: rustc_trans::collector::collect_items_rec                                                                                                                                                                                                        
  28: rustc_trans::collector::collect_items_rec                                                                                                                                                                                                        
  29: rustc_trans::collector::collect_items_rec                                                                                                                                                                                                        
  30: rustc_trans::collector::collect_items_rec                                                                                                                                                                                                        
  31: rustc_trans::collector::collect_items_rec                                                                                                                                                                                                        
  32: rustc_trans::collector::collect_items_rec                                                                                                                                                                                                        
  33: rustc_trans::base::collect_and_partition_translation_items::{{closure}}                                                                                                                                                                          
  34: rustc_trans::base::trans_crate                                                                                                                                                                                                                   
  35: rustc_driver::driver::phase_4_translate_to_llvm                                                                                                                                                                                                  
  36: rustc_driver::driver::compile_input::{{closure}}                                                                                                                                                                                                 
  37: rustc::ty::context::TyCtxt::create_and_enter                                                                                                                                                                                                     
  38: rustc_driver::driver::compile_input                                                                                                                                                                                                              
  39: rustc_driver::run_compile
@sfackler sfackler added 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. labels Aug 13, 2017
@arielb1
Copy link
Contributor

arielb1 commented Aug 13, 2017

Oh well. Looks like someone is passing DUMMY_NODE_ID to select, and it's trying to report a future-compatibility error. Shouldn't be a hard fix.

@alexcrichton
Copy link
Member

Bisection points at #43522, I'll take a look

@alexcrichton
Copy link
Member

The stack trace I collected says this line is the lint warning, so presumably obligation.cause.body_id is DUMMY_NODE_ID as you indicated @arielb1.

Is the best fix here to ignore DUMMY_NODE_ID in ty/context.rs or in traits/select.rs?

@arielb1
Copy link
Contributor

arielb1 commented Aug 14, 2017

Minimal example:

// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::panic;

fn test() {
    wait(|| panic!());
}

fn wait<T, F: FnOnce() -> T>(f: F) -> F::Output {
    From::from(f())
}

fn main() {
    let result = panic::catch_unwind(move || test());
    assert!(result.is_err());
}

arielb1 added a commit to arielb1/rust that referenced this issue Aug 14, 2017
The defaulted unit bit is only relevant for the surrounding inference
context, and can cause trouble, including spurious lints and ICEs,
outside of it.

Fixes rust-lang#43853.
@carols10cents carols10cents added C-bug Category: This is a bug. A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. labels Aug 14, 2017
@arielb1 arielb1 removed the A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. label Aug 14, 2017
bors added a commit that referenced this issue Aug 14, 2017
remove the "defaulted unit" type bit during writeback

The defaulted unit bit is only relevant for the surrounding inference
context, and can cause trouble, including spurious lints and ICEs,
outside of it.

Fixes #43853.

r? @eddyb
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. 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

No branches or pull requests

4 participants