Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Compiler panic in unknown dependency #1450

Closed
norru opened this issue May 2, 2019 · 6 comments
Closed

Compiler panic in unknown dependency #1450

norru opened this issue May 2, 2019 · 6 comments

Comments

@norru
Copy link

norru commented May 2, 2019

EDIT: probably a duplicate of #1449

I just did a cargo update to refresh deps (closed source project I cannot share) and since then I am unable to use rls.

I haven't found a way to track which dependency is causing the problem.

cargo build works fine.

rls --cli

{"message":"src/librustc/ty/context.rs:556: node_type: no type for node `expr <Self>::IS_REGULAR (id=76215)`","code":null,"level":"error: internal compiler error","spans":[],"children":[],"rendered":"error: internal compiler error: src/librustc/ty/context.rs:556: node_type: no type for node `expr <Self>::IS_REGULAR (id=76215)`\n\n"}
thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:636:9
stack 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.36.0-nightly (00859e3e6 2019-04-29) 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

   0:     0x7f40d9af4e13 - std::sys::unix::backtrace::tracing::imp::unwind_backtrace::h0d6c439dca72ca11
                               at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
   1:     0x7f40d9aecc9b - std::sys_common::backtrace::_print::hea4ea4af6c4411e1
                               at src/libstd/sys_common/backtrace.rs:71
   2:     0x7f40d9af1076 - std::panicking::default_hook::{{closure}}::hb59690c480567b51
                               at src/libstd/sys_common/backtrace.rs:59
                               at src/libstd/panicking.rs:197
   3:     0x7f40d9af0e09 - std::panicking::default_hook::h0b2c7c1f5ffd3b4c
                               at src/libstd/panicking.rs:211
   4:     0x7f40db57eef0 - rustc::util::common::panic_hook::h843db43ad0cf1382
   5:     0x7f40d9af1868 - std::panicking::rust_panic_with_hook::h711d147cd5e0cf06
                               at src/libstd/panicking.rs:478
   6:     0x7f40da42400c - std::panicking::begin_panic::ha898008710af638b
   7:     0x7f40da43ec8e - rustc_errors::Handler::bug::hf3a8200efe6143d1
   8:     0x7f40db2cdc42 - rustc::util::bug::opt_span_bug_fmt::{{closure}}::hc32a43ddbab80360
   9:     0x7f40db2ccb69 - rustc::ty::context::tls::with_opt::{{closure}}::hdd224f249b19b8fd
  10:     0x7f40db2cca84 - rustc::ty::context::tls::with_context_opt::h3832967f752274c7
  11:     0x7f40db2ccb16 - rustc::ty::context::tls::with_opt::ha1b5a581a82ea24b
  12:     0x7f40db2cdb57 - rustc::util::bug::opt_span_bug_fmt::h593e16e90d210bd5
  13:     0x7f40db2cdac1 - rustc::util::bug::bug_fmt::hb4707b36bd10e7f8
  14:     0x7f40db8b088a - rustc::ty::context::TypeckTables::node_type::{{closure}}::h3b11e279de4ea90e
  15:     0x7f40db8b102a - rustc::ty::context::TypeckTables::expr_ty_adjusted::h32a1e626407aaad5
  16:     0x7f40dc6d7ca5 - rustc_save_analysis::SaveContext::get_expr_data::h78c7ab51d332aff3
  17:     0x7f40dc6c1208 - <rustc_save_analysis::dump_visitor::DumpVisitor<O> as syntax::visit::Visitor>::visit_expr::haba26a253446d0cd
  18:     0x7f40dc6a8751 - rustc_save_analysis::dump_visitor::DumpVisitor<O>::process_assoc_const::h522c23606f1706fc
  19:     0x7f40dc6b1cca - <rustc_save_analysis::dump_visitor::DumpVisitor<O> as syntax::visit::Visitor>::visit_item::h4b3a5450c224ada3
  20:     0x7f40dc6a5efc - rustc_save_analysis::dump_visitor::DumpVisitor<O>::process_method::h5b0729d6a1d55eff
  21:     0x7f40dc6b1dd2 - <rustc_save_analysis::dump_visitor::DumpVisitor<O> as syntax::visit::Visitor>::visit_item::h4b3a5450c224ada3
  22:     0x7f40dc6b454b - <rustc_save_analysis::dump_visitor::DumpVisitor<O> as syntax::visit::Visitor>::visit_item::h4b3a5450c224ada3
  23:     0x7f40dc6b454b - <rustc_save_analysis::dump_visitor::DumpVisitor<O> as syntax::visit::Visitor>::visit_item::h4b3a5450c224ada3
  24:     0x7f40dc6b158b - <rustc_save_analysis::dump_visitor::DumpVisitor<O> as syntax::visit::Visitor>::visit_mod::h6daa1cf87e6c0394
  25:     0x7f40dc6da830 - <rustc_save_analysis::DumpHandler as rustc_save_analysis::SaveHandler>::save::hd40bf9919f17d6d1
  26:     0x7f40dd65368c - rustc::dep_graph::graph::DepGraph::with_ignore::ha94958a6e9181ec7
  27:     0x7f40dd6493f5 - rustc_driver::run_compiler::{{closure}}::{{closure}}::{{closure}}::hd9b442400b8375ac
  28:     0x7f40dd6484a3 - rustc::util::common::time::h5e41458033525ee7
  29:     0x7f40dd631aee - rustc::ty::context::tls::enter_global::h9821e6759f9d2f3a
  30:     0x7f40dd649572 - rustc_interface::passes::BoxedGlobalCtxt::access::{{closure}}::h3271e54ef7e41e4b
  31:     0x7f40dd2b8f44 - rustc_interface::passes::create_global_ctxt::{{closure}}::h1b5279f309d64952
  32:     0x7f40dd64b81a - rustc_interface::interface::run_compiler_in_existing_thread_pool::hcca8ecaeda3badf1
  33:     0x7f40dd6ca5a3 - std::thread::local::LocalKey<T>::with::ha08aa88e11205f04
  34:     0x7f40dd690874 - scoped_tls::ScopedKey<T>::set::h3906ac5daec2139d
  35:     0x7f40dd6c610f - syntax::with_globals::h3460b90a71271dc2
  36:     0x7f40dd624129 - std::sys_common::backtrace::__rust_begin_short_backtrace::h93f92d975520f5fe
  37:     0x7f40d9b02639 - __rust_maybe_catch_panic
                               at src/libpanic_unwind/lib.rs:85
  38:     0x7f40dd63e718 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h7c9983fddd413bcc
  39:     0x7f40d9ad377e - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::hf5407189cfbe0e45
                               at /rustc/00859e3e653973120006aaf3227823062dde1ba7/src/liballoc/boxed.rs:704
  40:     0x7f40d9b012af - std::sys::unix::thread::Thread::new::thread_start::h367a735064fa0a3b
                               at /rustc/00859e3e653973120006aaf3227823062dde1ba7/src/liballoc/boxed.rs:704
                               at src/libstd/sys_common/thread.rs:13
                               at src/libstd/sys/unix/thread.rs:79
  41:     0x7f40d94646da - start_thread
  42:     0x7f40d8f7588e - __clone
  43:                0x0 - <unknown>
