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

thread '<unnamed>' panicked at 'not implemented', /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9\src\libstd\macros.rs:13:23 #6120

Closed
Geobert opened this issue Oct 2, 2020 · 15 comments

Comments

@Geobert
Copy link
Contributor

Geobert commented Oct 2, 2020

Yesterday, using VSCode, I don't know why, but RA suddenly stopped working at all. No navigation, no semantic highlighting with this error:

thread '<unnamed>' panicked at 'not implemented', /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9\src\libstd\macros.rs:13:23
stack backtrace:
   0: <unknown>
   1: <unknown>
   2: <unknown>
   3: <unknown>
   4: <unknown>
   5: <unknown>
   6: <unknown>
   7: <unknown>
   8: <unknown>
   9: <unknown>
  10: <unknown>
  11: <unknown>
  12: <unknown>
  13: <unknown>
  14: <unknown>
  15: <unknown>
  16: <unknown>
  17: <unknown>
  18: <unknown>
  19: <unknown>
  20: <unknown>
  21: <unknown>
  22: <unknown>
  23: <unknown>
  24: <unknown>
  25: <unknown>
  26: <unknown>
  27: <unknown>
  28: <unknown>
  29: <unknown>
  30: <unknown>
  31: <unknown>
  32: <unknown>
  33: <unknown>
  34: <unknown>
  35: <unknown>
  36: <unknown>
  37: <unknown>
  38: <unknown>
  39: <unknown>
  40: <unknown>
  41: <unknown>
  42: <unknown>
  43: <unknown>
  44: <unknown>
  45: <unknown>
  46: <unknown>
  47: <unknown>
  48: <unknown>
  49: <unknown>
  50: <unknown>
  51: <unknown>
  52: <unknown>
  53: <unknown>
  54: BaseThreadInitThunk
  55: RtlUserThreadStart
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Panic context:
> request: textDocument/definition GotoDefinitionParams {
    text_document_position_params: TextDocumentPositionParams {
        text_document: TextDocumentIdentifier {
            uri: "file:///c%3A/Users/geobe/work/my_project/src/server.rs",
        },
        position: Position {
            line: 44,
            character: 65,
        },
    },
    work_done_progress_params: WorkDoneProgressParams {
        work_done_token: None,
    },
    partial_result_params: PartialResultParams {
        partial_result_token: None,
    },
}

and in extension host logs, this message multiple times:

[2020-10-01 11:20:32.716] [exthost] [error] [matklad.rust-analyzer] provider FAILED
[2020-10-01 11:20:32.717] [exthost] [error] Canceled: Canceled
	at LanguageClient.makeCancelError (c:\Users\geobe\.vscode\extensions\matklad.rust-analyzer-0.3.331-nightly\out\src\main.js:11804:24)
	at LanguageClient.handleFailedRequest (c:\Users\geobe\.vscode\extensions\matklad.rust-analyzer-0.3.331-nightly\out\src\main.js:11794:28)
	at c:\Users\geobe\.vscode\extensions\matklad.rust-analyzer-0.3.331-nightly\out\src\main.js:14748:28

Then I rollback to stable and is was still broken, but after deleting target/rls it started to work again 😕

As it was working again after deleting the target/rls, I switched to nightly again, and it was working… The "provider FAILED" logs in the extension host logs was still present though.

Today, I updated the nightly like everyday, and it was broken again :-/ same errors in boths logs.

Reverted to stable, and it works even if I get the extensions host log:

[2020-10-02 09:30:16.942] [exthost] [error] [matklad.rust-analyzer] provider FAILED
[2020-10-02 09:30:16.943] [exthost] [error] Canceled: Canceled
	at LanguageClient.makeCancelError (c:\Users\geobe\.vscode\extensions\matklad.rust-analyzer-0.2.328\out\src\main.js:11804:24)
	at LanguageClient.handleFailedRequest (c:\Users\geobe\.vscode\extensions\matklad.rust-analyzer-0.2.328\out\src\main.js:11794:28)
	at c:\Users\geobe\.vscode\extensions\matklad.rust-analyzer-0.2.328\out\src\main.js:14742:28

