microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.18k stars 29.29k forks source link

VS code render crashes #135371

Closed FilJed closed 3 years ago

FilJed commented 3 years ago

Work flow I used: VS code + wsl2 + python3(ubunta) + jupyter + pandas + plotly

Sometimes this stack leads to losing data (ipynb-files cannot be opened) or slowing down whole VS code(as in this case).

This time, jupyter extension draw me a plot but won't let me interact with it and keep sending me this message (but it worked perfectly before): image

Here is some listings:

jupyter output

Info 2021-10-19 16:36:37: Loading webview. View is notset
Info 2021-10-19 16:36:37: Loading web view...
Info 2021-10-19 16:36:37: Webview panel created.
Info 2021-10-19 16:36:37: Web view react rendered
Info 2021-10-19 16:36:38: Searching for token colors ...
Info 2021-10-19 16:36:38: Attempting search for colors ...
Warn 2021-10-19 16:36:38: Color theme Default Dark+ not found. Using default colors.
Info 2021-10-19 16:36:38: Attempting search for colors ...
Warn 2021-10-19 16:36:38: Color theme Default Dark+ not found. Using default colors.

Log (window)

[2021-10-19 16:16:29.476] [renderer1] [info] Enabling inspect port on extension host with pid 20920.
[2021-10-19 16:16:46.074] [renderer1] [error] [Extension Host] (node:22357) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `node --trace-deprecation ...` to show where the warning was created)

Log (main)

[2021-10-19 16:16:53.355] [main] [info] update#setState idle
[2021-10-19 16:20:23.746] [main] [error] CodeWindow: detected unresponsive
[2021-10-19 16:21:23.099] [main] [error] CodeWindow: detected unresponsive
[2021-10-19 16:35:43.923] [main] [error] CodeWindow: detected unresponsive
[2021-10-19 16:36:47.715] [main] [error] CodeWindow: detected unresponsive
[2021-10-19 16:37:11.564] [main] [error] CodeWindow: detected unresponsive
[2021-10-19 16:37:29.579] [main] [error] CodeWindow: detected unresponsive
[2021-10-19 16:38:22.067] [main] [error] CodeWindow: detected unresponsive
[2021-10-19 16:38:40.705] [main] [error] CodeWindow: detected unresponsive

Reinstalling all extension didn't solve the issue.

My guess is that ms-toolsai.jupyter-renderers compomemt is responsible for that. But I cannot prove it.

What shoul I check and do?

Here is some CPU profilers: prof-d26b.extHost.cpuprofile.txt prof-d26b.main.cpuprofile.txt prof-d26b.renderer.cpuprofile.txt

rebornix commented 3 years ago

@FilJed can you please share the notebook you are using?

FilJed commented 3 years ago

I don't think the problem is in the data I have, because I just swicth drawing tool from plotly to cufflinks (which is essensially the same -- both use plotly.js backend) and it gets so much better and more responsible.

I track some error, which pop up in output, maybe them help you help me.

Usually it starts with this (when I try to draw a plot with plotly)

Log (window)

[2021-10-20 15:33:20.369] [renderer1] [error] [Extension Host] (node:1187) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
...
[2021-10-20 15:41:41.437] [renderer1] [error] Cannot call write after a stream was destroyed: Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed
    at afterWrite (internal/streams/writable.js:470:24)
    at onwrite (internal/streams/writable.js:446:7)
    at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:89:12)
...
[2021-10-20 15:42:49.778] [renderer1] [error] Cannot call write after a stream was destroyed: Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed
    at afterWrite (internal/streams/writable.js:470:24)
    at onwrite (internal/streams/writable.js:446:7)
    at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:89:12)
...
[2021-10-20 15:50:33.684] [renderer1] [error] [Extension Host] Error: Unexpected SIGPIPE
    at process.<anonymous> (/home/jedy/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/out/bootstrap.js:1:370)
    at process.emit (events.js:315:20)

Log (Remote Extension)