query stack during panic:
end of query stack
{"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}

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.36.0-nightly (00859e3e6 2019-04-29) 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

@norru
Copy link
Author

norru commented May 2, 2019

Found this (possible red herring) in logs, is it "message":null expected?

{"jsonrpc":"2.0","method":"window/progress","params":{"done":null,"id":"progress_1","message":null,"percentage":null,"title":"Building"}}

@norru
Copy link
Author

norru commented May 2, 2019

I wasn't able to track the broken dep down so I reverted my Cargo.lock and that fixed the problem at least temporarily.

@akwilhelm
Copy link

Same issue here. My only dependency right now is actix_web (tried "1.0.0-beta.2" and "0.7.19"). The error message says 'actix-http' cannot be compiled.

rustc 1.34.1 (fc50f328b 2019-04-24)
binary: rustc
commit-hash: fc50f328b0353b285421b8ff5d4100966387a997
commit-date: 2019-04-24
host: x86_64-unknown-linux-gnu
release: 1.34.1
LLVM version: 8.0

Backtrace looks the same as above.

@LaylBongers
Copy link

LaylBongers commented May 2, 2019

I seem to be getting the same issue, it's currently preventing me from continuing development. I haven't found a workaround so far.

{"message":"src\\librustc\\ty\\context.rs:541: node_type: no type for node `expr <Self>::NONE (id=24188)`","code":null,"level":"error: internal compiler error","spans":[],"children":[],"rendered":"error: internal compiler error: src\\librustc\\ty\\context.rs:541: node_type: no type for node `expr <Self>::NONE (id=24188)`\n\n"}
thread 'rustc' panicked at 'Box<Any>', src\librustc_errors\lib.rs:620:9
stack backtrace:
   0: std::sys_common::alloc::realloc_fallback
   1: std::panicking::take_hook
   2: std::panicking::take_hook
   3: <rustc::ty::sty::Binder<rustc::ty::ProjectionPredicate<'tcx>> as rustc::ty::ToPredicate<'tcx>>::to_predicate
   4: std::panicking::rust_panic_with_hook
   5: <rustc_errors::emitter::ColorConfig as core::fmt::Debug>::fmt
   6: rustc_errors::Handler::bug
   7: rustc::util::bug::bug_fmt
   8: rustc::ty::wf::object_region_bounds
   9: rustc::ty::wf::object_region_bounds
  10: rustc::ty::wf::object_region_bounds
  11: rustc::util::bug::bug_fmt
  12: rustc::util::bug::bug_fmt
  13: rustc::ty::context::TypeckTables::node_type
  14: rustc::ty::context::TypeckTables::expr_ty_adjusted
  15: rustc_save_analysis::SaveContext::get_expr_data
  16: <unknown>
  17: <unknown>
  18: <unknown>
  19: <unknown>
  20: <unknown>
  21: <unknown>
  22: <rustc_save_analysis::DumpHandler<'a> as rustc_save_analysis::SaveHandler>::save
  23: <env_logger::fmt::WriteStyle as core::default::Default>::default
  24: rustc_driver::enable_save_analysis
  25: rustc_driver::enable_save_analysis
  26: <env_logger::fmt::WriteStyle as core::default::Default>::default
  27: <rustc_driver::CompilationFailure as core::fmt::Debug>::fmt
  28: <rustc_driver::CompilationFailure as core::fmt::Debug>::fmt
  29: <env_logger::fmt::WriteStyle as core::default::Default>::default
  30: rustc_driver::driver::compile_input
  31: rustc_driver::run_compiler
  32: <rustc_driver::CompilationFailure as core::fmt::Debug>::fmt
  33: rustc_driver::run_compiler
  34: git_libgit2_opts
  35: git_libgit2_opts
  36: _rust_maybe_catch_panic
  37: git_libgit2_opts
  38: std::sys::windows::thread::Thread::new
  39: BaseThreadInitThunk
  40: RtlUserThreadStart
query stack during panic:
end of query stack

Edit:
It seems removing my dependency to vk-mem causes RLS to work again, but I'm not sure why.

@hiecaq
Copy link

hiecaq commented May 3, 2019

Reproduced (or maybe not with the same cause) with the following Cargo.toml:

[package]
name = "check"
version = "0.1.0"
authors = ["check <check>"]
edition = "2018"

[dependencies]
clap = "*"

Here is the log of rls --cli:

{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_1","title":"Building"}}
{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_1","message":"clap","title":"Building"}}
{"message":"src/librustc/ty/context.rs:541: node_type: no type for node `expr <Self>::SC_NEGATE_REQS (id=50338)`","code":null,"level":"error: internal compiler error","spans":[],"children":[],"rendered":"error: internal compiler error: src/librustc/ty/context.rs:541: node_type: no type for node `expr <Self>::SC_NEGATE_REQS (id=50338)`\n\n"}
thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:620:9
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
   1: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:70
   2: std::panicking::default_hook::{{closure}}
             at src/libstd/sys_common/backtrace.rs:58
             at src/libstd/panicking.rs:200
   3: std::panicking::default_hook
             at src/libstd/panicking.rs:215
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:482
   6: std::panicking::begin_panic
   7: rustc_errors::Handler::bug
   8: rustc::util::bug::opt_span_bug_fmt::{{closure}}
   9: rustc::ty::context::tls::with_opt::{{closure}}
  10: rustc::ty::context::tls::with_context_opt
  11: rustc::ty::context::tls::with_opt
  12: rustc::util::bug::opt_span_bug_fmt
  13: rustc::util::bug::bug_fmt
  14: rustc::ty::context::TypeckTables::node_type::{{closure}}
  15: rustc::ty::context::TypeckTables::expr_ty_adjusted
  16: rustc_save_analysis::SaveContext::get_expr_data
  17: <rustc_save_analysis::dump_visitor::DumpVisitor<'l, 'tcx, 'll, O> as syntax::visit::Visitor<'l>>::visit_expr
  18: <rustc_save_analysis::dump_visitor::DumpVisitor<'l, 'tcx, 'll, O>>::process_assoc_const
  19: <rustc_save_analysis::dump_visitor::DumpVisitor<'l, 'tcx, 'll, O> as syntax::visit::Visitor<'l>>::visit_item
  20: <rustc_save_analysis::dump_visitor::DumpVisitor<'l, 'tcx, 'll, O>>::process_method
  21: <rustc_save_analysis::dump_visitor::DumpVisitor<'l, 'tcx, 'll, O> as syntax::visit::Visitor<'l>>::visit_item
  22: <rustc_save_analysis::dump_visitor::DumpVisitor<'l, 'tcx, 'll, O> as syntax::visit::Visitor<'l>>::visit_item
  23: <rustc_save_analysis::dump_visitor::DumpVisitor<'l, 'tcx, 'll, O> as syntax::visit::Visitor<'l>>::visit_item
  24: <rustc_save_analysis::dump_visitor::DumpVisitor<'l, 'tcx, 'll, O> as syntax::visit::Visitor<'l>>::visit_mod
  25: <rustc_save_analysis::DumpHandler<'a> as rustc_save_analysis::SaveHandler>::save
  26: rustc::dep_graph::graph::DepGraph::with_ignore
  27: rustc_driver::enable_save_analysis::{{closure}}::{{closure}}
  28: rustc_driver::enable_save_analysis::{{closure}}
  29: rustc::dep_graph::graph::DepGraph::with_ignore
  30: rustc_driver::driver::compile_input::{{closure}}
  31: <std::thread::local::LocalKey<T>>::with
  32: rustc::ty::context::TyCtxt::create_and_enter
  33: rustc_driver::driver::compile_input
  34: rustc_driver::run_compiler_with_pool
  35: <scoped_tls::ScopedKey<T>>::set
  36: rustc_driver::run_compiler
  37: <scoped_tls::ScopedKey<T>>::set
query stack during panic:
end of query stack
{"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}

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.34.1 (fc50f328b 2019-04-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

@norru
Copy link
Author

norru commented May 3, 2019

The culprit has been identified in #1449, closing as dup.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants