rust-lang / rust-analyzer

A Rust compiler front-end for IDEs
https://rust-analyzer.github.io/
Apache License 2.0
14.08k stars 1.57k forks source link

standalone server returns "stack smashing detected" #13383

Open FrnkPsycho opened 1 year ago

FrnkPsycho commented 1 year ago

Rust Analyzer Client log:

INFO [2022/10/10 18:25:14]: PersistentState: { serverVersion: '0.4.1237' }
INFO [2022/10/10 18:25:14]: Using server binary at /home/frnks/.config/Code/User/globalStorage/rust-lang.rust-analyzer/rust-analyzer
DEBUG [2022/10/10 18:25:14]: Checking availability of a binary at /home/frnks/.config/Code/User/globalStorage/rust-lang.rust-analyzer/rust-analyzer
DEBUG [2022/10/10 18:25:15]: /home/frnks/.config/Code/User/globalStorage/rust-lang.rust-analyzer/rust-analyzer --version: {
  status: null,
  signal: 'SIGABRT',
  output: [ null, '', '*** stack smashing detected ***: terminated\n' ],
  pid: 601,
  stdout: '',
  stderr: '*** stack smashing detected ***: terminated\n'
}
ERROR [2022/10/10 18:25:15]: Bootstrap error Error: Failed to execute /home/frnks/.config/Code/User/globalStorage/rust-lang.rust-analyzer/rust-analyzer --version
    at kS (/home/frnks/.vscode/extensions/rust-lang.rust-analyzer-0.4.1237-linux-x64/out/main.js:85:2287)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at ES (/home/frnks/.vscode/extensions/rust-lang.rust-analyzer-0.4.1237-linux-x64/out/main.js:84:1220)
    at dv (/home/frnks/.vscode/extensions/rust-lang.rust-analyzer-0.4.1237-linux-x64/out/main.js:84:891)
    at E._activate (/nix/store/b1cq7332phjizygcjx44wb0qqc6hhzal-vscode-1.71.2/lib/vscode/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:85:8224)
    at E._waitForDepsThenActivate (/nix/store/b1cq7332phjizygcjx44wb0qqc6hhzal-vscode-1.71.2/lib/vscode/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:85:8166)
    at E._initialize (/nix/store/b1cq7332phjizygcjx44wb0qqc6hhzal-vscode-1.71.2/lib/vscode/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:85:7530)

But when I execute this command in a external shell:

> /home/frnks/.config/Code/User/globalStorage/rust-lang.rust-analyzer/rust-analyzer --version
rust-analyzer 0.4.1237-standalone

It seems no problems.

Then I changed rust-analyzer.server.path to "/run/current-system/sw/bin/rust-analyzer" It works! IDK why the standalone server don't work.

BTW, I'm using NixOS, so the path of link might seems different from other dists. Maybe the problem relates to the system?

FrnkPsycho commented 1 year ago

Forget to post version that works.

> /run/current-system/sw/bin/rust-analyzer --version
rust-analyzer 2022-10-03
lnicola commented 1 year ago

We do something special on Nix, but I have no idea what might be happening in your case. What's /run/current-system/sw/bin/rust-analyzer?

FrnkPsycho commented 1 year ago

We do something special on Nix, but I have no idea what might be happening in your case. What's /run/current-system/sw/bin/rust-analyzer?

It comes from which rust-analyzer

I'm new to nixos so I can't sure but I think it's a link to rust-analyzer in my system environment.