PS: was posted here as well: https://users.rust-lang.org/t/ra-totally-broken-since-1st-oct-version/49529/7

@Veetaha
Copy link
Contributor

Veetaha commented Oct 2, 2020

Same for me here, started seeing this on today's new nightly version:

rust-analyzer version: nightly (505ff40)

cc #5651

@kjeremy
Copy link
Contributor

kjeremy commented Oct 2, 2020

Are you sue you don't have the rls extension enabled? It's suspicious that deleting the target/rls directory fixed it. Also are you on the latest stable vscode? You may want to compile the extension yourself and enable debug info for a good stack trace.

@Geobert
Copy link
Contributor Author

Geobert commented Oct 3, 2020

I'm pretty sure, I don't know how this target/rls appeared as I stopped using RLS for over a year and I don't recall installing it on my work laptop (new job started in January).

I might be wrong and maybe I've done some test (installing RLS to see something and immediatly uninstall it?) that I don't remember. But it seems very unlikely to me, but plausible

@lnicola
Copy link
Member

lnicola commented Oct 5, 2020

@Geobert did you enable the proc macro support? If so, can you try with #5651?

@Geobert
Copy link
Contributor Author

Geobert commented Oct 5, 2020

@lnicola I don't think so as I didn't know there was such support ^^'

"rust-analyzer.inlayHints.parameterHints": false,
    "rust-analyzer.inlayHints.typeHints": false,
    "rust-analyzer.inlayHints.chainingHints": true,
    "rust-analyzer.updates.askBeforeDownload": false,
    "rust-analyzer.lens.enable": false,
    "rust-analyzer.updates.channel": "stable",

@lnicola
Copy link
Member

lnicola commented Oct 5, 2020

I guess you could try to switch to the nightly channel, so you might get better a better backtrace.

@Geobert
Copy link
Contributor Author

Geobert commented Oct 5, 2020

It was on nightly when I got the issues, I switched back to stable in order to have something that works :)

Switched back to nightly to test:

Panic context:
> request: textDocument/codeAction CodeActionParams {
    text_document: TextDocumentIdentifier {
        uri: "file:///c%3A/Users/geobe/work/my_project/src/server.rs",
    },
    range: Range {
        start: Position {
            line: 190,
            character: 12,
        },
        end: Position {
            line: 191,
            character: 62,
        },
    },
    context: CodeActionContext {
        diagnostics: [],
        only: None,
    },
    work_done_progress_params: WorkDoneProgressParams {
        work_done_token: None,
    },
    partial_result_params: PartialResultParams {
        partial_result_token: None,
    },
}

thread '<unnamed>' panicked at 'not implemented', /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9\src\libstd\macros.rs:13:23
stack backtrace:
   0: <unknown>
   1: <unknown>
   2: <unknown>
   3: <unknown>
   4: <unknown>
   5: <unknown>
   6: <unknown>
   7: <unknown>
   8: <unknown>
   9: <unknown>
  10: <unknown>
  11: <unknown>
  12: <unknown>
  13: <unknown>
  14: <unknown>
  15: <unknown>
  16: <unknown>
  17: <unknown>
  18: <unknown>
  19: <unknown>
  20: <unknown>
  21: <unknown>
  22: <unknown>
  23: <unknown>
  24: <unknown>
  25: <unknown>
  26: <unknown>
  27: <unknown>
  28: <unknown>
  29: <unknown>
  30: <unknown>
  31: <unknown>
  32: <unknown>
  33: <unknown>
  34: <unknown>
  35: <unknown>
  36: <unknown>
  37: <unknown>
  38: <unknown>
  39: <unknown>
  40: <unknown>
  41: <unknown>
  42: <unknown>
  43: <unknown>
  44: <unknown>
  45: <unknown>
  46: <unknown>
  47: <unknown>
  48: <unknown>
  49: <unknown>
  50: <unknown>
  51: BaseThreadInitThunk
  52: RtlUserThreadStart
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

