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

Internal compiler error but only when running under rls #64821

Closed
kinnison opened this issue Sep 26, 2019 · 7 comments · Fixed by #65353
Closed

Internal compiler error but only when running under rls #64821

kinnison opened this issue Sep 26, 2019 · 7 comments · Fixed by #65353
Assignees
Labels
A-save-analysis Area: saving results of analyses such as inference and borrowck results to a file. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@kinnison
Copy link
Contributor

I wasn't sure if it was right to report this here or elsewhere, so here it is for now...

Trying to compile Hagrid with rustc 1.39.0-nightly (6ef275e6c 2019-09-24) works, but running the rls --cli from the same toolchain results in the following:

{"jsonrpc":"2.0","method":"window/progress","params":{"done":null,"id":"progress_1","message":null,"percentage":null,"title":"Building"}}
{"jsonrpc":"2.0","method":"window/progress","params":{"done":null,"id":"progress_1","message":"petgraph","percentage":null,"title":"Building"}}
{"jsonrpc":"2.0","method":"window/progress","params":{"done":null,"id":"progress_1","message":"build_script_build","percentage":null,"title":"Building"}}
{"artifact":"/home/dsilvers/dev-git/hagrid/target/rls/debug/deps/petgraph-2cacb34015adf613.d","emit":"dep-info"}
{"message":"src/librustc/ty/context.rs:211: node type <G>::NodeId (hir_id=HirId { owner: DefIndex(3560), local_id: 10 }) with HirId::owner DefId(0:3560 ~ petgraph[36e6]::algo[0]::tarjan_scc[0]::Data[0]) cannot be placed in TypeckTables with local_id_root DefId(0:980 ~ petgraph[36e6]::algo[0]::tarjan_scc[0])","code":null,"level":"error: internal compiler error","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;9merror: internal compiler error\u001b[0m\u001b[0m\u001b[1m: src/librustc/ty/context.rs:211: node type <G>::NodeId (hir_id=HirId { owner: DefIndex(3560), local_id: 10 }) with HirId::owner DefId(0:3560 ~ petgraph[36e6]::algo[0]::tarjan_scc[0]::Data[0]) cannot be placed in TypeckTables with local_id_root DefId(0:980 ~ petgraph[36e6]::algo[0]::tarjan_scc[0])\u001b[0m\n\n"}
thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:812:9
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/libunwind.rs:88
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:76
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:60
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1030
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1412
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:64
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:196
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:210
  10: rustc_driver::report_ice
  11: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:477
  12: std::panicking::begin_panic
  13: rustc_errors::HandlerInner::bug
  14: rustc_errors::Handler::bug
  15: rustc::util::bug::opt_span_bug_fmt::{{closure}}
  16: rustc::ty::context::tls::with_opt::{{closure}}
  17: rustc::ty::context::tls::with_context_opt
  18: rustc::ty::context::tls::with_opt
  19: rustc::util::bug::opt_span_bug_fmt
  20: rustc::util::bug::bug_fmt
  21: rustc::ty::context::validate_hir_id_for_typeck_tables::{{closure}}
  22: rustc::ty::context::tls::with::{{closure}}
  23: rustc::ty::context::tls::with_context::{{closure}}
  24: rustc::ty::context::tls::with_context_opt
  25: rustc::ty::context::tls::with_context
  26: rustc::ty::context::tls::with
  27: rustc::ty::context::TypeckTables::qpath_res
  28: rustc_save_analysis::SaveContext::get_path_res
  29: <rustc_save_analysis::dump_visitor::DumpVisitor as syntax::visit::Visitor>::visit_ty
  30: syntax::visit::walk_generic_args
  31: <rustc_save_analysis::dump_visitor::DumpVisitor as syntax::visit::Visitor>::visit_ty
  32: <rustc_save_analysis::dump_visitor::DumpVisitor as syntax::visit::Visitor>::visit_item
  33: rustc_save_analysis::dump_visitor::DumpVisitor::process_fn::{{closure}}
  34: <rustc_save_analysis::dump_visitor::DumpVisitor as syntax::visit::Visitor>::visit_item
  35: <rustc_save_analysis::dump_visitor::DumpVisitor as syntax::visit::Visitor>::visit_item
  36: <rustc_save_analysis::dump_visitor::DumpVisitor as syntax::visit::Visitor>::visit_mod
  37: rustc::dep_graph::graph::DepGraph::with_ignore
  38: rustc_driver::run_compiler::{{closure}}::{{closure}}::{{closure}}
  39: rustc::util::common::time
  40: rustc_interface::passes::BoxedGlobalCtxt::access::{{closure}}
  41: rustc_interface::passes::create_global_ctxt::{{closure}}
  42: rustc_interface::interface::run_compiler_in_existing_thread_pool
  43: std::thread::local::LocalKey<T>::with
  44: scoped_tls::ScopedKey<T>::set
  45: syntax::with_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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.39.0-nightly (6ef275e6c 2019-09-24) running on x86_64-unknown-linux-gnu

