Skip to content

vscode rust-analyze always report "Request textDocument/semanticTokens/range failed." #12095

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
jerry-yu opened this issue Apr 27, 2022 · 7 comments
Labels
C-bug Category: bug S-unactionable Issue requires feedback, design decisions or is blocked on other work

Comments

@jerry-yu
Copy link

thread '<unnamed>' panicked at 'overflow depth reached', C:\Users\runneradmin\.cargo\registry\src\github.com-1ecc6299db9ec823\chalk-recursive-0.82.0\src\fixed_point\stack.rs:51:13
stack backtrace:
Panic context:
> 
version: b5d7a712e 2022-04-25 stable
request: textDocument/codeAction CodeActionParams {
    text_document: TextDocumentIdentifier {
        uri: Url {
            scheme: "file",
            cannot_be_a_base: false,
            username: "",
            password: None,
            host: None,
            port: None,
            path: "/d%3A/git_resp/deeper-chain/pallets/staking/src/lib.rs",
            query: None,
            fragment: None,
        },
    },
    range: Range {
        start: Position {
            line: 1286,
            character: 18,
        },
        end: Position {
            line: 1286,
            character: 18,
        },
    },
    context: CodeActionContext {
        diagnostics: [],
        only: None,
    },
    work_done_progress_params: WorkDoneProgressParams {
        work_done_token: None,
    },
    partial_result_params: PartialResultParams {
        partial_result_token: None,
    },
}
@boundless-forest
Copy link

Same Issue. I have reinstalled it again, but it seems not to work.

  • rust-analyzer version: v0.2.1030
  • vscode version: 1.66.2

@Veykril
Copy link
Member

Veykril commented Apr 28, 2022

This is chalk overflowing on your project, its a known problem but not something we can currently fix. You can disable semantic highlighting in your editor to circumvent it constantly crashing.

@lnicola
Copy link
Member

lnicola commented May 22, 2022

Can't reproduce because frame-benchmarking seems to be missing. #12281 might help here.

@lnicola lnicola added S-unactionable Issue requires feedback, design decisions or is blocked on other work C-bug Category: bug labels May 22, 2022
bors added a commit that referenced this issue May 22, 2022
Increase defalt chalk overflow depth to match max solver size

TBC:

 - #12279: ok above 480
 - ~~#12182~~
 - ~~#12095~~
 - #11902: ok above 350
 - ~~#11668~~
 - #11370: ok above 450
 - #9754: probably ok above 250 (!), and the code in cause and branch are gone

Closes #12279
Closes #11902
Closes #11370
Closes #9754
@Veykril
Copy link
Member

Veykril commented Feb 8, 2023

Closing as we have a bunch of chalk overflow issues already

@Veykril Veykril closed this as completed Feb 8, 2023
@briankung
Copy link

briankung commented Dec 29, 2023

I know this has been closed, but I seem to be getting this on a brand new installation of VS Code and rust-analyzer. Disabling semantic highlighting seems to have helped, so this is probably still chalk overflowing?

Click to expand LSP error
Panic context:
> 
version: 0.3.1782-standalone (85fb463fc 2023-12-24)
request: textDocument/semanticTokens/full/delta SemanticTokensDeltaParams {
    work_done_progress_params: WorkDoneProgressParams {
        work_done_token: None,
    },
    partial_result_params: PartialResultParams {
        partial_result_token: None,
    },
    text_document: TextDocumentIdentifier {
        uri: Url {
            scheme: "file",
            cannot_be_a_base: false,
            username: "",
            password: None,
            host: None,
            port: None,
            path: "/some/path.rs",
            query: None,
            fragment: None,
        },
    },
    previous_result_id: "2",
}

