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

Extension Host terminated unexpectedly #186912

Closed
kafisatz opened this issue Jul 3, 2023 · 35 comments · Fixed by #195755
Closed

Extension Host terminated unexpectedly #186912

kafisatz opened this issue Jul 3, 2023 · 35 comments · Fixed by #195755
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug extension-host Extension host issues freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues insiders-released Patch has been released in VS Code Insiders nodejs NodeJS support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-fixed The underlying upstream issue has been fixed verified Verification succeeded
Milestone

Comments

@kafisatz
Copy link

kafisatz commented Jul 3, 2023

Type: Bug

This issue is related to the Julia extension.
I filed an issue there, but I also filing it here (as suggested by @pfitzseb).

As per the initial post of the above link, all extension work perfectly fine when the Julia extension is disabled.

here are dmp files as per this
dmp-files.zip

VS Code version: Code 1.79.2 (695af09, 2023-06-14T08:57:04.379Z)
OS version: Windows_NT x64 10.0.22621
Modes:

System Info
Item Value
CPUs 12th Gen Intel(R) Core(TM) i7-1270P (16 x 2496)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 31.67GB (16.06GB free)
Process Argv --crash-reporter-id 014558b0-de03-4e1f-9649-f90be1cbe95b
Screen Reader no
VM 0%
Extensions (50)
Extension Author (truncated) Version
rainbow-brackets 2gu 0.0.6
vscode-django bat 1.10.0
python-environment-manager don 1.0.4
python-extension-pack don 1.7.0
code-runner for 0.12.0
copilot Git 1.94.220
vscode-github-actions git 0.25.8
vscode-pull-request-github Git 0.66.2
nbpreviewer jit 1.2.2
language-julia jul 1.47.2
vsc-python-indent Kev 1.18.0
vscode-github Kni 0.30.7
vscode-opn lfu 1.1.2
MagicPython mag 1.1.0
vscode-azureappservice ms- 0.24.9
vscode-azureresourcegroups ms- 0.7.5
vscode-docker ms- 1.25.2
csharp ms- 1.26.0
isort ms- 2022.8.0
python ms- 2023.10.1
vscode-pylance ms- 2023.6.40
jupyter ms- 2023.5.1101742258
jupyter-keymap ms- 1.1.2
jupyter-renderers ms- 1.0.15
vscode-jupyter-cell-tags ms- 0.1.8
vscode-jupyter-slideshow ms- 0.1.5
remote-containers ms- 0.295.0
remote-ssh ms- 0.102.0
remote-ssh-edit ms- 0.86.0
remote-wsl ms- 0.79.5
vscode-remote-extensionpack ms- 0.24.0
azure-account ms- 0.11.5
cmake-tools ms- 1.14.34
cpptools ms- 1.16.3
cpptools-extension-pack ms- 1.3.0
powershell ms- 2023.6.0
remote-explorer ms- 0.4.0
remote-server ms- 1.2.1
autodocstring njp 0.6.1
r-debugger RDe 0.5.4
r REd 2.8.1
vscode-open san 0.1.0
spellchecker swy 1.4.0
python tht 0.2.3
rmarkdown Tia 0.0.14
cmake twx 0.0.17
vscode-counter uct 3.2.1
intellicode-api-usage-examples Vis 0.2.7
vscodeintellicode Vis 1.2.30
jinja who 0.0.8

(2 theme extensions excluded)

A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
pythonvs932:30410667
py29gd2263:30776702
vsclangdc:30486549
c4g48928:30535728
dsvsc012:30540252
pynewext54:30695312
azure-dev_surveyone:30548225
2e4cg342:30602488
pyind779:30671433
f6dab269:30613381
vscrpc:30673769
pythonsymbol12:30671437
showlangstatbar:30737416
vsctsb:30748421
pythonms35:30701012
03d35959:30757346
pythonfmttext:30731395
pythoncmvfstrcf:30756944
fixshowwlkth:30771522
hideindicator:30766889
pythongtdpath:30769146
bgfeh915:30780428
pythonnosm12tcf:30779713
pythonidxpt:30772539
pythonnocebcf:30776496
cmakestatusbarv2:30779594

@kafisatz kafisatz changed the title Extension Hoste terminated unexpectedly Extension Host terminated unexpectedly Jul 3, 2023
@cserteGT3
Copy link