note: compiler flags: -C debuginfo=2 --crate-type lib

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
{"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;9merror\u001b[0m\u001b[0m\u001b[1m: aborting due to previous error\u001b[0m\n\n"}
@jonas-schievink
Copy link
Contributor

looks like #64659

@Centril Centril added A-rls 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. A-save-analysis Area: saving results of analyses such as inference and borrowck results to a file. labels Sep 26, 2019
@pnkfelix
Copy link
Member

pnkfelix commented Oct 3, 2019

cc @Xanewok

@pnkfelix
Copy link
Member

pnkfelix commented Oct 3, 2019

triage: P-high. Removing nomination label.

@pnkfelix pnkfelix added P-high High priority and removed I-nominated labels Oct 3, 2019
@Xanewok Xanewok self-assigned this Oct 4, 2019
@peku33
Copy link

peku33 commented Oct 5, 2019

Easy way to reproduce.

  1. Create empty project
  2. Add hyper = "0.13.0-alpha.4" to dependencies
  3. Run RLS

Errors:
{"message":"src\\librustc\\ty\\context.rs:211: node type <W>::Future (hir_id=HirId { owner: DefIndex(4408), local_id: 28 }) with HirId::owner DefId(0:4408 ~ hyper[bacd]::server[0]::conn[0]::spawn_all[0]::__unpin_scope_State[0]::__UnpinStructState[0]) cannot be placed in TypeckTables with local_id_root DefId(0:4407 ~ hyper[bacd]::server[0]::conn[0]::spawn_all[0]::__unpin_scope_State[0])","code":null,"level":"error: internal compiler error","spans":[],"children":[],"rendered":"error: internal compiler error: src\\librustc\\ty\\context.rs:211: node type <W>::Future (hir_id=HirId { owner: DefIndex(4408), local_id: 28 }) with HirId::owner DefId(0:4408 ~ hyper[bacd]::server[0]::conn[0]::spawn_all[0]::__unpin_scope_State[0]::__UnpinStructState[0]) cannot be placed in TypeckTables with local_id_root DefId(0:4407 ~ hyper[bacd]::server[0]::conn[0]::spawn_all[0]::__unpin_scope_State[0])\n\n"}

And
thread 'rustc' panicked at 'Box<Any>', src\librustc_errors\lib.rs:915:9
note: rustc 1.40.0-nightly (032a53a06 2019-10-03) running on x86_64-pc-windows-msvc

@arturoc
Copy link
Contributor

arturoc commented Oct 18, 2019

although supposedly this has been fixed a couple of days ago, latest nightly rls still crashes on petgraph:

