Skip to content

Language server keeps crashing #13343

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

Closed
RalfJung opened this issue Oct 4, 2022 · 5 comments
Closed

Language server keeps crashing #13343

RalfJung opened this issue Oct 4, 2022 · 5 comments

Comments

@RalfJung
Copy link
Member

RalfJung commented Oct 4, 2022

I keep getting this error in the logs when working on Miri -- this just started today, no idea what went wrong:

thread 'LspServer' panicked at 'index out of bounds: the len is 410 but the index is 428', crates/project-model/src/workspace.rs:857:29
stack backtrace:
   0: rust_begin_unwind
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/panicking.rs:142:14
   2: core::panicking::panic_bounds_check
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/panicking.rs:84:5
   3: project_model::workspace::ProjectWorkspace::to_crate_graph
   4: rust_analyzer::reload::<impl rust_analyzer::global_state::GlobalState>::switch_workspaces
   5: rust_analyzer::main_loop::<impl rust_analyzer::global_state::GlobalState>::handle_task
   6: rust_analyzer::main_loop::<impl rust_analyzer::global_state::GlobalState>::handle_event
   7: rust_analyzer::main_loop::<impl rust_analyzer::global_state::GlobalState>::run
   8: rust_analyzer::main_loop::main_loop
   9: rust_analyzer::run_server
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: "SendError(..)"', lib/lsp-server/src/stdio.rs:29:37
stack backtrace:
   0: rust_begin_unwind
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/panicking.rs:142:14
   2: core::result::unwrap_failed
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/result.rs:1814:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Info  - 10:33:47 AM] Connection to server got closed. Server will restart.
thread 'LspServer' panicked at 'index out of bounds: the len is 410 but the index is 428', crates/project-model/src/workspace.rs:857:29
stack backtrace:
   0: rust_begin_unwind
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/panicking.rs:142:14
   2: core::panicking::panic_bounds_check
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/panicking.rs:84:5
   3: project_model::workspace::ProjectWorkspace::to_crate_graph
   4: rust_analyzer::reload::<impl rust_analyzer::global_state::GlobalState>::switch_workspaces
   5: rust_analyzer::main_loop::<impl rust_analyzer::global_state::GlobalState>::handle_task
   6: rust_analyzer::main_loop::<impl rust_analyzer::global_state::GlobalState>::handle_event
   7: rust_analyzer::main_loop::<impl rust_analyzer::global_state::GlobalState>::run
   8: rust_analyzer::main_loop::main_loop
   9: rust_analyzer::run_server
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: "SendError(..)"', lib/lsp-server/src/stdio.rs:29:37
stack backtrace:
   0: rust_begin_unwind
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/panicking.rs:142:14
   2: core::result::unwrap_failed
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/result.rs:1814:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Info  - 10:33:49 AM] Connection to server got closed. Server will restart.

rust-analyzer version: rust-analyzer version: 0.3.1229-standalone

rustc version: rustc 1.66.0-nightly (744e397d8 2022-10-01)

relevant settings:

    "rust-analyzer.rustc.source": "discover",
    "rust-analyzer.linkedProjects": [
        "./Cargo.toml",
        "./cargo-miri/Cargo.toml"
    ],
    "rust-analyzer.checkOnSave.overrideCommand": [
        "./miri",
        "cargo",
        "clippy",
        "--message-format=json"
    ],
    // Contrary to what the name suggests, this also affects proc macros.
    "rust-analyzer.cargo.buildScripts.overrideCommand": [
        "./miri",
        "cargo",
        "check",
        "--message-format=json",
    ],

global settings:

    "rust-analyzer.lens.enable": false,
    "rust-analyzer.cargo.buildScripts.useRustcWrapper": false,
    "rust-analyzer.cargo.buildScripts.enable": false,
    "rust-analyzer.procMacro.enable": false,
    //
    "rust-analyzer.diagnostics.disabled": [
        "unlinked-file", // I guess for "normal" projects unlinked files are strange, for me they are common
        "unresolved-module", // https://github.com/rust-lang/rust-analyzer/issues/9173
        "unresolved-extern-crate", // https://github.com/rust-lang/rust-analyzer/issues/12926
        "type-mismatch", // https://github.com/rust-lang/rust-analyzer/issues/1109
    ],
@lnicola
Copy link
Member

lnicola commented Oct 4, 2022

Probably a dupe of #13340.

@RalfJung
Copy link
Member Author

RalfJung commented Oct 4, 2022

Sounds likely.

Can I somehow get a working RA without waiting for that fix to ship?

@Veykril
Copy link
Member

Veykril commented Oct 4, 2022

I kicked off a nightly release https://github.com/rust-lang/rust-analyzer/actions/runs/3180665075

Otherwise you can downgrade to the previous stable, or a nightly from ~4 days ago in VSCode by clicking on the Uninstall down arrow
image

@RalfJung
Copy link
Member Author

RalfJung commented Oct 4, 2022

Downgrading to a previous stable version worked, thanks a lot. :)

@Veykril
Copy link
Member

Veykril commented Oct 4, 2022

Meanwhile nightly releases are failing still
Edit: Another chalk panic, only happening on analysis-stats for sdt it seems?

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

No branches or pull requests

3 participants