@lnicola
Copy link
Member

lnicola commented Oct 5, 2020

I meant the nightly rust-analyzer version, rust-analyzer.updates.channel.

@Geobert
Copy link
Contributor Author

Geobert commented Oct 5, 2020

Yes, that's what I did :)

@Veetaha
Copy link
Contributor

Veetaha commented Oct 5, 2020

I am afraid this bug has made it to the new stable release.
Here is my stack trace (I have removed particular crate names and paths in the output, because the project is private):

The server logs
[ERROR project_model] cyclic dependency [[REDACTED]]
[ERROR project_model] cyclic dependency [[REDACTED]]
[ERROR project_model] cyclic dependency [[REDACTED]]
[ERROR project_model] cyclic dependency [[REDACTED]]
Panic context:
> request: textDocument/semanticTokens/full SemanticTokensParams {
    work_done_progress_params: WorkDoneProgressParams {
        work_done_token: None,
    },
    partial_result_params: PartialResultParams {
        partial_result_token: None,
    },
    text_document: TextDocumentIdentifier {
        uri: "file:///home/veetaha/[[REDACTED]]",
    },
}

thread '<unnamed>' panicked at 'not implemented', /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9/src/libstd/macros.rs:13:23
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:78
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:59
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1076
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1537
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:62
   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:198
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:217
  10: std::thread::local::LocalKey<T>::with
  11: stdx::panic_context::PanicContext::init::{{closure}}
  12: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:530
  13: std::panicking::begin_panic
  14: chalk_solve::clauses::push_auto_trait_impls
  15: chalk_solve::clauses::builder::ClauseBuilder<I>::push_binders
  16: chalk_solve::clauses::program_clauses_that_could_match
  17: chalk_solve::clauses::program_clauses_for_goal
  18: <chalk_recursive::recursive::Solver<I> as chalk_recursive::solve::SolveDatabase<I>>::solve_goal
  19: chalk_recursive::fulfill::Fulfill<I,Solver,Infer>::prove
  20: chalk_recursive::fulfill::Fulfill<I,Solver,Infer>::solve
  21: <chalk_recursive::recursive::Solver<I> as chalk_recursive::solve::SolveDatabase<I>>::solve_goal
  22: chalk_recursive::fulfill::Fulfill<I,Solver,Infer>::prove
  23: chalk_recursive::fulfill::Fulfill<I,Solver,Infer>::solve
  24: <chalk_recursive::recursive::Solver<I> as chalk_recursive::solve::SolveDatabase<I>>::solve_goal
  25: <chalk_recursive::recursive::RecursiveSolver<I> as chalk_solve::solve::Solver<I>>::solve_limited
  26: hir_ty::traits::trait_solve_query
  27: salsa::runtime::Runtime::execute_query_implementation
  28: salsa::derived::slot::Slot<Q,MP>::read_upgrade
  29: salsa::derived::slot::Slot<Q,MP>::read
  30: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
  31: salsa::QueryTable<Q>::get
  32: <DB as hir_ty::db::HirDatabase>::trait_solve::__shim
  33: <DB as hir_ty::db::HirDatabase>::trait_solve
  34: hir_ty::infer::InferenceContext::resolve_ty_as_possible
  35: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_coerce
  36: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::check_call_arguments
  37: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_method_call
  38: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
  39: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr
  40: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_method_call
  41: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
  42: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr
  43: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_method_call
  44: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
  45: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr
  46: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_method_call
  47: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
  48: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr
  49: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_method_call
  50: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
  51: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
  52: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_coerce
  53: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
  54: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_coerce
  55: hir_ty::infer::infer_query
  56: salsa::runtime::Runtime::execute_query_implementation
  57: salsa::derived::slot::Slot<Q,MP>::read_upgrade
  58: salsa::derived::slot::Slot<Q,MP>::read
  59: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
  60: <DB as hir_ty::db::HirDatabase>::infer_query::__shim
  61: hir_ty::db::infer_wait
  62: hir::source_analyzer::SourceAnalyzer::new_for_body
  63: hir::semantics::SemanticsImpl::analyze2
  64: hir::semantics::SemanticsImpl::resolve_bind_pat_to_const
  65: ide_db::defs::classify_name
  66: ide::syntax_highlighting::highlight_element
  67: ide::syntax_highlighting::highlight
  68: ide::Analysis::highlight
  69: rust_analyzer::handlers::handle_semantic_tokens_full
  70: <F as threadpool::FnBox>::call_box
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

