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

Consistent crash under VSCode, multiplatform #372

Closed
NoraCodes opened this issue Jun 22, 2017 · 12 comments
Closed

Consistent crash under VSCode, multiplatform #372

NoraCodes opened this issue Jun 22, 2017 · 12 comments

Comments

@NoraCodes
Copy link

NoraCodes commented Jun 22, 2017

I have been getting an RLS crash consistently, after entering between five and ten keystrokes, with either the message:

thread '<unnamed>' panicked at 'called Result::unwrap()on anErrvalue: InternalError("Out of bounds access inbyte_in_str")', /checkout/src/libcore/result.rs:860

or a message like:

Missing change, aborting. Found 126, expected Some(132) [Error - 8:14:01 PM] Connection to server got closed. Server will not be restarted.

The numbers change, but aside from that everything is consistent.

My code is:

#[macro_use] extern crate diesel_codegen;
#[macro_use] extern crate diesel;
extern crate dotenv;

pub mod schema;
pub mod models;

use diesel::prelude::*;
use diesel::pg::PgConnection;
use dotenv::dotenv;
use std::env;

pub fn establish_connection() -> PgConnection {
    dotenv().ok();

    let database_url = env::ver("DATABASE_URL")
        .expect("DATABASE_URL must be set");

    PgConnection::establish(&data)
}

Version info:

20:15:40: leo [~/Projects/vvs/vvs-server]
$ cargo -V
cargo 0.19.0 (28d1d60d4 2017-05-16)

20:15:43: leo [~/Projects/vvs/vvs-server]
$ rustc -V
rustc 1.18.0 (03fc9d622 2017-06-06)
@montanonic
Copy link

montanonic commented Jun 22, 2017

I'm having very similar issues within the VSCode Rust extension using Ubuntu 16.04.

Even messing around with a simple Hello World resulted in

Missing change, aborting. Found 2, expected Some(15)
[Error - 11:38:35 PM] Connection to server got closed. Server will not be restarted.

after ~10 keystrokes and 3 saves.

cargo 0.21.0-nightly (d26fd6f08 2017-06-20)
rustc 1.20.0-nightly (622e7e648 2017-06-21)

@wangzishi
Copy link

wangzishi commented Jun 22, 2017

I also have this issue on Windows 10.

vscode-rust 0.4.0
rustc 1.20.0-nightly (622e7e648 2017-06-21)
cargo 0.21.0-nightly (d26fd6f08 2017-06-20)
rls 0.1.0-nightly (d26fd6f 2017-06-20)

@DirtGrubDylan
Copy link

DirtGrubDylan commented Jun 22, 2017

I am having same problem on my Linux box

Linux Mint 18.1 Serena
vscode-rust 0.4.0
rustc 1.20.0-nightly (622e7e648 2017-06-21)
cargo 0.21.0-nightly (d26fd6f08 2017-06-20)
rls 0.1.0-nightly (d26fd6f 2017-06-20)

Error:

Missing change, aborting. Found 2, expected Some(3)
[Error - 3:30:18 PM] Connection to server got closed. Server will not be restarted.

@NoraCodes NoraCodes changed the title Consistent crash on Linux x86_64 Consistent crash under VSCode, multiplatform Jun 22, 2017
@nrc
Copy link
Member

nrc commented Jun 22, 2017

This should be fixed on master now. If you've previously been able to repro, could you try with master?

@dhicksNTIA
Copy link

dhicksNTIA commented Jun 23, 2017

@nrc
I am still getting a crash

Missing change, aborting. Found 2, expected Some(4)
[Error - 12:40:57 PM] Connection to server got closed. Server will not be restarted.

(sorry, this is my work github account)

@ndenev
Copy link

ndenev commented Jun 23, 2017

Same here, crashes with latest nightly and VSCode with errors like this:

Missing change, aborting. Found 17, expected Some(42)
[Error - 9:42:54 PM] Connection to server got closed. Server will not be restarted.

