Skip to content
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

Corrupted clangd binary file downloaded by vscode extension #567

Closed
fourdim opened this issue Dec 20, 2023 · 10 comments
Closed

Corrupted clangd binary file downloaded by vscode extension #567

fourdim opened this issue Dec 20, 2023 · 10 comments
Labels
bug Something isn't working

Comments

@fourdim
Copy link

fourdim commented Dec 20, 2023

Please describe the problem.
For hints on what information is helpful, see: https://clangd.llvm.org/troubleshooting.html

I've downloaded clangd using the extension. However, the checksum is different from the expected binary file (downloaded from the github release).

Expected: SHA256: b54498f5aee708b9e763a81cc23de237b7816fbf2efbabf83efa0c93506601d4
Recieved: SHA256: 369088cc4bfa58322f9b71ccdbd059e66da1f8e1c98c9f8a4fbec27cf0ae9e0a

It looks like it's corrupted during the unzip phase.

Here is part of corrupted binary file and it is not even a valid ELF.

image

If you can, provide a minimal chunk of code that shows the problem (either inline, or attach it if larger).

Logs
Please attach the clangd log from the "Output" window if you can.
If possible, run with --log=verbose - note that the logs will include the contents of open files!

[Error - 11:31:05 AM] Client Clang Language Server: connection to server is erroring. Shutting down server.
[Error - 11:31:05 AM] Stopping server failed
Error: Client is not running and can't be stopped. It's current state is: starting
	at gf.shutdown (/home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:39:8662)
	at gf.stop (/home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:39:8241)
	at gf.stop (/home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:39:51221)
	at gf.handleConnectionError (/home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:39:13331)
	at errorHandler (/home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:39:11996)
	at /home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:39:21723
	at Up.invoke (/home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:2:15350)
	at ba.fire (/home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:2:16144)
	at writeErrorHandler (/home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:3:7085)
	at Up.invoke (/home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:2:15350)
	at ba.fire (/home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:2:16144)
	at As.fireError (/home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:3:430)
	at Socket.<anonymous> (/home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:3:1263)
	at Socket.emit (node:events:514:28)
	at emitErrorNT (node:internal/streams/destroy:151:8)
	at emitErrorCloseNT (node:internal/streams/destroy:116:3)
	at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
[Info  - 11:31:05 AM] Connection to server got closed. Server will restart.
[Error - 11:31:05 AM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 11:31:05 AM] Clang Language Server client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
/home/username/.vscode-server-insiders/data/User/globalStorage/llvm-vs-code-extensions.vscode-clangd/install/17.0.3/clangd_17.0.3/bin/clangd: 1: Syntax error: "(" unexpected
[Info  - 11:31:05 AM] Connection to server got closed. Server will restart.
[Error - 11:31:05 AM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 11:31:05 AM] Clang Language Server client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
/home/username/.vscode-server-insiders/data/User/globalStorage/llvm-vs-code-extensions.vscode-clangd/install/17.0.3/clangd_17.0.3/bin/clangd: 1: Syntax error: "(" unexpected
[Error - 11:31:05 AM] Client Clang Language Server: connection to server is erroring. Shutting down server.
[Error - 11:31:05 AM] Stopping server failed
Error: Client is not running and can't be stopped. It's current state is: startFailed
	at gf.shutdown (/home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:39:8662)
	at gf.stop (/home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:39:8241)
	at gf.stop (/home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:39:51221)
	at gf.handleConnectionError (/home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:39:13331)
	at errorHandler (/home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:39:11996)
	at /home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:39:21723
	at Up.invoke (/home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:2:15350)
	at ba.fire (/home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:2:16144)
	at writeErrorHandler (/home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:3:7085)
	at Up.invoke (/home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:2:15350)
	at ba.fire (/home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:2:16144)
	at As.fireError (/home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:3:430)
	at Socket.<anonymous> (/home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:3:1263)
	at Socket.emit (node:events:514:28)
	at emitErrorNT (node:internal/streams/destroy:151:8)
	at emitErrorCloseNT (node:internal/streams/destroy:116:3)
	at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
[Info  - 11:31:05 AM] Connection to server got closed. Server will restart.
[Error - 11:31:05 AM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 11:31:05 AM] Clang Language Server client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 11:31:05 AM] Restarting server failed
  Message: Pending response rejected since connection got disposed
  Code: -32097 