As mentioned in the linked issue, it happens for me as well. I can reproduce it with Insiders version too and the same happens with a few older julia-vscode extensions I tested.

VS Code version
Version: 1.80.0-insider (user setup)
Commit: 5b7440441bbd2548a862f7321cafdfa1597132e5
Date: 2023-06-30T21:12:14.732Z
Electron: 22.3.14
ElectronBuildId: 21893604
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Windows_NT x64 10.0.22621

@bpasero bpasero added freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues extension-host Extension host issues labels Jul 3, 2023
@rzhao271
Copy link
Contributor

rzhao271 commented Jul 3, 2023

There seems to be an issue with spawning a process.
The symbolicated logs seem to have the same form.

symbolicated-6e.log
symbolicated-34.log
symbolicated-73.log
symbolicated-cf.log

@pfitzseb
Copy link
Contributor

pfitzseb commented Jul 3, 2023

I'd expect that this happens when we try to spawn the Julia process that powers the LS. Any chance we can debug this further? I assume we can't handle libuv failing to spawn a process anywhere in the extension code, right?

@jonschumacher
Copy link

As asked in the julia-vscode/julia-vscode#3327 (comment) I want to add that I can reproduce this as well.
From the linked thread:

For me the extension works when no .jl-file is open at the start (saved from the last session) and I then open a .jl-file. But if I had one opened from the last session, the extension host fails and bisect tells that it is the Julia extension.

@deepak1556
Copy link
Collaborator

Sorry for the delayed response, can you please provide the output of the following steps to understand the error

  1. In a terminal set the following env variable
$env:NODE_DEBUG="child_process"
  1. Launch VSCode from the same terminal session with arguments that redirect stdout and stderr to a file as seen below, replace the file paths where appropriate
code.cmd  <path-to-repro> --verbose 2>&1 > <replace-with-absolute-path>\vscode_error.log

Additionally, once the extension host crashes open command palette in VSCode and run Developer: Toggle Developer Tools and attach the output from the Console tab of the developer tools that got opened.

@deepak1556
Copy link
Collaborator

I assume we can't handle libuv failing to spawn a process anywhere in the extension code, right?

@pfitzseb unfortunately this particular error is a fatal error that cannot be handled in the application layer. But we should be able to see the output of GetLastError from the above logs.

@deepak1556 deepak1556 added the info-needed Issue requires more information from poster label Sep 5, 2023
@kafisatz
Copy link
Author

kafisatz commented Sep 5, 2023

Sorry for the delayed response, can you please provide the output of the following steps to understand the error

  1. In a terminal set the following env variable
    .....

I have done this, see attached.

vscode-app-1693893903330.log
vscode_error.log

@jonschumacher
Copy link

Same here
vscode_error.log
debug_console.log

@deepak1556
Copy link
Collaborator

Thanks for the logs, in both cases the launching of child process triggers a fatal error from Node.js at https://github.com/libuv/libuv/blob/0d78f3c758fdc41019093353a7ff4fed83005ac9/src/win/process.c#L1142 due to ERROR_INVALID_PARAMETER. I would like to understand if this can repro with Node.js outside VSCode since we haven't done any modification to the spawn API.

@kafisatz I have simplified the Julia language server process spawn call from your logs into the following script, can you run it with node v18.15.0 which can be downloaded from https://nodejs.org/en/download, the steps would be

  1. Save the following script to spawn_julia_ls.js
  2. Install node.js v18.15.0
  3. From terminal, run node spawn_julia_ls.js and attach the generated output
const { spawn } = require('node:child_process');

const args = [
    '--startup-file=no',
    '--history-file=no',
    '--depwarn=no',
    'main.jl',
    'c:\\Users\\bernhard.koenig\\Documents\\Repositories\\InfluxDBClient.jl',
    '--debug=no',
    'c:\\Users\\bernhard.koenig\\AppData\\Roaming\\Code\\User\\globalStorage\\julialang.language-julia',
    'download',
    'https://www.julia-vscode.org/symbolcache',
    '--detached=no'
]