{"message":"src/librustc/ty/context.rs:211: node type <G>::NodeId (hir_id=HirId { owner: DefIndex(3567), local_id: 11 }) with HirId::owner DefId(0:3567 ~ petgraph[7dae]::algo[0]::tarjan_scc[0]::{{impl}}[3]) cannot be placed in TypeckTables with local_id_root DefId(0:980 ~ petgraph[7dae]::algo[0]::tarjan_scc[0])","code":null,"level":"error: internal compiler error","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;9merror: internal compiler error\u001b[0m\u001b[0m\u001b[1m: src/librustc/ty/context.rs:211: node type <G>::NodeId (hir_id=HirId { owner: DefIndex(3567), local_id: 11 }) with HirId::owner DefId(0:3567 ~ petgraph[7dae]::algo[0]::tarjan_scc[0]::{{impl}}[3]) cannot be placed in TypeckTables with local_id_root DefId(0:980 ~ petgraph[7dae]::algo[0]::tarjan_scc[0])\u001b[0m\n\n"}
thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:925:9
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/libunwind.rs:88
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:77
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:61
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1028
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1412
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:65
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:50
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:189
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:206
  10: rustc_driver::report_ice
  11: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:473
  12: std::panicking::begin_panic
  13: rustc_errors::HandlerInner::bug
  14: rustc_errors::Handler::bug
  15: rustc::util::bug::opt_span_bug_fmt::{{closure}}
  16: rustc::ty::context::tls::with_opt::{{closure}}
  17: rustc::ty::context::tls::with_context_opt
  18: rustc::ty::context::tls::with_opt
  19: rustc::util::bug::opt_span_bug_fmt
  20: rustc::util::bug::bug_fmt
  21: rustc::ty::context::validate_hir_id_for_typeck_tables::{{closure}}
  22: rustc::ty::context::tls::with::{{closure}}
  23: rustc::ty::context::tls::with_context::{{closure}}
  24: rustc::ty::context::tls::with_context_opt
  25: rustc::ty::context::tls::with_context
  26: rustc::ty::context::tls::with
  27: rustc::ty::context::TypeckTables::qpath_res
  28: rustc_save_analysis::SaveContext::get_path_res
  29: <rustc_save_analysis::dump_visitor::DumpVisitor as syntax::visit::Visitor>::visit_ty
  30: <rustc_save_analysis::dump_visitor::DumpVisitor as syntax::visit::Visitor>::visit_generics
  31: rustc_save_analysis::dump_visitor::DumpVisitor::process_generic_params
  32: <rustc_save_analysis::dump_visitor::DumpVisitor as syntax::visit::Visitor>::visit_item
  33: <rustc_save_analysis::dump_visitor::DumpVisitor as syntax::visit::Visitor>::visit_item
  34: <rustc_save_analysis::dump_visitor::DumpVisitor as syntax::visit::Visitor>::visit_item
  35: <rustc_save_analysis::dump_visitor::DumpVisitor as syntax::visit::Visitor>::visit_mod
  36: rustc::dep_graph::graph::DepGraph::with_ignore
  37: rustc_driver::run_compiler::{{closure}}::{{closure}}::{{closure}}
  38: rustc_interface::passes::BoxedGlobalCtxt::access::{{closure}}
  39: rustc_interface::passes::create_global_ctxt::{{closure}}
  40: rustc_interface::interface::run_compiler_in_existing_thread_pool
  41: std::thread::local::LocalKey<T>::with
  42: scoped_tls::ScopedKey<T>::set
  43: syntax::with_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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.40.0-nightly (fa0f7d008 2019-10-17) running on x86_64-unknown-linux-gnu

note: compiler flags: -C debuginfo=2 --crate-type lib

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack

@Xanewok
Copy link
Member

Xanewok commented Oct 20, 2019

Chances are this has been fixed with #65511.

Could you please update to the newest nightly now and see if you can reproduce this?

@arturoc
Copy link
Contributor

arturoc commented Oct 22, 2019

yes this is fixed now, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-save-analysis Area: saving results of analyses such as inference and borrowck results to a file. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority 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.

7 participants