[2021-10-20 15:33:19.116] [exthost] [error] Error: EEXIST: file already exists, open '/home/jedy/.vscode-server/data/User/workspaceStorage/9fa690d61dec086dcdc984575868bedf/vscode.lock'
[2021-10-20 15:33:19.124] [exthost] [info] Lock '/home/jedy/.vscode-server/data/User/workspaceStorage/9fa690d61dec086dcdc984575868bedf/vscode.lock': Could not acquire lock, checking if the file is stale.
[2021-10-20 15:33:19.126] [exthost] [info] Lock '/home/jedy/.vscode-server/data/User/workspaceStorage/9fa690d61dec086dcdc984575868bedf/vscode.lock': The pid 250 appears to be gone.
[2021-10-20 15:33:19.126] [exthost] [info] Lock '/home/jedy/.vscode-server/data/User/workspaceStorage/9fa690d61dec086dcdc984575868bedf/vscode.lock': Deleting a stale lock.
[2021-10-20 15:33:19.127] [exthost] [info] Lock '/home/jedy/.vscode-server/data/User/workspaceStorage/9fa690d61dec086dcdc984575868bedf/vscode.lock': Lock acquired.
[2021-10-20 15:33:19.152] [exthost] [info] ExtensionService#_doActivateExtension vscode.ipynb, startup: false, activationEvent: 'onNotebook:jupyter-notebook}'
[2021-10-20 15:33:19.152] [exthost] [info] ExtensionService#_doActivateExtension vscode.ipynb, startup: false, activationEvent: 'onNotebook:jupyter-notebook}'
[2021-10-20 15:33:19.152] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/jedy/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/extensions/ipynb/dist/ipynbMain.js
[2021-10-20 15:33:19.167] [exthost] [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch, startup: true, activationEvent: '*'
[2021-10-20 15:33:19.167] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/jedy/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/extensions/debug-auto-launch/dist/extension
[2021-10-20 15:33:19.170] [exthost] [info] ExtensionService#_doActivateExtension vscode.git, startup: true, activationEvent: '*', root cause: vscode.github
[2021-10-20 15:33:19.170] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/jedy/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/extensions/git/dist/main
[2021-10-20 15:33:19.218] [exthost] [info] ExtensionService#_doActivateExtension christian-kohler.path-intellisense, startup: true, activationEvent: '*'
[2021-10-20 15:33:19.218] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/jedy/.vscode-server/extensions/christian-kohler.path-intellisense-2.4.0/out/extension.js
[2021-10-20 15:33:19.288] [exthost] [info] ExtensionService#_doActivateExtension vscode.github, startup: true, activationEvent: '*'
[2021-10-20 15:33:19.288] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/jedy/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/extensions/github/dist/extension.js
[2021-10-20 15:33:19.330] [exthost] [info] ExtensionService#_doActivateExtension vscode.emmet, startup: false, activationEvent: 'onStartupFinished'
[2021-10-20 15:33:19.330] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/jedy/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/extensions/emmet/dist/node/emmetNodeMain
[2021-10-20 15:33:19.344] [exthost] [info] ExtensionService#_doActivateExtension vscode.merge-conflict, startup: false, activationEvent: 'onStartupFinished'
[2021-10-20 15:33:19.344] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/jedy/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/extensions/merge-conflict/dist/mergeConflictMain
[2021-10-20 15:33:19.347] [exthost] [info] eager extensions activated
[2021-10-20 15:33:19.366] [exthost] [info] ExtensionService#_doActivateExtension ms-vscode.js-debug, startup: false, activationEvent: 'onCommand:extension.js-debug.clearAutoAttachVariables'
[2021-10-20 15:33:19.366] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/jedy/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/extensions/ms-vscode.js-debug/src/extension.js
[2021-10-20 15:33:19.835] [exthost] [info] ExtensionService#_doActivateExtension ms-toolsai.jupyter, startup: false, activationEvent: 'onNotebook:jupyter-notebook'
[2021-10-20 15:33:19.836] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/jedy/.vscode-server/extensions/ms-toolsai.jupyter-2021.9.1101343141/out/client/extension
[2021-10-20 15:33:20.078] [exthost] [info] ExtensionService#_doActivateExtension ms-toolsai.jupyter-renderers, startup: false, activationEvent: 'onNotebook:*'
[2021-10-20 15:33:20.078] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/jedy/.vscode-server/extensions/ms-toolsai.jupyter-renderers-1.0.3/out/extension_renderer/index.js
[2021-10-20 15:33:20.087] [exthost] [info] ExtensionService#_doActivateExtension vscode.extension-editing, startup: false, activationEvent: 'onLanguage:markdown'
[2021-10-20 15:33:20.088] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/jedy/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/extensions/extension-editing/dist/extensionEditingMain
[2021-10-20 15:33:20.102] [exthost] [info] ExtensionService#_doActivateExtension vscode.markdown-language-features, startup: false, activationEvent: 'onLanguage:markdown'
[2021-10-20 15:33:20.102] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/jedy/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/extensions/markdown-language-features/dist/extension
[2021-10-20 15:33:20.186] [exthost] [info] ExtensionService#_doActivateExtension ms-python.python, startup: false, activationEvent: 'onLanguage:python', root cause: ms-python.vscode-pylance
[2021-10-20 15:33:20.186] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/jedy/.vscode-server/extensions/ms-python.python-2021.10.1336267007/out/client/extension
[2021-10-20 15:33:21.016] [exthost] [info] ExtensionService#_doActivateExtension ms-python.vscode-pylance, startup: false, activationEvent: 'onLanguage:python'
[2021-10-20 15:33:21.016] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/jedy/.vscode-server/extensions/ms-python.vscode-pylance-2021.10.1/dist/extension.bundle.js
[2021-10-20 15:34:01.171] [exthost] [error] [ms-python.python] provider FAILED
[2021-10-20 15:34:01.171] [exthost] [error] Canceled: Canceled
    at _.makeCancelError (/home/jedy/.vscode-server/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:9:153526)
    at _.handleFailedRequest (/home/jedy/.vscode-server/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:9:153377)
    at /home/jedy/.vscode-server/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:9:113719
    at async s.provideHover (/home/jedy/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/out/vs/server/remoteExtensionHostProcess.js:94:170095)
[2021-10-20 15:38:34.935] [exthost] [error] [ms-python.python] provider FAILED
[2021-10-20 15:38:34.935] [exthost] [error] Canceled: Canceled
    at _.makeCancelError (/home/jedy/.vscode-server/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:9:153526)
    at _.handleFailedRequest (/home/jedy/.vscode-server/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:9:153377)
    at /home/jedy/.vscode-server/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:9:112927
    at async U.resolveCompletionItem (/home/jedy/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/out/vs/server/remoteExtensionHostProcess.js:94:181423)
[2021-10-20 15:39:57.700] [exthost] [error] [ms-python.python] provider FAILED
[2021-10-20 15:39:57.700] [exthost] [error] Canceled: Canceled
    at _.makeCancelError (/home/jedy/.vscode-server/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:9:153526)
    at _.handleFailedRequest (/home/jedy/.vscode-server/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:9:153377)
    at /home/jedy/.vscode-server/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:9:113719
    at async s.provideHover (/home/jedy/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/out/vs/server/remoteExtensionHostProcess.js:94:170095)
[2021-10-20 15:42:15.866] [exthost] [error] [ms-python.python] provider FAILED
[2021-10-20 15:42:15.866] [exthost] [error] Canceled: Canceled
    at _.makeCancelError (/home/jedy/.vscode-server/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:9:153526)
    at _.handleFailedRequest (/home/jedy/.vscode-server/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:9:153377)
    at /home/jedy/.vscode-server/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:9:113719
    at async s.provideHover (/home/jedy/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/out/vs/server/remoteExtensionHostProcess.js:94:170095)
[2021-10-20 15:58:25.721] [exthost] [error] [ms-python.python] provider FAILED
[2021-10-20 15:58:25.721] [exthost] [error] Canceled: Canceled
    at _.makeCancelError (/home/jedy/.vscode-server/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:9:153526)
    at _.handleFailedRequest (/home/jedy/.vscode-server/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:9:153377)
    at /home/jedy/.vscode-server/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:52:350371
    at async O.provideDocumentRangeSemanticTokens (/home/jedy/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/out/vs/server/remoteExtensionHostProcess.js:94:180004)
[2021-10-20 15:58:25.722] [exthost] [error] [ms-python.python] provider FAILED
[2021-10-20 15:58:25.722] [exthost] [error] Canceled: Canceled
    at _.makeCancelError (/home/jedy/.vscode-server/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:9:153526)
    at _.handleFailedRequest (/home/jedy/.vscode-server/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:9:153377)
    at /home/jedy/.vscode-server/extensions/ms-python.python-2021.10.1336267007/out/client/extension.js:52:349293
    at runNextTicks (internal/process/task_queues.js:58:5)
    at processImmediate (internal/timers.js:434:9)
    at async V.provideDocumentSemanticTokens (/home/jedy/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/out/vs/server/remoteExtensionHostProcess.js:94:177894)

During fasing the trubble, when I try to reload VScode, usually I get this message image

After which I get my code partly missed. Which is bad as well.

Please, advise me, how can I get where the problem is. Or what should I do to stop fasing that problems.

Thanks in advance.

rebornix commented 3 years ago

I don't think the problem is in the data I have, because I just swicth drawing tool from plotly to cufflinks (which is essensially the same -- both use plotly.js backend) and it gets so much better and more responsible.

From the symptons it seems that the outputs have impact on the renderer performance, which can potentially crash the UI. It would be great if I have the data to stably reproduce this issue locally myself. The logs might be irrelevant to the crash.

Jaftali commented 2 years ago

I am programming C# based on .NET5 in Visual Studio Code and I also have this render problem. I am a simple user of an active directory domain and have a server-stored Windows profile and a server-stored home directory H:. The administrator provides the system-wide installation of Visual Studio Code.

The startup in the user account is done via CLI commands (see below). As you can see, Extensions-Dir and User-Data-Dir are redirected to the home directory of the respective user (H:\Visual Studio Code) and not written to Appdata as usual in Visual Studio Code:

Code --extensions-dir="H:\Visual Studio Code\ext"
--user-data-dir="H:\Visual Studio Code\user"
--install-extension="C:\Program Files\Microsoft VS Code\ext\ext_coderunner_0_11_6.vsix"
--install-extension="C:\Program Files\Microsoft VS Code\ext\ext_csharp_dotnettools_1_23_16.vsix"

Since access to the Visual Studio Code Marketplace is not allowed for security reasons, the required extensions "code-runner" and "c#-dotnet-tools (omnisharp)" are also installed via CLI parameters at program startup from a local directory (C:...) to the home directory (H:\Visual Studio Code) of the respective user.

This process worked until a few weeks ago. Now the extensions are no longer installed correctly. The installation aborts suddenly and the extensions are incomplete. From the log file it appears that a file already exists (file already exists, ...). But this is impossible. The directory H:\Visual Studio Code\ is completely empty. A complete reinstallation of Visual Studio Code was performed several times. The problem has not gone away.

Can anyone gather any important information from the attached error message that could help me solve the problem.

[2021-11-19 15:13:59.176] [renderer1] [info] Starting extension host with pid 7568.
[2021-11-19 15:13:59.189] [renderer1] [info] [LocalProcessExtensionHost]: IExtensionHostStarter.start() took 191 ms.
[2021-11-19 15:14:00.317] [renderer1] [error] [Extension Host] (node:7568) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `Code --trace-deprecation ...` to show where the warning was created)
[2021-11-19 15:14:11.955] [renderer1] [error] ["Extract: EEXIST: file already exists, mkdir 'H:\\Visual Studio Code\\ext\\.c0342bfe-798b-45b1-a837-f73ef62c2ef3\\dist'","    at s.extractAtLocation (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:76:188875)","    at async s.extractUserExtension (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:76:185594)","    at async q.extract (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:76:198974)","    at async q.doRun (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:76:199612)"]
[2021-11-19 15:14:11.979] [renderer1] [error] EEXIST: file already exists, mkdir 'H:\Visual Studio Code\ext\.c0342bfe-798b-45b1-a837-f73ef62c2ef3\dist': Extract: EEXIST: file already exists, mkdir 'H:\Visual Studio Code\ext\.c0342bfe-798b-45b1-a837-f73ef62c2ef3\dist'
    at s.extractAtLocation (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:76:188875)
    at async s.extractUserExtension (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:76:185594)
    at async q.extract (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:76:198974)
    at async q.doRun (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:76:199612)