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

Constant PoisonErrors #750

Closed
lovesegfault opened this issue Mar 5, 2018 · 4 comments
Closed

Constant PoisonErrors #750

lovesegfault opened this issue Mar 5, 2018 · 4 comments
Labels

Comments

@lovesegfault
Copy link

lovesegfault commented Mar 5, 2018

I haven't used Rust in a few weeks, so yesterday I updated my toolchain and started a new project. I use VSCode with the official RLS extension, both of which are at the latest version.

$ rustup update
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
   stable-x86_64-unknown-linux-gnu unchanged - rustc 1.24.1 (d3ae9a9e0 2018-02-27)
  nightly-x86_64-unknown-linux-gnu unchanged - rustc 1.26.0-nightly (259e4a678 2018-03-04)
$ code --version
1.20.1
f88bbf9137d24d36d968ea6b2911786bfe103002
x64

In trying to write even the simplest code, RLS constantly crashes with the following error, grabbed from VSCode's Output window:

thread '<unnamed>' panicked at 'no entry found for key', libcore/option.rs:917:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "PoisonError { inner: .. }"', libcore/result.rs:945:5

It happens constantly, independent of which project I am editing, and causes RLS to crash. Also, whenever I have an open file and I'm in the midst of writing something, say I type fn foo( and go get more tea, it ramps my CPU usage to 100% while I don't make it syntactically correct.

Edit: Apparently it causes the whole Extension Host to crash as well.

@nrc
Copy link
Member

nrc commented Mar 8, 2018

Could you try running with RUST_BACKTRACE=1 to get a backtrace please? The relevant error is the 'no entry found for key' one, the poison errors are just an effect of the earlier one. Also, what project are you editing?

@nrc nrc added the bug label Mar 8, 2018
@kamyuentse
Copy link

kamyuentse commented Mar 8, 2018

Same here:

thread '<unnamed>' panicked at 'no entry found for key', libcore/option.rs:917:5
stack backtrace:
   0:        0x113327573 - std::sys::unix::backtrace::tracing::imp::unwind_backtrace::hc7e7373e4b839c9b
   1:        0x11331e682 - std::sys_common::backtrace::_print::h6a4974acad20e757
   2:        0x113323f7d - std::panicking::default_hook::{{closure}}::h78c62f8e395d91c7
   3:        0x113323c08 - std::panicking::default_hook::h907911f1269dc7bf
   4:        0x1118f34c0 - core::ops::function::Fn::call::had89f3dbf8bade74
   5:        0x113324440 - std::panicking::rust_panic_with_hook::h8ce3bca5760f9a14
   6:        0x11332423a - std::panicking::begin_panic_fmt::hcd1bdff30aebfae7
   7:        0x113324132 - rust_begin_unwind
   8:        0x11337f375 - core::panicking::panic_fmt::h3a5d7d1561eabb2a
   9:        0x11337f3e8 - core::option::expect_failed::h79bc204e6880241e
  10:        0x10f75d23f - rls::build::plan::Plan::prepare_work::h1ce43ba631af6e15
  11:        0x10f760046 - rls::build::Internals::run_build::h2cc49a6f84506a06
  12:        0x10f64a50b - std::sys_common::backtrace::__rust_begin_short_backtrace::heab24dcd036098a7
  13:        0x11333f2ae - __rust_maybe_catch_panic
  14:        0x10f6ca40f - <F as alloc::boxed::FnBox<A>>::call_box::h71e7bf5f02600718
  15:        0x113333f1b - std::sys::unix::thread::Thread::new::thread_start::hc558e44d3000c9fa
  16:     0x7fff6649d6c0 - _pthread_body
  17:     0x7fff6649d56c - _pthread_start
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "PoisonError { inner: .. }"', libcore/result.rs:945:5
stack backtrace:
   0:        0x113327573 - std::sys::unix::backtrace::tracing::imp::unwind_backtrace::hc7e7373e4b839c9b
   1:        0x11331e682 - std::sys_common::backtrace::_print::h6a4974acad20e757
   2:        0x113323f7d - std::panicking::default_hook::{{closure}}::h78c62f8e395d91c7
   3:        0x113323c08 - std::panicking::default_hook::h907911f1269dc7bf
   4:        0x1118f34c0 - core::ops::function::Fn::call::had89f3dbf8bade74
   5:        0x113324440 - std::panicking::rust_panic_with_hook::h8ce3bca5760f9a14
   6:        0x11332423a - std::panicking::begin_panic_fmt::hcd1bdff30aebfae7
   7:        0x113324132 - rust_begin_unwind
   8:        0x11337f375 - core::panicking::panic_fmt::h3a5d7d1561eabb2a
   9:        0x10f6c887f - core::result::unwrap_failed::h905f4c1cea1445ec
  10:        0x10f75ec72 - rls::build::BuildQueue::request_build::h393f6d93bee23cbf
  11:        0x10f740d1b - rls::actions::InitActionContext::build_current_project::h33d71442d9b4bb2e
  12:        0x10f78e54a - <rls::server::LsService<O>>::dispatch_message::hb04b01480cb399d5
  13:        0x10f79b816 - rls::main::h286de24f3dde7ae1
  14:        0x10f64b7b5 - std::rt::lang_start::{{closure}}::hbc03afc0e9e830d1
  15:        0x113324097 - std::panicking::try::do_call::ha563b1ad4e069264
  16:        0x11333f2ae - __rust_maybe_catch_panic
  17:        0x11332476d - std::rt::lang_start_internal::h0fed5c2d94673dee
  18:        0x10f7b920b - main

I don't know which RPC request cause these panic, but the two panic reason shown above occurred repeatedly.

Edit: I got some output before rls panic:

error: expected identifier, found keyword `in`
 --> bogofile:1:5
  |
1 | use in
  |     ^^

thread '<unnamed>' panicked at 'no entry found for key', libcore/option.rs:917:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "PoisonError { inner: .. }"', libcore/result.rs:945:5

@nrc
Copy link
Member

nrc commented Mar 16, 2018

The error in the backtrace here is due to a bad lookup in a HashMap. There are only two places that can happen, I think: line 328: self.compiler_jobs[x] and line 231: self.rev_dep_graph[&top].

@nrc
Copy link
Member

nrc commented Apr 19, 2018

I believe this is fixed now (with latest nightly RLS), please comment if not and I'll re-open

@nrc nrc closed this as completed Apr 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants