Rust-analyzer: Rust-Analyzer suddenly stopped working

Created on 22 Jun 2020  ยท  30Comments  ยท  Source: rust-analyzer/rust-analyzer

Environment:

  • WSL2 running Ubuntu 20.04
  • Vscode 1.46.1
  • RA 0.2.215

Hi there, I've been using rust-analyzer for a long time and it suddenly crashed on me after pressing update on vscode. The first thing I did was clean-reinstalling the extension which didn't work. Then, I clean installed vscode itself. Rust-analyzer still wouldn't activate.

After some searching, I found out how to enable logging in settings.json, and here's a picture on what the developer console showed me

image

I tried running /home/kingbri/.vscode-server/data/User/globalStorage/matklad.rust-analyzer/rust-analyzer-linux --version
in my terminal and this was the output: -bash: /home/kingbri/.vscode-server/data/User/globalStorage/matklad.rust-analyzer/rust-analyzer-linux: cannot execute binary file: Exec format error

What can I do to fix this issue? Thanks in advance for your help

Most helpful comment

This won't take a week, we will publish a patch today-or-tomorrow https://github.com/rust-analyzer/rust-analyzer/pull/4989#issuecomment-647668226

All 30 comments

Can you try running file /home/kingbri/.vscode-server/data/User/globalStorage/matklad.rust-analyzer/rust-analyzer-linux?

@lnicola here's the output

/home/kingbri/.vscode-server/data/User/globalStorage/matklad.rust-analyzer/rust-analyzer-linux: data

Sounds like it's corrupted. Can you remove that file and try again?

Vscode prompted me to download the binary again. Same error still pops up and same output from the file command

Can you upload that file somewhere?

CC @Veetaha.

Here's the file

Dropbox Link

Same problem happen to me.
If I execute the command /home/kyasbal/.config/Code/User/globalStorage/matklad.rust-analyzer/rust-analyzer-linux --version directly, I could get an interesting log.

/home/kyasbal/.config/Code/User/globalStorage/matklad.rust-analyzer/rust-analyzer-linux: 1: Syntax error: ")" unexpected

I think this is just a --version for rust-analyzer, so I guess this command won't check syntax error of my code. I suspect this error happened inside of the command.

