vscode: LanguageClient failing to initialize language server on 1.62.1

We’re running into an issue that seems to have been introduced with 1.62.1.

Upon initialization of our LanguageClient in our VSCode extension, it’s immediately triggering a closed notification on LanguageClient.clientOptions.errorHandler.closed (here)

Insiders 1.63.0 also has the problem. It happens while debugging as well as when installing from the marketplace.

If we downgrade to 1.61.2 or 1.60.2 there are no problems.

Screen Shot 2021-11-11 at 2 35 24 PM
  • We checked the lsp-sample using 1.62.1 and using the same client + server libraries and there’s no error.
  • We changed our retry logic to retry indefinitely, and at some point it will complete. it seems like it’s related to the client.onReady() promise never resolving [?]
  • What else can we try, this is essentially affecting all our users.

Does this issue occur when all extensions are disabled?: N/A, this is inside a VSCode extension

Version: 1.62.1 Commit: f4af3cbf5a99787542e2a30fe1fd37cd644cc31f Date: 2021-11-05T09:23:14.144Z Electron: 13.5.2 Chrome: 91.0.4472.164 Node.js: 14.16.0 V8: 9.1.269.39-electron.0 OS: Darwin x64 20.6.0

Happens in both VSC 1.62.2 and VSCInsiders 1.63.0 Steps to Reproduce:

  1. install CodeStream from the marketplace
  2. close VSCode, then reopen it. 75% of the time you’ll see a toast notification error

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 16
  • Comments: 20 (13 by maintainers)

Most upvoted comments

Today’s insider Version: 1.63.0-insider 6a25ae3a24929f35aabf8a051531c0716032e0a0 , carries the fix. I will close this optimistically based on the testing. The fix will also be made available in recovery release 1.62.3 later this week.

End-to-end debugging of the issue narrowed down the problem to a UAF scenario in the argument parser. I am getting a new electron build ready with the fix today. I will update here once the fix is rolled into our insiders for some testing. Sorry about the breakage!

For anyone available for early testing, here are some test builds. Tomorrow’s insider should also contain the fix.

macOS x64 windows x64 linux x64

@bcanzanella I have investigated and it looks like the forked process dist/agent.js exits with a SIGSEGV.

@deepak1556 Is there anything we can do to find out why this process crashes? AFAICT it is not loading any native node modules.

Sorry about the breakage, this is from a fix to address an elevation of privilege vulnerability #136771 (CVE-2021-42322). Starting with 1.62.1 you need to pass the command line argument --ms-enable-electron-run-as-node to the VSCode binary in addition to ELECTRON_RUN_AS_NODE=1 to use it as Node.js.

Moved back from 1.62 to 1.61.2 and the problem is gone. So, you hypothesis is right, at least on Linux (Ubuntu) machines.

Electron 13.5.1 vs 13.5.2

20211111_172322_Spectacle .