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

dist-x86_64-freebsd fails when building with debug assertions #63663

Closed
Aaron1011 opened this issue Aug 17, 2019 · 2 comments · Fixed by #64250
Closed

dist-x86_64-freebsd fails when building with debug assertions #63663

Aaron1011 opened this issue Aug 17, 2019 · 2 comments · Fixed by #64250
Labels
C-bug Category: This is a bug. 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

@Aaron1011
Copy link
Member

Steps to reproduce:

  1. Run src/ci/docker/run.sh dist-x86_64-freebsd (note that DEPLOY=1 is not set, which is why we don't see this on Azure)
  2. Observe the following ICE (full log):
Building stage1 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-freebsd)
   Compiling core v0.0.0 (/checkout/src/libcore)
error: internal compiler error: src/librustc/ty/context.rs:213: node type <T>::IntoIter (hir_id=HirId { owner: DefIndex(4038), local_id: 61 }) with HirId::owner DefId(0:4038 ~ core[db27]::iter[0]::adapters[0]::flatten[0]::{{impl}}[13]::try_fold[0]::flatten[0]) cannot be placed in TypeckTables with local_id_root DefId(0:4034 ~ core[db27]::iter[0]::adapters[0]::flatten[0]::{{impl}}[13]::try_fold[0])

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:643:9
stack backtrace:
   0: std::panicking::default_hook::{{closure}}
   1: std::panicking::default_hook
   2: rustc::util::common::panic_hook
   3: std::panicking::rust_panic_with_hook
   4: std::panicking::begin_panic
   5: rustc_errors::Handler::bug
   6: rustc::util::bug::opt_span_bug_fmt::{{closure}}
   7: rustc::ty::context::tls::with_opt::{{closure}}
   8: rustc::ty::context::tls::with_context_opt
   9: rustc::ty::context::tls::with_opt
  10: rustc::util::bug::opt_span_bug_fmt
  11: rustc::util::bug::bug_fmt
  12: rustc::ty::context::validate_hir_id_for_typeck_tables::{{closure}}
  13: rustc::ty::context::tls::with::{{closure}}
  14: rustc::ty::context::tls::with_context::{{closure}}
  15: rustc::ty::context::tls::with_context_opt
  16: rustc::ty::context::tls::with_context
  17: rustc::ty::context::tls::with
  18: rustc::ty::context::TypeckTables::qpath_res
  19: rustc_save_analysis::SaveContext::get_path_res
  20: <rustc_save_analysis::dump_visitor::DumpVisitor as syntax::visit::Visitor>::visit_ty
  21: syntax::visit::walk_generic_args
  22: <rustc_save_analysis::dump_visitor::DumpVisitor as syntax::visit::Visitor>::visit_ty
  23: syntax::visit::walk_ty
  24: <rustc_save_analysis::dump_visitor::DumpVisitor as syntax::visit::Visitor>::visit_item
  25: rustc_save_analysis::dump_visitor::DumpVisitor::process_method
  26: <rustc_save_analysis::dump_visitor::DumpVisitor as syntax::visit::Visitor>::visit_item
  27: <rustc_save_analysis::dump_visitor::DumpVisitor as syntax::visit::Visitor>::visit_item
  28: <rustc_save_analysis::dump_visitor::DumpVisitor as syntax::visit::Visitor>::visit_item
  29: <rustc_save_analysis::dump_visitor::DumpVisitor as syntax::visit::Visitor>::visit_item
  30: <rustc_save_analysis::dump_visitor::DumpVisitor as syntax::visit::Visitor>::visit_mod
  31: syntax::visit::walk_crate
  32: rustc::dep_graph::graph::DepGraph::with_ignore
  33: rustc_save_analysis::process_crate
  34: rustc_driver::run_compiler::{{closure}}::{{closure}}::{{closure}}
  35: rustc::util::common::time
  36: rustc::ty::context::tls::enter_global
  37: rustc_interface::passes::BoxedGlobalCtxt::access::{{closure}}
  38: rustc_interface::passes::create_global_ctxt::{{closure}}
  39: rustc_interface::interface::run_compiler_in_existing_thread_pool
  40: std::thread::local::LocalKey<T>::with
  41: scoped_tls::ScopedKey<T>::set
  42: syntax::with_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
query stack during panic:
end of query stack
error: aborting due to previous error

This appears to be a legimitate bug, which is normally not exposed due to the if cfg!(debug_assertions) block in validate_hir_id_for_typeck_tables not running on CI.

@Aaron1011 Aaron1011 changed the title dist-x86_64-freebsd fails when buuilding with debug info dist-x86_64-freebsd fails when building with debug info Aug 17, 2019
@jonas-schievink jonas-schievink added A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) C-bug Category: This is a bug. O-freebsd Operating system: FreeBSD 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. labels Aug 17, 2019
@Aaron1011
Copy link
Member Author

Possibly related to #57298

@jonas-schievink jonas-schievink removed A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) O-freebsd Operating system: FreeBSD labels Aug 25, 2019
@jonas-schievink
Copy link
Contributor

Does not seem to be specific to FreeBSD: #63861

@jonas-schievink jonas-schievink changed the title dist-x86_64-freebsd fails when building with debug info dist-x86_64-freebsd fails when building with debug assertions Aug 25, 2019
tmandry added a commit to tmandry/rust that referenced this issue Sep 10, 2019
… r=varkor

save-analysis: Nest typeck tables when processing functions/methods

Fixes an issue where we did not nest tables correctly when resolving
associated types in formal argument/return type positions.

This was the minimized reproduction case that I tested the fix on:
```rust
pub trait Trait {
    type Assoc;
}

pub struct A;

pub fn func() {
    fn _inner1<U: Trait>(_: U::Assoc) {}
    fn _inner2<U: Trait>() -> U::Assoc { unimplemented!() }

    impl A {
        fn _inner1<U: Trait>(self, _: U::Assoc) {}
        fn _inner2<U: Trait>(self) -> U::Assoc { unimplemented!() }
    }
}
```
using `debug_assertions`-enabled rustc and by additionally passing `-Zsave-analysis`.

Unfortunately the original assertion fired is a *debug* one and from what I can tell we don't run the tests with these on, so I'm not adding a test here. If I missed it and there is a way to run tests with these on, I'd love to add a test case for this.

Closes rust-lang#63663
Closes rust-lang#50328
Closes rust-lang#43982
@bors bors closed this as completed in 2e11e81 Sep 16, 2019
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) ❄️ 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.

2 participants