@Geobert
Copy link
Contributor Author

Geobert commented Oct 6, 2020

@Veetaha how did you get this stack trace? Mine is full of <unknown> :-/

@Geobert
Copy link
Contributor Author

Geobert commented Oct 6, 2020

rust-lang/chalk#621

@Veetaha
Copy link
Contributor

Veetaha commented Oct 6, 2020

I don't know, I used the stable build. IIRC only nightlies capture the debug symbols info for better stack traces, but this may have changed

@lnicola
Copy link
Member

lnicola commented Oct 6, 2020

It might be platform-specific. Veetaha is using Linux IIRC, while you're on Windows. MSVC debug symbols are usually in a different file (.pdb), but I don't know what we use to build Windows binaries.

Ameobea added a commit to Ameobea/rust-analyzer that referenced this issue Oct 6, 2020
 * Chalk very recently (like an hour ago) merged a fix that prevents rust analyzer from panicking.  This allows it to be usable again for code that hits those situations.  See rust-lang#6134, rust-lang#6145, Probably rust-lang#6120
bors bot added a commit that referenced this issue Oct 7, 2020
6161: Bump chalk to use latest git to get upstream fix r=jonas-schievink a=Ameobea

 * Chalk very recently (like an hour ago) merged a fix that prevents rust analyzer from panicking.  This allows it to be usable again for code that hits those situations.  See #6134, #6145, Probably #6120

Co-authored-by: Casey Primozic <me@ameo.link>
@Geobert
Copy link
Contributor Author

Geobert commented Oct 8, 2020

It's fixed in e95e666 🥳

@Geobert Geobert closed this as completed Oct 8, 2020
matthewsanetra pushed a commit to matthewsanetra/rust-analyzer that referenced this issue Oct 8, 2020
 * Chalk very recently (like an hour ago) merged a fix that prevents rust analyzer from panicking.  This allows it to be usable again for code that hits those situations.  See rust-lang#6134, rust-lang#6145, Probably rust-lang#6120
matthewsanetra added a commit to matthewsanetra/rust-analyzer that referenced this issue Oct 9, 2020
* Add convert integer literal assist

* Add ability to specify ResolvedAssist by label

* Add tests for convert integer literal assist

* Minor clippy performance suggestions

* Fix path comparison not comparing paths correctly with unequal lengths

* Improve grammar and fix code example in style guide

* Up rustc-ap-rustc_lexer to 681

cargo update as well

* Document Clippy strategy

* Add support of runnables arguments in Rust Analyzer

* Replace 'cargo_prefix' option with 'override_cargo'

* Support 'runnables' options in the vs code extension

* Fix failing test

* Add postfix completion for format-like string literals

* Improve checks for postfix suggestions

* Simplify is_string_literal function

* Add missing entry to doc-comment

* Improve format-like completions code appearance

* Use ast::String for extracting string literal contents

* Use lookup table instead of enum for postfix completion kinds

* Use expect_test to make format_str_parser test more data-driven

* Reduce visibiity

* Expectify find_references tests

* Move ide::AnalysisChange -> base_db::Change