const server = spawn('C:\\Users\\bernhard.koenig\\.julia\\juliaup\\julia-1.9.3+0.x64.w64.mingw32\\bin\\julia.exe', args, {
    cwd: 'c:\\Users\\bernhard.koenig\\.vscode\\extensions\\julialang.language-julia-1.51.2\\scripts\\languageserver',
    env: {
        JULIA_DEPOT_PATH: 'c:\\Users\\bernhard.koenig\\AppData\\Roaming\\Code\\User\\globalStorage\\julialang.language-julia\\lsdepot\\v1',
        JULIA_LOAD_PATH: ';',
        HOME: 'C:\\Users\\bernhard.koenig',
        JULIA_LANGUAGESERVER: '1',
        ...process.env
    },
    detached: false,
    windowsHide: false,
    stdio: 'inherit'
});

@deepak1556 deepak1556 added bug Issue identified by VS Code Team member as probable bug upstream Issue identified as 'upstream' component related (exists outside of VS Code) nodejs NodeJS support issues labels Sep 5, 2023
@kafisatz
Copy link
Author

kafisatz commented Sep 5, 2023

Apparrently Julia expects 8 arguments.
Not sure why though....

if length(Base.ARGS) != 8
error("Invalid number of arguments passed to julia language server.")
end

PS C:\temp> node  -v
v18.15.0


PS C:\temp> node .\spawn_julia_ls.js
  Activating project at `c:\Users\bernhard.koenig\.vscode\extensions\julialang.language-julia-1.51.2\scripts\environments\languageserver\v1.9`