@Xanewok
Copy link
Member

Xanewok commented Jun 24, 2017

Missing change, aborting. error is caused by processing edits out of order. Previously the implementation was (semi-)concurrent, but now it's sequential to conform to LSP spec, and the specific bit restarting the server has been removed in 4971f65. If you're using RLS with rustup, then I think you'll have to wait until rls module is updated there and distributed with the toolchain.

@dodheim
Copy link

dodheim commented Jun 24, 2017

FWIW, I'm using the following combination (Win10 x64) and it's working great:

@nrc
Copy link
Member

nrc commented Jun 25, 2017

Thanks @dodheim . You will need to build from source to get this fix. I'll try and get this into rustup soon...

@nrc nrc closed this as completed Jun 25, 2017
@ashee
Copy link

ashee commented Jun 27, 2017

@dodheim - how do you configure vscode-rust to use rls built from source. Also, the rls binary built from source does not work unless I set the DYLD_LIBRARY_PATH. Is this configurable in the vscode plugin?

rls ashee$ ./target/debug/rls
dyld: Library not loaded: @rpath/librustc_driver-88a96c73e5ca34ca.dylib
  Referenced from: /Users/ashee/opt/rls/./target/debug/rls
  Reason: image not found
Abort trap: 6

Works with explicit DYLD_LIBRARY_PATH

rls ashee$ RUST_BACKTRACE=1 DYLD_LIBRARY_PATH=/Users/ashee/.rustup/toolchains/nightly-x86_64-apple-darwin/lib $HOME/opt/rls/target/debug/rls

@dodheim
Copy link

dodheim commented Jun 27, 2017

@ashee : To use rls built from source I have the following in my settings.json:

"rust.rls": {
    "executable": "cargo",
    "args": ["+nightly", "run", "--manifest-path", "c:/Tools/rls/rls/Cargo.toml", "--release"]
}

N.b. you'll probably want to cargo build --release inside the rls/rls dir before launching VSCode so you can watch RLS' build progress.

Regarding DYLD_LIBRARY_PATH, I'm on Windows so I guess the counterpart would be PATH, and I have indeed altered my path to include %RUSTUP_HOME%/toolchains/nightly-x86_64-pc-windows-msvc/bin; so what you have looks correct to me. As to configuring it inside of VSCode, rust.rls in the settings has an env node, so something like this should work:

"rust.rls": {
    "executable": "cargo",
    "args": ["+nightly", "run", "--manifest-path", "$HOME/opt/rls/Cargo.toml", "--release"],
    "env": { "DYLD_LIBRARY_PATH": "$RUSTUP_HOME/toolchains/nightly-x86_64-apple-darwin/lib" }
}

@ashee
Copy link

ashee commented Jun 27, 2017

@dodheim - perfect! thanks, it works.

bors added a commit that referenced this issue Feb 1, 2019
… r=alexheretic

Bump jsonrpc-core from 9.0.0 to 10.0.1