This seems like a better factoring logically; ideally, clients shouldn't touch
`set_` methods of the database directly. Additionally, I think this
should remove the unfortunate duplication in fixture code.

* Rewrite fixtures on top of Change

* Get rid of MockAnalysis

* rename mock_analysis -> fixture

* Add a dash test

* Fix the hover dash issues

* Properly name the field

* Simplify ast_transform

* Correctly complete items with leading underscore

* Better inlay hints in 'for' loops

* Make the tests for complete/incomplete for inlay hints work

* Remove 'for_expr' test from inlay_hints.rs

* Improve readability in inlay_hints.rs

* Trim all trailing whitespace in onEnter

Fixes rust-lang#5848

* Add notes concerning privacy and network access

* Make find_path_prefixed configurable

* Make ImportPrefix a configuration option

* honor content_format clientcap

This removes all markdown when the client does not support the markdown MarkupKind

Otherwise the output on the editor will have some markdown boilerplate, making it less readable

* add docstring

* Fix feature name

* Account for proc macro helpers when parsing attr

* Do not leave braces for colons in dbg!

* Fix trait object hir formatting behind pointer and references

* Smoke test docs generation

* Move ModPath->ast::Path function to IDE layer

closes rust-lang#6092

* add doc describing limited capabilities

* add break after codeblocks

* Constrain ImportMap to only store simple paths

* Shorten type hints for std::iter Iterators

* Add test makr

* Document privacy invariant of SyntaxPtr

* Use FamousDefs for shorten_iterator hint

* Fixed parsing of negative number literals in macros.

* Added unit test for negative number literals in macros.

* Update manual.adoc

* Add validation check for ambiguous trait objects

* Bump chalk to use latest git to get fix

 * Chalk very recently (like an hour ago) merged a fix that prevents rust analyzer from panicking.  This allows it to be usable again for code that hits those situations.  See rust-lang#6134, rust-lang#6145, Probably rust-lang#6120

* `todo!()` -> `unimplemented!() // FIXME` for CI

* Make unimplemented match variants explicit

* Move IntoIterator into FamousDefs

* Shorten iterator chain hints

* Cleanup

* Shorten iterator hints for std::iter iterators behind references

* Better progress API

Percentage is a UI concern, the physical fact here is fraction. It's
sad that percentage bleeds into the protocol level, we even duplicated
this bad API ourselves!

* Reorg style

* Add comparisons guideline to style

* minor

* minor

* Clean up inlay_hints

* Switch from git to latest tagged release of chalk deps

* Add track_env_var to the proc macro server

* Bump rustc_lexer, cfg-if to 1.0 and add new license to check

* add eprintln in fmt-like postfix

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>

* Fix source_to_def for named enum variant fields

* Add note if RUST_SRC_PATH is likely to be wrong

* Update crates/project_model/src/sysroot.rs

Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>

* Remove release build overrides

* Treat `ast::Name` in field patterns as use

* adt: correctly inherit field visibility from enum

Previously, "find all references" on a variant field wouldn't find any
references outside the defining module. This is because variant fields
were incorrectly assumed to be private, like struct fields without
explicit visibility, but they actually inherit the enum's visibility.

Co-authored-by: vlakreeh <zeb@zebulon.dev>
Co-authored-by: kjeremy <kjeremy@gmail.com>
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
Co-authored-by: bors[bot] <26634292+bors[bot]@users.noreply.github.com>
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Co-authored-by: Igor Aleksanov <popzxc@yandex.ru>
Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
Co-authored-by: León Orell Valerian Liehr <liehr.exchange@gmx.net>
Co-authored-by: Wesley Norris <repnop@outlook.com>
Co-authored-by: Robin van Dijk <robin@robinjint.nl>
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Co-authored-by: Tim <tim@glacyr.com>
Co-authored-by: Adrian Stanciu <stanciu.adrian@gmail.com>
Co-authored-by: Casey Primozic <me@ameo.link>
Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
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

4 participants