[ Info: Starting the Julia Language Server
┌ Error: Some Julia code in the VS Code extension crashed
└ @ Main c:\Users\bernhard.koenig\.vscode\extensions\julialang.language-julia-1.51.2\scripts\error_handler.jl:15
ERROR: Invalid number of arguments passed to julia language server.
Stacktrace:
 [1] error(s::String)
   @ Base .\error.jl:35
 [2] top-level scope
   @ c:\Users\bernhard.koenig\.vscode\extensions\julialang.language-julia-1.51.2\scripts\languageserver\main.jl:34
 [3] include(mod::Module, _path::String)
   @ Base .\Base.jl:457
 [4] exec_options(opts::Base.JLOptions)
   @ Base .\client.jl:307
 [5] _start()
   @ Base .\client.jl:522



PS C:\temp> node .\spawn_julia_ls.js
  Activating project at `c:\Users\bernhard.koenig\.vscode\extensions\julialang.language-julia-1.51.2\scripts\environments\languageserver\v1.9`
[ Info: Starting the Julia Language Server

Base.ARGS = ["c:\\Users\\bernhard.koenig\\Documents\\Repositories\\InfluxDBClient.jl", "--debug=no", "c:\\Users\\bernhard.koenig\\AppData\\Roaming\\Code\\User\\globalStorage\\julialang.language-julia", "download", "https://www.julia-vscode.org/symbolcache", "--detached=no"]

┌ Error: Some Julia code in the VS Code extension crashed
└ @ Main c:\Users\bernhard.koenig\.vscode\extensions\julialang.language-julia-1.51.2\scripts\error_handler.jl:15
ERROR: Invalid number of arguments passed to julia language server.
Stacktrace:
 [1] error(s::String)
   @ Base .\error.jl:35
 [2] top-level scope
   @ c:\Users\bernhard.koenig\.vscode\extensions\julialang.language-julia-1.51.2\scripts\languageserver\main.jl:35
 [3] include(mod::Module, _path::String)
   @ Base .\Base.jl:457
 [4] exec_options(opts::Base.JLOptions)
   @ Base .\client.jl:307
 [5] _start()
   @ Base .\client.jl:522
PS C:\temp>

@deepak1556
Copy link
Collaborator

@pfitzseb can you help with above error, I would like to create a minimal repro outside VSCode since this is an issue with Node.js.

@kafisatz
Copy link
Author

kafisatz commented Sep 5, 2023

I added two empty arguments in the spawn_julia_ls.js file
However, I have no idea if these arguments are relevant.


const args = [
    '--startup-file=no',
    '--history-file=no',
    '--depwarn=no',
    'main.jl',
    'c:\\Users\\bernhard.koenig\\Documents\\Repositories\\InfluxDBClient.jl',
    '--debug=no',
	"", // Telemetry pipename
    "", // Old depot path,
    'c:\\Users\\bernhard.koenig\\AppData\\Roaming\\Code\\User\\globalStorage\\julialang.language-julia',
    'download',
    'https://www.julia-vscode.org/symbolcache',
    '--detached=no'
]

Then things seem to work
Are we expecting the server to shut down at the end?

EDIT: the process only shuts down if I hit enter. If I don't press any key it keeps running and the last message is 'Received new data from Julia Symbol Server..."

output is:

PS C:\temp> node .\spawn_julia_ls_bk.js
  Activating project at `c:\Users\bernhard.koenig\.vscode\extensions\julialang.language-julia-1.51.2\scripts\environments\languageserver\v1.9`
[ Info: Starting the Julia Language Server
Base.ARGS = ["c:\\Users\\bernhard.koenig\\Documents\\Repositories\\InfluxDBClient.jl", "--debug=no", "", "", "c:\\Users\\bernhard.koenig\\AppData\\Roaming\\Code\\User\\globalStorage\\julialang.language-julia", "download", "https://www.julia-vscode.org/symbolcache", "--detached=no"]
length(Base.ARGS) = 8
[ Info: Symbol server store is at 'c:\Users\bernhard.koenig\AppData\Roaming\Code\User\globalStorage\julialang.language-julia\symbolstorev5'.
[ Info: Starting LS at 1693903841
[ Info: All cache files downloaded.
[ Info: Loading CSV from cache...
[ Info: Loading WorkerUtilities from cache...
[ Info: Loading InlineStrings from cache...
[ Info: Loading Parsers from cache...
[ Info: Loading Dates from cache...
[ Info: Loading Printf from cache...
[ Info: Loading Unicode from cache...
[ Info: Loading SnoopPrecompile from cache...
[ Info: Loading Preferences from cache...
[ Info: Loading TOML from cache...
[ Info: Loading PooledArrays from cache...
[ Info: Loading DataAPI from cache...
[ Info: Loading Future from cache...
[ Info: Loading Random from cache...
[ Info: Loading Serialization from cache...
[ Info: Loading SHA from cache...
[ Info: Loading WeakRefStrings from cache...
[ Info: Loading CodecZlib from cache...
[ Info: Loading Zlib_jll from cache...
[ Info: Loading Libdl from cache...
[ Info: Loading TranscodingStreams from cache...
[ Info: Loading Test from cache...
[ Info: Loading InteractiveUtils from cache...
[ Info: Loading Markdown from cache...
[ Info: Loading Base64 from cache...
[ Info: Loading Logging from cache...
[ Info: Loading Tables from cache...
[ Info: Loading OrderedCollections from cache...
[ Info: Loading LinearAlgebra from cache...
┌ Warning: libblastrampoline_jll not stored on disc
└ @ SymbolServer c:\Users\bernhard.koenig\.vscode\extensions\julialang.language-julia-1.51.2\scripts\packages\SymbolServer\src\SymbolServer.jl:247
[ Info: Loading IteratorInterfaceExtensions from cache...
[ Info: Loading DataValueInterfaces from cache...
[ Info: Loading TableTraits from cache...
[ Info: Loading Mmap from cache...
[ Info: Loading FilePathsBase from cache...
[ Info: Loading Compat from cache...
[ Info: Loading UUIDs from cache...
[ Info: Loading SentinelArrays from cache...
[ Info: Loading HTTP from cache...
[ Info: Loading URIs from cache...
[ Info: Loading IniFile from cache...
[ Info: Loading LoggingExtras from cache...
[ Info: Loading MbedTLS from cache...
[ Info: Loading MbedTLS_jll from cache...
[ Info: Loading Artifacts from cache...
[ Info: Loading MozillaCACerts_jll from cache...
[ Info: Loading Sockets from cache...
[ Info: Loading OpenSSL from cache...
[ Info: Loading OpenSSL_jll from cache...
[ Info: Loading JLLWrappers from cache...
[ Info: Loading Pkg from cache...
[ Info: Loading Downloads from cache...
[ Info: Loading LibCURL from cache...
[ Info: Loading LibCURL_jll from cache...
┌ Warning: LibSSH2_jll not stored on disc
└ @ SymbolServer c:\Users\bernhard.koenig\.vscode\extensions\julialang.language-julia-1.51.2\scripts\packages\SymbolServer\src\SymbolServer.jl:247
[ Info: Loading nghttp2_jll from cache...
[ Info: Loading NetworkOptions from cache...
[ Info: Loading FileWatching from cache...
[ Info: Loading ArgTools from cache...
[ Info: Loading Tar from cache...
[ Info: Loading REPL from cache...
[ Info: Loading LibGit2 from cache...
[ Info: Loading p7zip_jll from cache...
[ Info: Loading BitFlags from cache...
[ Info: Loading SimpleBufferStream from cache...
[ Info: Loading TimeZones from cache...
[ Info: Loading Mocking from cache...
[ Info: Loading ExprTools from cache...
[ Info: Loading RecipesBase from cache...
[ Info: Loading LazyArtifacts from cache...
[ Info: Loading Scratch from cache...
[ Info: Loading JSON3 from cache...
[ Info: Loading StructTypes from cache...
[ Info: Loading DataFrames from cache...
[ Info: Loading Statistics from cache...
[ Info: Loading SparseArrays from cache...
[ Info: Loading SortingAlgorithms from cache...
[ Info: Loading DataStructures from cache...
[ Info: Loading InvertedIndices from cache...
[ Info: Loading Missings from cache...
[ Info: Loading PrettyTables from cache...
[ Info: Loading StringManipulation from cache...
[ Info: Loading Formatting from cache...
[ Info: Loading Crayons from cache...
[ Info: Loading LaTeXStrings from cache...
[ Info: Loading Reexport from cache...
[ Info: Loading UnPack from cache...
[ Info: Received new data from Julia Symbol Server.

[ Info: Shutting down server instance.
PS C:\temp>
PS C:\temp>

@deepak1556
Copy link
Collaborator

Thanks @kafisatz for fixing the test case

Are we expecting the server to shut down at the end?

No, I was expecting the error AssignProcessToJobObject: (87) the parameter is incorrect to show up

@deepak1556
Copy link
Collaborator

deepak1556 commented Sep 5, 2023

Can you run our bisect tool in the terminal npx @vscode/vscode-bisect. In each step install the Julia extension (if not present) and if the extension host terminates with the above error, mark it as bad commit. This would help us narrow down if a change from our side introduced the regression.

@kafisatz
Copy link
Author

kafisatz commented Sep 5, 2023

Looking at the vscode_error.log above, the argument right after --debug=no is \\\\.\\pipe\\vsc-jl-cr-c08cafe3-90b6-45b0-8952-105b21d5020b'
In the test case, I set this argument to empty though

@deepak1556
Copy link
Collaborator

Looking at the vscode_error.log above, the argument rigth after --debug=no is \\.\pipe\vsc-jl-cr-c08cafe3-90b6-45b0-8952-105b21d5020b'

I think it is fine to skip the pipe name, looking at the code it is only responsible for monitory crashes from the language server.

@kafisatz
Copy link
Author

kafisatz commented Sep 5, 2023

Only on the first run I had to

  • open my project (InfluxDBClient.jl)
  • install the julia extension
  • trust the authors of the folder
  • open a *.jl file in my project
C:\temp>npx @vscode/vscode-bisect
√ Commit of released insiders build that reproduces the issue (leave empty to pick the latest build) ...
√ Commit of released insiders build that does not reproduce the issue (leave empty to pick the oldest build) ...
[build] total 178 builds with roughly 7 steps
[build] starting desktop build 0e9c2fa760932b13f81516aff15f2b0112aa6eeb...
√ Is 0e9c2fa760932b13f81516aff15f2b0112aa6eeb good or bad? » Good
[build] starting desktop build 830db0e1cca4a2eca04f9557bf8cb74654969f51...
√ Is 830db0e1cca4a2eca04f9557bf8cb74654969f51 good or bad? » Bad
[build] starting desktop build ad791ef3d26b99963da31636af697afd86575435...
√ Is ad791ef3d26b99963da31636af697afd86575435 good or bad? » Bad
[build] starting desktop build da7f05a70eb760e4ce1fe230ae158ae214433341...
√ Is da7f05a70eb760e4ce1fe230ae158ae214433341 good or bad? » Bad
[build] starting desktop build 636dbcff557af8aa088ae118b1a094dce6632ce7...
√ Is 636dbcff557af8aa088ae118b1a094dce6632ce7 good or bad? » Bad
[build] starting desktop build 61ba389b0a7108af0411c73ab30c7e4350051645...
√ Is 61ba389b0a7108af0411c73ab30c7e4350051645 good or bad? » Bad
[build] starting desktop build 6545c4c2671127c323182225963fcd732e1fbcc5...
√ Is 6545c4c2671127c323182225963fcd732e1fbcc5 good or bad? » Bad
[build] starting desktop build f3aa9a201b2455e6556797e8ffb7145d77adb792...
√ Is f3aa9a201b2455e6556797e8ffb7145d77adb792 good or bad? » Bad
[build] f3aa9a201b2455e6556797e8ffb7145d77adb792 is the first bad commit after 0e9c2fa760932b13f81516aff15f2b0112aa6eeb.
√ Would you like to open GitHub for the list of changes? ... yes

Run the following commands to continue bisecting via git in a folder where VS Code is checked out to:

git bisect start && git bisect bad f3aa9a201b2455e6556797e8ffb7145d77adb792 && git bisect good 0e9c2fa760932b13f81516aff15f2b0112aa6eeb

@kafisatz
Copy link
Author

kafisatz commented Sep 5, 2023

@pfitzseb
I will add that, when I run the above code npx @vscode/vscode-bisect the extension server fails every time except for the first time. The first time I get the ERROR below, but the Language Server seems to restart.
Also it actually takes ages (maybe 2 or 3 minutes) for the LanguageServer to start.

image

@cserteGT3
Copy link

I can reproduce the extension host termination with VSCode 1.77.3 and julia-vscode v1.47.2.

@deepak1556
Copy link
Collaborator

Thanks for confirming, that eliminates the allocator changes we adopted for Electron 22 update. Refs #177338

@vscodenpa
Copy link

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@vscodenpa vscodenpa closed this as not planned Won't fix, can't repro, duplicate, stale Sep 13, 2023
@deepak1556 deepak1556 reopened this Sep 13, 2023
@deepak1556 deepak1556 added under-discussion Issue is under discussion for relevance, priority, approach and removed info-needed Issue requires more information from poster labels Sep 13, 2023
@pfitzseb
Copy link
Contributor

Thanks for looking into this, @deepak1556. Do you need any more info about the extension?

@pfitzseb
Copy link
Contributor

Might be fixed by libuv/libuv#4152.

@kafisatz
Copy link
Author

Once the libuve PR us merged, do I need to wait for the next minor julia release?

@deepak1556 deepak1556 added upstream-issue-fixed The underlying upstream issue has been fixed and removed under-discussion Issue is under discussion for relevance, priority, approach labels Sep 28, 2023
@deepak1556
Copy link
Collaborator

Thanks for sharing the fix @pfitzseb , I will backport the fix into Electron as next step.

@deepak1556 deepak1556 added this to the October 2023 milestone Sep 28, 2023
@deepak1556
Copy link
Collaborator

Steps for verification:

  1. Open helloworld extension in latest stable, add the following changes
diff --git a/helloworld-minimal-sample/extension.js b/helloworld-minimal-sample/extension.js
index 9b28fa2..424008b 100644
--- a/helloworld-minimal-sample/extension.js
+++ b/helloworld-minimal-sample/extension.js
@@ -1,9 +1,7 @@
 // The module 'vscode' contains the VS Code extensibility API
 // Import the module and reference it with the alias vscode in your code below
 const vscode = require('vscode');
-
-// this method is called when your extension is activated
-// your extension is activated the very first time the command is executed
+const { spawnSync } = require('node:child_process');

 /**
  * @param {vscode.ExtensionContext} context
@@ -21,6 +19,8 @@ function activate(context) {

                // Display a message box to the user
                vscode.window.showInformationMessage('Hello World!');
+               spawnSync('winget', ['--version']);
+               spawnSync('node', ['--version']);
        });

        context.subscriptions.push(disposable);
  1. Debug extension, run hello world command
  2. Stop the debug session
  3. Start debug extension again, run hello world command
  4. It should crash the extension host

Perform steps 1-4 again in latest insiders with the fix and it should not crash.

@vscodenpa vscodenpa added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Oct 17, 2023
@DonJayamanne
Copy link
Contributor

Seems to be specific to windows, I cannot repro the crash on a Mac.

@pfitzseb
Copy link
Contributor

pfitzseb commented Oct 25, 2023

Yeah, the underlying issue seems to be in the Windows kernel.

@Rahulkumarmahawar
Copy link

Rahulkumarmahawar commented Oct 25, 2023 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug extension-host Extension host issues freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues insiders-released Patch has been released in VS Code Insiders nodejs NodeJS support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-fixed The underlying upstream issue has been fixed verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.