thread 'Worker' panicked at /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rust-analyzer-salsa-0.17.0-pre.4/src/interned.rs:107:32:
index out of bounds: the len is 138927 but the index is 4294967039
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic_bounds_check
   3: salsa::interned::InternedStorage<Q>::lookup_value
   4: <DB as hir_expand::db::ExpandDatabase>::lookup_intern_syntax_context
   5: hir_expand::mod_path::resolve_crate_root
   6: hir_expand::mod_path::convert_path
   7: hir_expand::mod_path::convert_path
   8: hir_expand::mod_path::convert_path
   9: hir_expand::mod_path::convert_path
  10: hir_def::item_tree::lower::Ctx::lower_macro_call
  11: hir_def::item_tree::lower::Ctx::lower_mod_item
  12: hir_def::item_tree::ItemTree::file_item_tree_query
  13: salsa::Cycle::catch
  14: salsa::derived::slot::Slot<Q,MP>::execute
  15: salsa::derived::slot::Slot<Q,MP>::read
  16: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::fetch
  17: <DB as hir_def::db::DefDatabase>::file_item_tree
  18: hir_def::nameres::collector::DefCollector::collect_macro_expansion
  19: hir_def::nameres::collector::collect_defs
  20: hir_def::nameres::DefMap::block_def_map_query
  21: salsa::Cycle::catch
  22: salsa::derived::slot::Slot<Q,MP>::execute
  23: salsa::derived::slot::Slot<Q,MP>::read
  24: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::fetch
  25: <DB as hir_def::db::DefDatabase>::block_def_map
  26: hir_def::body::lower::ExprCollector::collect_block_
  27: hir_def::body::lower::ExprCollector::maybe_collect_expr
  28: hir_def::body::lower::ExprCollector::collect_stmt
  29: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
  30: hir_def::body::lower::ExprCollector::collect_block_
  31: hir_def::body::lower::ExprCollector::maybe_collect_expr
  32: hir_def::body::lower::ExprCollector::collect_stmt
  33: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
  34: hir_def::body::lower::ExprCollector::with_label_rib
  35: hir_def::body::lower::ExprCollector::maybe_collect_expr
  36: <alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter
  37: <alloc::boxed::Box<[I]> as core::iter::traits::collect::FromIterator<I>>::from_iter
  38: hir_def::body::lower::ExprCollector::maybe_collect_expr
  39: hir_def::body::lower::ExprCollector::collect_block_
  40: hir_def::body::lower::ExprCollector::maybe_collect_expr
  41: hir_def::body::lower::ExprCollector::collect_expr_opt
  42: hir_def::body::lower::lower
  43: hir_def::body::Body::body_with_source_map_query
  44: salsa::Cycle::catch
  45: salsa::derived::slot::Slot<Q,MP>::execute
  46: salsa::derived::slot::Slot<Q,MP>::read
  47: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::fetch
  48: hir::source_analyzer::SourceAnalyzer::new_for_body
  49: hir::semantics::SemanticsImpl::analyze_impl
  50: ide_db::defs::NameClass::classify
  51: ide::syntax_highlighting::highlight::name_like
  52: ide::syntax_highlighting::traverse
  53: ide::syntax_highlighting::highlight
  54: salsa::Cancelled::catch
  55: rust_analyzer::handlers::request::handle_semantic_tokens_full_delta
  56: std::panicking::try
  57: core::ops::function::FnOnce::call_once{{vtable.shim}}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Error - 12:00:26 PM] Request textDocument/semanticTokens/full/delta failed.
  Message: request handler panicked: index out of bounds: the len is 138927 but the index is 4294967039
  Code: -32603 
Panic context:
> 
version: 0.3.1782-standalone (85fb463fc 2023-12-24)
request: textDocument/semanticTokens/full/delta SemanticTokensDeltaParams {
    work_done_progress_params: WorkDoneProgressParams {
        work_done_token: None,
    },
    partial_result_params: PartialResultParams {
        partial_result_token: None,
    },
    text_document: TextDocumentIdentifier {
        uri: Url {
            scheme: "file",
            cannot_be_a_base: false,
            username: "",
            password: None,
            host: None,
            port: None,
            path: "/some/path.rs",
            query: None,
            fragment: None,
        },
    },
    previous_result_id: "2",
}

thread 'Worker' panicked at /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rust-analyzer-salsa-0.17.0-pre.4/src/interned.rs:107:32:
index out of bounds: the len is 141486 but the index is 4294967039
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic_bounds_check
   3: salsa::interned::InternedStorage<Q>::lookup_value
   4: <DB as hir_expand::db::ExpandDatabase>::lookup_intern_syntax_context
   5: hir_expand::mod_path::resolve_crate_root
   6: hir_expand::mod_path::convert_path
   7: hir_expand::mod_path::convert_path
   8: hir_expand::mod_path::convert_path
   9: hir_expand::mod_path::convert_path
  10: hir_def::item_tree::lower::Ctx::lower_macro_call
  11: hir_def::item_tree::lower::Ctx::lower_mod_item
  12: hir_def::item_tree::ItemTree::file_item_tree_query
  13: salsa::Cycle::catch
  14: salsa::derived::slot::Slot<Q,MP>::execute
  15: salsa::derived::slot::Slot<Q,MP>::read
  16: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::fetch
  17: <DB as hir_def::db::DefDatabase>::file_item_tree
  18: hir_def::nameres::collector::DefCollector::collect_macro_expansion
  19: hir_def::nameres::collector::collect_defs
  20: hir_def::nameres::DefMap::block_def_map_query
  21: salsa::Cycle::catch
  22: salsa::derived::slot::Slot<Q,MP>::execute
  23: salsa::derived::slot::Slot<Q,MP>::read
  24: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::fetch
  25: <DB as hir_def::db::DefDatabase>::block_def_map
  26: hir_def::body::lower::ExprCollector::collect_block_
  27: hir_def::body::lower::ExprCollector::maybe_collect_expr
  28: hir_def::body::lower::ExprCollector::collect_stmt
  29: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
  30: hir_def::body::lower::ExprCollector::collect_block_
  31: hir_def::body::lower::ExprCollector::maybe_collect_expr
  32: hir_def::body::lower::ExprCollector::collect_stmt
  33: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
  34: hir_def::body::lower::ExprCollector::with_label_rib
  35: hir_def::body::lower::ExprCollector::maybe_collect_expr
  36: <alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter
  37: <alloc::boxed::Box<[I]> as core::iter::traits::collect::FromIterator<I>>::from_iter
  38: hir_def::body::lower::ExprCollector::maybe_collect_expr
  39: hir_def::body::lower::ExprCollector::collect_block_
  40: hir_def::body::lower::ExprCollector::maybe_collect_expr
  41: hir_def::body::lower::ExprCollector::collect_expr_opt
  42: hir_def::body::lower::lower
  43: hir_def::body::Body::body_with_source_map_query
  44: salsa::Cycle::catch
  45: salsa::derived::slot::Slot<Q,MP>::execute
  46: salsa::derived::slot::Slot<Q,MP>::read
  47: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::fetch
  48: hir::source_analyzer::SourceAnalyzer::new_for_body
  49: hir::semantics::SemanticsImpl::analyze_impl
  50: ide_db::defs::NameClass::classify
  51: ide::syntax_highlighting::highlight::name_like
  52: ide::syntax_highlighting::traverse
  53: ide::syntax_highlighting::highlight
  54: salsa::Cancelled::catch
  55: rust_analyzer::handlers::request::handle_semantic_tokens_full_delta
  56: std::panicking::try
  57: core::ops::function::FnOnce::call_once{{vtable.shim}}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Error - 12:00:26 PM] Request textDocument/semanticTokens/full/delta failed.
  Message: request handler panicked: index out of bounds: the len is 141486 but the index is 4294967039
  Code: -32603 
