-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Rust Analyzer Language Server crashes on big Rust files on VSCode. #18223
Comments
Does "rust-analyzer: Restart server" does not work? |
You are right, it does work, but the extension still crashes with the big file open. |
It is weird the stack is overflowed on this file; it doesn't seem to have particularly deep nesting. This is quite big repository; can you try minimizing it (not necessary, but that will help us)? In particular, try removing all other files and put it at the root and see if it still crashes. |
My hunch would be that this overflows somehow in mir building / interpreting maybe given that works on basic blocks which might be recursive in evaluation? (just guessing here) |
I made a "minimized" repo that still reproduces the issue: https://github.com/AngheloAlf/rust_analyzer_crash let me know if there's anything else I can do to help diagnose this issue. |
Thanks!
I don't think evaluation/building should be recursive, it seems very wrong. I'll take a look at it. @rustbot claim |
The Rust Analyzer extension crashes when opening a big Rust file.
This file is 24000 lines long and only contain test code. I had to move all this test code to its own file because it was messing with the analyzer extension.
The extension works fine if I completely ignore this file and don't open at all.
Here's a link to the file that produces Rust Analyzer to crash: https://github.com/Decompollaborate/rabbitizer/blob/8a429c863e2c451b47bc0fe74a4e6a776f470356/src/rabbitizer/tests/instruction_tests_r4000allegrex.rs
The only "workaround" I can find for the analyzer crashing is to restart the rust analyzer server or restart all vscode extensions by doing
ctrl-shift-P
and selectrust-analyzer: Restart server
orDeveloper: Restart extension host
respectively. After the extension is restarted it will crash again if I still have the file open though.I saw there are other issues mentioning problems with big files (ie #13807 ), but most of them mention OOM or the extension eating all the RAM, but I did not notice any significant difference on the RAM usage when this issue happens.
To reproduce:
🦀
(commit8a429c863e2c451b47bc0fe74a4e6a776f470356
is known to have this issue).src/rabbitizer/tests/instruction_tests_r4000allegrex.rs
file at VSCode.Minimized repo
I made a "minimized" repo that still reproduces the issue: https://github.com/AngheloAlf/rust_analyzer_crash
The problematic file is at https://github.com/AngheloAlf/rust_analyzer_crash/blob/big_file_crash/src/big_tests.rs
When the analyzer crashes vscode shows the following pop-up:
This is all the logs the
OUTPUT
tab has:Versions info
cargo --version
:cargo 1.81.0 (2dbb1af80 2024-08-20)
VSCode version: 1.93.1
rust-analyzer vscode extension version: v0.3.2129
OS: Pop!_OS 22.04
The text was updated successfully, but these errors were encountered: