rust-lang / rust-lang/rust-analyzer

thread '<unknown>' has overflowed its stack v0.3.1657-standalone (async-std v1.10.0)

Open
#15,613 1 comment 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug I-crash
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

Could be related to (or possibly the same as) #14698 but I'm raising a new issue as it's a different version and a significant time gap.

This error occurred during indexing, even with no files open.

thread '<unknown>' has overflowed its stack
fatal runtime error: stack overflow
[Info  - 16:59:13] Connection to server got closed. Server will restart.

Last message in verbose trace

[Trace - 17:00:24] Received notification '$/progress'.
Params: {
    "token": "rustAnalyzer/Indexing",
    "value": {
        "kind": "report",
        "cancellable": false,
        "message": "51/63 (async_std)",
        "percentage": 80
    }
}

After crashing 5 times vscode stops trying to start rust analyzer.

It always seems to be failing on async_std

In my cargo.toml file I had
async-std = "1.9.0"
I've changed this to
async-std = "1.12"

My cargo.lock file went from:

[package]]
name = "async-std"
version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8056f1455169ab86dd47b47391e4ab0cbd25410a70e9fe675544f49bafaf952"

to

[[package]]
name = "async-std"
version = "1.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d"

This change seems to have resolved the problem for that project.

I don't have an exact replication yet, but is happening for me on a publically accessible project if that helps...
https://github.com/openmsupply/notify/commit/81b2fe152dccd2db1b30ba8ed8499489810b09b5

rust-analyzer version: (eg. output of "rust-analyzer: Show RA Version" command, accessible in VSCode via Ctrl/⌘+Shift+P)
0.3.1657-standalone (326f37ef1 2023-09-10)

rustc version: (eg. output of rustc -V)
rustc 1.72.0 (5680fa18f 2023-08-23)
and
rustc 1.65.0 (897e37553 2022-11-02)

relevant settings: (eg. client settings, or environment variables like CARGO, RUSTC, RUSTUP_HOME or CARGO_HOME)

Hardware/Software:
Model Name: MacBook Pro
Chip: `Apple M1 Pro
System Version: macOS 12.6.1 (21G217)
Kernel Version: Darwin 21.6.0

I am unable to replicate on my intel mac with ...
rustc 1.65.0 (897e37553 2022-11-02)

Model Name: MacBook Air
Processor Name: Quad-Core Intel Core i5
System Version: macOS 12.6.7 (21G651)
Kernel Version: Darwin 21.6.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by indexing the public openmsupply/notify project at commit 81b2fe152dccd2db1b30ba8ed8499489810b09b5 with the reported rust-analyzer version, then compare async-std 1.10.0 and 1.12.0 using the verbose trace. The issue is resolved when indexing no longer causes the rust-analyzer server to stack-overflow and restart.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.