Panic context:
> fetch_native_diagnostics

thread 'Worker' panicked at /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rust-analyzer-salsa-0.17.0-pre.4/src/interned.rs:107:32:
index out of bounds: the len is 143722 but the index is 4294967039
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic_bounds_check
   3: salsa::interned::InternedStorage<Q>::lookup_value
   4: <DB as hir_expand::db::ExpandDatabase>::lookup_intern_syntax_context
   5: hir_expand::mod_path::resolve_crate_root
   6: hir_expand::mod_path::convert_path
   7: hir_expand::mod_path::convert_path
   8: hir_expand::mod_path::convert_path
   9: hir_expand::mod_path::convert_path
  10: hir_def::item_tree::lower::Ctx::lower_macro_call
  11: hir_def::item_tree::lower::Ctx::lower_mod_item
  12: hir_def::item_tree::ItemTree::file_item_tree_query
  13: salsa::Cycle::catch
  14: salsa::derived::slot::Slot<Q,MP>::execute
  15: salsa::derived::slot::Slot<Q,MP>::read
  16: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::fetch
  17: <DB as hir_def::db::DefDatabase>::file_item_tree
  18: hir_def::nameres::collector::DefCollector::collect_macro_expansion
  19: hir_def::nameres::collector::collect_defs
  20: hir_def::nameres::DefMap::block_def_map_query
  21: salsa::Cycle::catch
  22: salsa::derived::slot::Slot<Q,MP>::execute
  23: salsa::derived::slot::Slot<Q,MP>::read
  24: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::fetch
  25: <DB as hir_def::db::DefDatabase>::block_def_map
  26: hir_def::body::lower::ExprCollector::collect_block_
  27: hir_def::body::lower::ExprCollector::maybe_collect_expr
  28: hir_def::body::lower::ExprCollector::collect_stmt
  29: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
  30: hir_def::body::lower::ExprCollector::collect_block_
  31: hir_def::body::lower::ExprCollector::maybe_collect_expr
  32: hir_def::body::lower::ExprCollector::collect_stmt
  33: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
  34: hir_def::body::lower::ExprCollector::with_label_rib
  35: hir_def::body::lower::ExprCollector::maybe_collect_expr
  36: <alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter
  37: <alloc::boxed::Box<[I]> as core::iter::traits::collect::FromIterator<I>>::from_iter
  38: hir_def::body::lower::ExprCollector::maybe_collect_expr
  39: hir_def::body::lower::ExprCollector::collect_block_
  40: hir_def::body::lower::ExprCollector::maybe_collect_expr
  41: hir_def::body::lower::ExprCollector::collect_expr_opt
  42: hir_def::body::lower::lower
  43: hir_def::body::Body::body_with_source_map_query
  44: salsa::Cycle::catch
  45: salsa::derived::slot::Slot<Q,MP>::execute
  46: salsa::derived::slot::Slot<Q,MP>::read
  47: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::fetch
  48: hir::DefWithBody::diagnostics
  49: hir::ModuleDef::diagnostics
  50: hir::Module::diagnostics
  51: hir::DefWithBody::diagnostics
  52: hir::Module::diagnostics
  53: ide_diagnostics::diagnostics
  54: salsa::Cancelled::catch
  55: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
  56: <alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter
  57: rust_analyzer::diagnostics::fetch_native_diagnostics
  58: core::ops::function::FnOnce::call_once{{vtable.shim}}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

@lnicola
Copy link
Member

lnicola commented Dec 29, 2023

@briankung #16200

@briankung
Copy link

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug S-unactionable Issue requires feedback, design decisions or is blocked on other work
Projects
None yet
Development

No branches or pull requests

5 participants