@bdashore3 weird, you file is indeed not executable. Can you download it manually from here and put it in the same location? https://github.com/rust-analyzer/rust-analyzer/releases/tag/2020-06-22

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚00000000โ”‚ f7 e1 81 45 79 ab 43 9f โ”Š 90 91 bb ce c3 3d 4c ed โ”‚ร—ร—ร—Eyร—Cร—โ”Šร—ร—ร—ร—ร—=Lร—โ”‚
โ”‚00000010โ”‚ 9e 36 a4 cc 2f ca 65 19 โ”Š d0 ce ec 27 c0 03 44 ac โ”‚ร—6ร—ร—/ร—eโ€ขโ”Šร—ร—ร—'ร—โ€ขDร—โ”‚
โ”‚00000020โ”‚ 4b 51 74 ab 14 47 64 c2 โ”Š 2d 17 ed df ca ce ee 81 โ”‚KQtร—โ€ขGdร—โ”Š-โ€ขร—ร—ร—ร—ร—ร—โ”‚
โ”‚00000030โ”‚ a2 3b 46 83 a8 0d d6 3d โ”Š ee 29 9f c7 43 63 16 5e โ”‚ร—;Fร—ร—_ร—=โ”Šร—)ร—ร—Ccโ€ข^โ”‚
โ”‚00000040โ”‚ 84 4e 66 ca 91 62 8f 19 โ”Š 92 e8 18 52 33 3a b0 93 โ”‚ร—Nfร—ร—bร—โ€ขโ”Šร—ร—โ€ขR3:ร—ร—โ”‚
โ”‚00000050โ”‚ b1 b6 88 85 22 08 28 d0 โ”Š 98 65 38 03 ec 8c e9 43 โ”‚ร—ร—ร—ร—"โ€ข(ร—โ”Šร—e8โ€ขร—ร—ร—Cโ”‚
โ”‚00000060โ”‚ 7e 9d 10 4e 22 05 f1 1a โ”Š 28 f1 22 01 a4 f3 72 b1 โ”‚~ร—โ€ขN"โ€ขร—โ€ขโ”Š(ร—"โ€ขร—ร—rร—โ”‚
โ”‚00000070โ”‚ fb 52 93 39 32 91 e3 ed โ”Š 35 19 7d 00 81 5b 45 5f โ”‚ร—Rร—92ร—ร—ร—โ”Š5โ€ข}0ร—[E_โ”‚
โ”‚00000080โ”‚ a1 d9 0f 9e f5 47 56 3e โ”Š d3 67 16 6a a2 3d c6 1b โ”‚ร—ร—โ€ขร—ร—GV>โ”Šร—gโ€ขjร—=ร—โ€ขโ”‚
โ”‚00000090โ”‚ dd 3d 3e 44 26 bf 57 2e โ”Š 4b 30 90 75 2d 46 a0 ed โ”‚ร—=>D&ร—W.โ”ŠK0ร—u-Fร—ร—โ”‚
โ”‚000000a0โ”‚ 73 82 c0 a1 4c e4 b0 8c โ”Š 0e ab 51 28 81 d6 60 0d โ”‚sร—ร—ร—Lร—ร—ร—โ”Šโ€ขร—Q(ร—ร—`_โ”‚
โ”‚000000b0โ”‚ 95 b1 01 c6 ac 24 42 0c โ”Š bd 42 2a dc 40 8f 93 d6 โ”‚ร—ร—โ€ขร—ร—$B_โ”Šร—B*ร—@ร—ร—ร—โ”‚
โ”‚000000c0โ”‚ 82 23 ea bf c7 9a 43 d9 โ”Š 6b 18 85 1f 33 9a 1c 56 โ”‚ร—#ร—ร—ร—ร—Cร—โ”Škโ€ขร—โ€ข3ร—โ€ขVโ”‚
โ”‚000000d0โ”‚ 2f bb 84 71 0e 19 1c 30 โ”Š 27 89 7d 8d f2 9f 96 07 โ”‚/ร—ร—qโ€ขโ€ขโ€ข0โ”Š'ร—}ร—ร—ร—ร—โ€ขโ”‚
โ”‚000000e0โ”‚ 93 ed 26 be 06 75 66 98 โ”Š 58 0e 0f de 14 69 80 95 โ”‚ร—ร—&ร—โ€ขufร—โ”ŠXโ€ขโ€ขร—โ€ขiร—ร—โ”‚
โ”‚000000f0โ”‚ 8a d1 b8 b7 05 85 31 79 โ”Š f2 2f 70 24 f1 9c 80 b4 โ”‚ร—ร—ร—ร—โ€ขร—1yโ”Šร—/p$ร—ร—ร—ร—โ”‚
โ”‚00000100โ”‚ a6 db 10 32 8a d8 88 ee โ”Š d8 f2 f1 b3 3a a4 62 60 โ”‚ร—ร—โ€ข2ร—ร—ร—ร—โ”Šร—ร—ร—ร—:ร—b`โ”‚
โ”‚00000110โ”‚ 74 8e 7a 22 57 2a 82 68 โ”Š 67 4f 73 53 46 47 33 ac โ”‚tร—z"W*ร—hโ”ŠgOsSFG3ร—โ”‚
โ”‚00000120โ”‚ eb 06 8c 9b 98 09 0c f4 โ”Š 56 83 0c 3a c6 3a 1d 36 โ”‚ร—โ€ขร—ร—ร—__ร—โ”ŠVร—_:ร—:โ€ข6โ”‚
โ”‚00000130โ”‚ a4 4a 34 a5 f7 61 cc 72 โ”Š 68 43 d4 bf f5 08 bc 50 โ”‚ร—J4ร—ร—aร—rโ”ŠhCร—ร—ร—โ€ขร—Pโ”‚
โ”‚00000140โ”‚ 41 61 c4 11 7c 72 0d c4 โ”Š 7e fa 76 2a 54 6a d6 d8 โ”‚Aaร—โ€ข|r_ร—โ”Š~ร—v*Tjร—ร—โ”‚
โ”‚00000150โ”‚ 48 f7 7e 28 29 fe de 4e โ”Š 00 fd 1f 52 91 8c ce 38 โ”‚Hร—~()ร—ร—Nโ”Š0ร—โ€ขRร—ร—ร—8โ”‚
โ”‚00000160โ”‚ 13 7c 4e 28 9b 4c 6e ca โ”Š 96 a1 37 39 c2 57 c8 0d โ”‚โ€ข|N(ร—Lnร—โ”Šร—ร—79ร—Wร—_โ”‚
โ”‚00000170โ”‚ 52 88 80 35 fe b0 11 1d โ”Š dd 16 31 b2 cb d4 32 54 โ”‚Rร—ร—5ร—ร—โ€ขโ€ขโ”Šร—โ€ข1ร—ร—ร—2Tโ”‚
โ”‚00000180โ”‚ 12 c9 6a 30 74 9a 72 d2 โ”Š 6f f2 a2 bf 82 09 a3 2e โ”‚โ€ขร—j0tร—rร—โ”Šoร—ร—ร—ร—_ร—.โ”‚
โ”‚00000190โ”‚ 1c ff 62 81 d3 f6 e2 19 โ”Š 65 b8 da a5 23 b7 4b 2e โ”‚โ€ขร—bร—ร—ร—ร—โ€ขโ”Šeร—ร—ร—#ร—K.โ”‚
โ”‚000001a0โ”‚ 7b 9b 45 92 95 76 35 b9 โ”Š b3 fe 56 3d 14 aa 36 b0 โ”‚{ร—Eร—ร—v5ร—โ”Šร—ร—V=โ€ขร—6ร—โ”‚
โ”‚000001b0โ”‚ 61 4b 0e 08 63 f8 c6 dd โ”Š e3 4c f7 ad e8 10 8e e6 โ”‚aKโ€ขโ€ขcร—ร—ร—โ”Šร—Lร—ร—ร—โ€ขร—ร—โ”‚
โ”‚000001c0โ”‚ 8f da 5e c9 7e 51 df 6c โ”Š 0a b2 c0 22 ee 96 19 56 โ”‚ร—ร—^ร—~Qร—lโ”Š_ร—ร—"ร—ร—โ€ขVโ”‚

It's also 27 949 394 instead of 27 966 344 bytes.

The vsix package or linux executable?

The linux exe

@kyasbal-1994 can you run file and ls -l on /home/kyasbal/.config/Code/User/globalStorage/matklad.rust-analyzer/rust-analyzer-linux and possibly upload it somewhere if it doesn't show up as rust-analyzer-linux: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=df68b161b4040e76f637e26e634244c2e2b073d6, stripped?

@bdashore3 the Linux executable. Make sure to run chmod +x on it, though.

Will do, I'll show the results once I get them

@lnicola Sure I will do that and report.

Anyway rust-analyzer works well if I downgraded to 0.2.207 which is the last version available on visual studio code extension menu. If there are someone just want to run rust-analyzer, you can use following link to downgrade the extension.
https://stackoverflow.com/questions/42626065/vs-code-rollback-extension-install-specific-extension-version

This might be related to #4963. I am not sure how tmp dir might affect the binary on WSL

@Inicola rust-analyzer --version works perfectly on the linux executable

@Veetaha Same issue happens on windows as well

Okay, thanks, I'll need to check this

This is weird. I downgrade rust-analyzer to previous version and updated again. Then it works with the latest version and rust-analyzer-linux seems to be valid Linux ELF binary.

@kyasbal-1994 should have tried that before :-).

It still errors out for me when downgrading/upgrading with the same error

It still errors out for me when downgrading/upgrading with the same error

Did you download rust-analyzer server after downgrading extension?

Yes, I did. The downgrade works perfectly, it's only version 0.2.215 that errors out

The file @bdashore3 uploaded is missing the first 16 950 bytes.

Downgrading worked for me as well.

I tried to remove rust-analyzer-mac but reinstalling the extension didn't trigger an installation of the binary.

I found the problem, we need a hotfix. We do skip the first chunks of the file....

This is very wierd beause on my machine (Ubuntu) it works even now, only in Windows Virtualbox this happens...

Running VSCode 1.46.1 on PopOs 20.04 which is based on Ubuntu 20.04.
Upgrading to 0.2.215 has basically disabled(?) rust-analyzer. No type hinting, no formatting. This is not only a windows problem.

Some specs here
OS: Pop!_OS 20.04 LTS x86_64
Kernel: 5.4.0-7634-generic
VSCode: 1.46.1
cd9ea6488829f560dc949a8b2fb789f3cdc05f5d
x64

Please let me know any other ways I can help or other info you need from my machine.

This has been fixed in #4989. The fix will be published next week.

@jsj1027 this was just fixed. A new release will be available soon(ish) in the Marketplace.

This won't take a week, we will publish a patch today-or-tomorrow https://github.com/rust-analyzer/rust-analyzer/pull/4989#issuecomment-647668226

Was this page helpful?
0 / 5 - 0 ratings

Related issues

schungx picture schungx  ยท  38Comments

ninjasource picture ninjasource  ยท  33Comments

yaahc picture yaahc  ยท  27Comments

matklad picture matklad  ยท  57Comments

matklad picture matklad  ยท  28Comments