Bumps [jsonrpc-core](https://github.com/paritytech/jsonrpc) from 9.0.0 to 10.0.1.
<details>
<summary>Release notes</summary>

*Sourced from [jsonrpc-core's releases](https://github.com/paritytech/jsonrpc/releases).*

> ## JSON-RPC v10.0.1
> Fixes documentation links and authors.
>
> ```
> jsonrpc-core = "10.0.1"
> jsonrpc-macros = "10.0.1"
> jsonrpc-derive = "10.0.1"
> jsonrpc-pubsub = "10.0.1"
> jsonrpc-server-utils = "10.0.1"
> jsonrpc-http-server = "10.0.1"
> jsonrpc-ipc-server = "10.0.1"
> jsonrpc-tcp-server = "10.0.1"
> jsonrpc-ws-server = "10.0.1"
> jsonrpc-stdio-server = "10.0.1"
> jsonrpc-test = "10.0.1"
> ```
>
> ## JSON-RPC v10.0.0
> This is an exciting release, because it's the first time we release all parts of the suite to crates.io! So long github dependencies!
>
> Most notable changes:
> 1. Deprecating `jsonrpc-macros` in favour of `jsonrpc-derive` (proc-macro based)
> 2. Rewrting all crates to `edition = 2018`
>
> Other changes:
> - Adding `Metadata` to unsubscribe methods (when they are called explicitly)
> - Derive `Clone` for all `core` types
> - Fix custom bounds on the types in `jsonrpc-macros`
> - Fix charset case sensitivity for http server
>
>
> Full list of changes: paritytech/jsonrpc@v9.0.0...v10.0.0
>
> ```
> jsonrpc-core = "10.0.0"
> jsonrpc-macros = "10.0.0"
> jsonrpc-pubsub = "10.0.0"
> jsonrpc-server-utils = "10.0.0"
> jsonrpc-http-server = "10.0.0"
> jsonrpc-ipc-server = "10.0.0"
> jsonrpc-tcp-server = "10.0.0"
> jsonrpc-ws-server = "10.0.0"
> jsonrpc-stdio-server = "10.0.0"
> jsonrpc-test = "10.0.0"
> ```
</details>
<details>
<summary>Commits</summary>

- [`8ffc7f3`](paritytech/jsonrpc@8ffc7f3) Add jsonrpc-derive details. ([#372](https://github-redirect.dependabot.com/paritytech/jsonrpc/issues/372))
- [`2fe3bfc`](paritytech/jsonrpc@2fe3bfc) One way serialize for subscriber type ([#371](https://github-redirect.dependabot.com/paritytech/jsonrpc/issues/371))
- [`37b62a3`](paritytech/jsonrpc@37b62a3) Migrate to edition 2018 ([#368](https://github-redirect.dependabot.com/paritytech/jsonrpc/issues/368))
- [`5a7be5f`](paritytech/jsonrpc@5a7be5f) Bump version of stdio ([#367](https://github-redirect.dependabot.com/paritytech/jsonrpc/issues/367))
- [`2b47a5c`](paritytech/jsonrpc@2b47a5c) Use parity-ws-rs from crates.io ([#361](https://github-redirect.dependabot.com/paritytech/jsonrpc/issues/361))
- [`8160eb5`](paritytech/jsonrpc@8160eb5) ci: bring appveyor back ([#364](https://github-redirect.dependabot.com/paritytech/jsonrpc/issues/364))
- [`80205d4`](paritytech/jsonrpc@80205d4) Support multiple trailing arguments ([#365](https://github-redirect.dependabot.com/paritytech/jsonrpc/issues/365))
- [`ec5249e`](paritytech/jsonrpc@ec5249e) Use procedural macros  ([#340](https://github-redirect.dependabot.com/paritytech/jsonrpc/issues/340))
- [`789c74d`](paritytech/jsonrpc@789c74d) Derive Clone for all core types::* ([#359](https://github-redirect.dependabot.com/paritytech/jsonrpc/issues/359))
- [`16ed9f5`](paritytech/jsonrpc@16ed9f5) Fix tokio deprecation warnings ([#358](https://github-redirect.dependabot.com/paritytech/jsonrpc/issues/358))
- Additional commits viewable in [compare view](paritytech/jsonrpc@v9.0.0...v10.0.1)
</details>
<br />

[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=jsonrpc-core&package-manager=cargo&previous-version=9.0.0&new-version=10.0.1)](https://dependabot.com/compatibility-score.html?dependency-name=jsonrpc-core&package-manager=cargo&previous-version=9.0.0&new-version=10.0.1)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot ignore this [patch|minor|major] version` will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in the `.dependabot/config.yml` file in this repo:
- Update frequency (including time of day and day of week)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

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

No branches or pull requests

10 participants