/home/username/.vscode-server-insiders/data/User/globalStorage/llvm-vs-code-extensions.vscode-clangd/install/17.0.3/clangd_17.0.3/bin/clangd: 1: Syntax error: "(" unexpected
[Info  - 11:31:05 AM] Connection to server got closed. Server will restart.
[Error - 11:31:05 AM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 11:31:05 AM] Clang Language Server client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 11:31:05 AM] Restarting server failed
  Message: Pending response rejected since connection got disposed
  Code: -32097 
/home/username/.vscode-server-insiders/data/User/globalStorage/llvm-vs-code-extensions.vscode-clangd/install/17.0.3/clangd_17.0.3/bin/clangd: 1: Syntax error: "(" unexpected
[Error - 11:31:05 AM] Client Clang Language Server: connection to server is erroring. Shutting down server.
[Error - 11:31:05 AM] Stopping server failed
Error: Client is not running and can't be stopped. It's current state is: startFailed
	at gf.shutdown (/home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:39:8662)
	at gf.stop (/home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:39:8241)
	at gf.stop (/home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:39:51221)
	at gf.handleConnectionError (/home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:39:13331)
	at errorHandler (/home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:39:11996)
	at /home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:39:21723
	at Up.invoke (/home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:2:15350)
	at ba.fire (/home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:2:16144)
	at writeErrorHandler (/home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:3:7085)
	at Up.invoke (/home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:2:15350)
	at ba.fire (/home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:2:16144)
	at As.fireError (/home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:3:430)
	at Socket.<anonymous> (/home/username/.vscode-server-insiders/extensions/llvm-vs-code-extensions.vscode-clangd-0.1.25/out/bundle.js:3:1263)
	at Socket.emit (node:events:514:28)
	at emitErrorNT (node:internal/streams/destroy:151:8)
	at emitErrorCloseNT (node:internal/streams/destroy:116:3)
	at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
[Error - 11:31:05 AM] The Clang Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
[Error - 11:31:05 AM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 11:31:05 AM] Clang Language Server client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 11:31:05 AM] Restarting server failed
  Message: Pending response rejected since connection got disposed
  Code: -32097 
/home/username/.vscode-server-insiders/data/User/globalStorage/llvm-vs-code-extensions.vscode-clangd/install/17.0.3/clangd_17.0.3/bin/clangd: 1: Syntax error: "(" unexpected

System information
Clangd version (from the log, or clangd --version): Not able to execute clangd.
clangd extension version: v0.1.25
Operating system: Ubuntu 22.04.2 LTS

@fourdim fourdim added the bug Something isn't working label Dec 20, 2023
@HighCommander4
Copy link
Contributor

You're probably aware of this, but just in case: you can point vscode-clangd to the manually downloaded executable using the "clangd.path" setting as a workaround

@fourdim
Copy link
Author

fourdim commented Dec 20, 2023

Yeah, I know that. Anyway, thanks.

@HighCommander4
Copy link
Contributor

@fourdim What vscode version are you using?

@fourdim
Copy link
Author

fourdim commented Dec 21, 2023

Version: 1.86.0-insider (user setup)
Commit: 9621add46007f7a1ab37d1fce9bcdcecca62aeb0
Date: 2023-12-20T05:36:57.756Z
Electron: 27.1.3
ElectronBuildId: 25612240
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Windows_NT x64 10.0.19045

@HighCommander4
Copy link
Contributor

Thanks. Could you try with the (just released) vscode-clangd 0.1.26 please? It should be fixed there.

@fourdim
Copy link
Author

fourdim commented Dec 21, 2023

Sure. Can confirm that this bug is fixed.

@fourdim fourdim closed this as completed Dec 21, 2023
@HighCommander4
Copy link
Contributor

HighCommander4 commented Dec 21, 2023

Thanks for confirming!

In case anyone is curious, the problem was that vscode-clangd 0.1.25 was using an unzipping library which is broken with nodejs >= 18.16, and vscode 1.86 (currently on the Insiders channel) is the first vscode version to use nodejs >= 18.16.

vscode-clangd 0.1.26 uses a different library for unzipping which is not affected.

@catskul
Copy link

catskul commented Mar 22, 2024

Seems like it's happening again.

@HighCommander4
Copy link
Contributor

Seems like it's happening again.

Could you file a new issue please?

@catskul
Copy link

catskul commented Mar 23, 2024

I tried again and it passed. If it happens again more consistently I'll open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants