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

v8 crash when loading wasm in extension host #115646

Closed
deepak1556 opened this issue Feb 2, 2021 · 15 comments
Closed

v8 crash when loading wasm in extension host #115646

deepak1556 opened this issue Feb 2, 2021 · 15 comments
Assignees
Labels
🍎 si Issues related to apple silicon freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues important Issue identified as high-priority upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-linked This is an upstream issue that has been reported upstream
Milestone

Comments

@deepak1556
Copy link
Collaborator

deepak1556 commented Feb 2, 2021

Created from #113410 (comment)

Minimal electron repo: https://gist.github.com/deepak1556/a6d791b204978aeed549347b6c55d124

StackTrace: #113410 (comment)

Upstream issue in node: nodejs/node#37061

The issue is only with process running as node.

Version: 1.53.0-insider (Universal)
Commit: 8d779a4fadaadec06b44b8875a1d3c4adba8e380
Date: 2021-02-02T16:34:06.213Z
Electron: 11.2.1
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
@deepak1556 deepak1556 changed the title v8crash when loading wasm in extension host v8 crash when loading wasm in extension host Feb 2, 2021
@deepak1556 deepak1556 self-assigned this Feb 2, 2021
@deepak1556 deepak1556 added 🍎 si Issues related to apple silicon freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-linked This is an upstream issue that has been reported upstream labels Feb 2, 2021
@deepak1556 deepak1556 added this to the January 2021 milestone Feb 2, 2021
@deepak1556 deepak1556 added the important Issue identified as high-priority label Feb 2, 2021
@deepak1556
Copy link
Collaborator Author

deepak1556 commented Feb 3, 2021

The difference between the chrome and node arise from the use of different page allocator for v8. Chrome renderer uses Gin's v8 page allocator which inturn depends on partition_alloc to handle MAP_JIT allocations. Switching the page allocator in node platform creation to use chromium's partition alloc fixes the issue.

I can push that as a fix for vscode but the root issue needs to be investigated in node as they can't do such a switch.

@deepak1556
Copy link
Collaborator Author

v8 issue : https://bugs.chromium.org/p/v8/issues/detail?id=11389

@deepak1556 deepak1556 modified the milestones: January 2021, February 2021 Feb 3, 2021
@deepak1556
Copy link
Collaborator Author

deepak1556 commented Feb 4, 2021

\closedWith ff85144

@andreialecu
Copy link

Out of curiosity. How does the electron bump fix it? I wasn't able to find anything relevant in the commit history.

@deepak1556
Copy link
Collaborator Author

The allocator switch has been made in our internal electron builds for early testing, we will create a PR in OSS electron with the same change sometime this week.

@jtkiley
Copy link

jtkiley commented Feb 5, 2021

Sorry to ask here, but I've been poking around, can't find a solid answer, and don't want to break vscode on my M1. Is the latest insiders build now working with macOS 11.2 in cases where this issue popped up?

@rajtslegr
Copy link

Sorry to ask here, but I've been poking around, can't find a solid answer, and don't want to break vscode on my M1. Is the latest insiders build now working with macOS 11.2 in cases where this issue popped up?

Yes!

@andreialecu
Copy link

andreialecu commented Feb 5, 2021

Screenshot 2021-02-05 at 21 32 21

I'm seeing this error in the developer tools with the latest insiders. cc @deepak1556

Just noticed it's related to an extension. That same extension works on Stable though.

Edit: False alarm: could be an extension problem. I actually see the same error logged on Stable, but everything seems to work both on Insiders and Stable.

@deepak1556
Copy link
Collaborator Author

Can you open an new issue for that extension vscode-oniguruma https://github.com/microsoft/vscode-oniguruma if the issue is seen with stable too. /cc @alexdima

@alexdima
Copy link
Member

alexdima commented Feb 8, 2021

@andreialecu I think that is a problem with the bracket pair colorizer 2 extension (AFACIT it is using vscode-oniguruma incorrectly).

@andreialecu
Copy link

Was my initial suspicion as well.

I can also confirm that latest insiders works great on MacOS arm64.

@simonhyphen8
Copy link

simonhyphen8 commented Feb 9, 2021

I'm using VSCode with Salesforce.
MacBook Pro M1 with Big Sur V11.0
VSCode version 1.53.0
I only have 14 extensions installed - the standard Salesforce ones, VSCode LiveShare, ESLint and a Salesforce Documenter.
Restarting the extension host using the button that pops up works, as does closing & reopening the project, but this is proving very frustrating. I can't tell in these posts if this issue is fixed or not, or if I have to do something to resolve it myself?

Any advice greatly appreciated!

Log Info:
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1747 Overwriting grammar scope name to file mapping for scope text.log.
Old grammar file: file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/extensions/log/syntaxes/log.tmLanguage.json.
New grammar file: file:///Users/simonmolloy/.vscode/extensions/salesforce.salesforcedx-vscode-apex-replay-debugger-50.16.0/syntaxes/apexlog.tmLanguage.json
register @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1747
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1747 Overwriting grammar scope name to file mapping for scope text.html.basic.
Old grammar file: file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/extensions/html/syntaxes/html.tmLanguage.json.
New grammar file: file:///Users/simonmolloy/.vscode/extensions/salesforce.salesforcedx-vscode-lightning-50.16.0/syntaxes/html.tmLanguage.json
register @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1747
4/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:60 [Extension Host] Cannot find en-gb, defaulting to en
b @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:60
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:60 [Extension Host] (node:9590) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
b @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:60
2/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:60 [Extension Host] Cannot find en-gb, defaulting to en
b @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:60
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:60 [Extension Host] Activation Mode: autodetect
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:60 [Extension Host] Aura Components Extension Activated
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:60 [Extension Host] WorkspaceType detected: 4
3/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:60 [Extension Host] Cannot find en-gb, defaulting to en
b @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:60
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:60 [Extension Host] Activation Mode: autodetect
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:60 [Extension Host] Lightning Web Components Extension Activated
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:60 [Extension Host] WorkspaceType detected: 4
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:60 [Extension Host] SFDX CLI Extension Activated
5/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:60 [Extension Host] Cannot find en-gb, defaulting to en
b @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:60
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:60 [Extension Host] Listening on port 63009
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1961 [[object Object]]The "file" argument must be of type string. Received null
$onExtensionRuntimeError @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1961
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1961 TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received null
at validateString (/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/internal/validators.js:120)
at normalizeSpawnArguments (/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/child_process.js:415)
at Object.spawn (/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/child_process.js:551)
at Server. (/Users/simonmolloy/.vscode/extensions/salesforce.salesforce-vscode-slds-1.4.0/client/out/sldsLanguageClient.js:151)
at Object.onceWrapper (/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/events.js:421)
at Server.emit (/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/events.js:315)
at emitListeningNT (/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/net.js:1347)
at processTicksAndRejections (/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/internal/process/task_queues.js:83)
$onExtensionRuntimeError @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1961
4/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:60 [Extension Host] TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received null at validateString (internal/validators.js:120:11) at normalizeSpawnArguments (child_process.js:415:3) at Object.spawn (child_process.js:551:16) at Server. (/Users/simonmolloy/.vscode/extensions/salesforce.salesforce-vscode-slds-1.4.0/client/out/sldsLanguageClient.js:151:41) at Object.onceWrapper (events.js:421:28) at Server.emit (events.js:315:20) at emitListeningNT (net.js:1347:10) at processTicksAndRejections (internal/process/task_queues.js:83:21)
b @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:60
4/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:60 [Extension Host] Cannot find en-gb, defaulting to en
b @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:60
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:60 [Extension Host] Apex Debugger Extension Activated
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:60 [Extension Host] Setting up ISV Debugger environment variables
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:60 [Extension Host] Configured file watcher for .sfdx/sfdx-config.json
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:60 [Extension Host] Apex Replay Debugger Extension Activated
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:60 [Extension Host] Project is not for ISV Debugger
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:60 [Extension Host] Deleted environment variables SFDX_DEFAULTUSERNAME and SFDX_INSTANCE_URL
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:738 SFDX: Deploy Source to Org failed to run
onDidChangeNotification @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:738
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1734 Extension host terminated unexpectedly. Code: null Signal: SIGSEGV
_onExtensionHostCrashed @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1734
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:618 ERR Extension host terminated unexpectedly. The following extensions were running: vscode.microsoft-authentication, vscode.emmet, vscode.html-language-features, HugoOM.sfdx-autoheader, salesforce.salesforcedx-vscode-core, vscode.debug-auto-launch, vscode.git, ms-vsliveshare.vsliveshare, vscode.npm, salesforce.salesforcedx-vscode-lightning, dbaeumer.vscode-eslint, salesforce.salesforcedx-vscode-lwc, ms-vscode.js-debug, vscode.github-authentication, salesforce.salesforce-vscode-slds, salesforce.salesforcedx-vscode-apex, salesforce.salesforcedx-vscode-visualforce, salesforce.salesforcedx-vscode-apex-debugger, salesforce.salesforcedx-vscode-apex-replay-debugger, vscode.github, ms-vsliveshare.vsliveshare-audio, vscode.merge-conflict, vscode.testing-editor-contributions, vscode.typescript-language-features, vscode.configuration-editing, vscode.json-language-features, vscode.extension-editing
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:738 Extension host terminated unexpectedly.
onDidChangeNotification @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:738
bootstrap-window.js:1 [uncaught exception]: Error: This socket has been ended by the other party
g @ bootstrap-window.js:1
bootstrap-window.js:1 Error: This socket has been ended by the other party
at Socket.writeAfterFIN [as write] (/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/net.js:455)
at v.write (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2653)
at v._writeNow (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:76)
at Immediate. (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:76)
at processImmediate (/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/internal/timers.js:456)
g @ bootstrap-window.js:1
events.js:292 Uncaught Error: This socket has been ended by the other party
at Socket.writeAfterFIN [as write] (/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/net.js:455)
at v.write (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2653)
at v._writeNow (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:76)
at Immediate. (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:76)
at processImmediate (/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/internal/timers.js:456)
bootstrap-window.js:1 [uncaught exception]: Error: This socket has been ended by the other party
g @ bootstrap-window.js:1
bootstrap-window.js:1 Error: This socket has been ended by the other party
at Socket.writeAfterFIN [as write] (/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/net.js:455)
at v.write (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2653)
at v._writeNow (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:76)
at v.flush (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:76)
at v.dispose (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:76)
at Object.S [as dispose] (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:14)
at i.dispose (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:76)
at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2659
g @ bootstrap-window.js:1
events.js:292 Uncaught Error: This socket has been ended by the other party
at Socket.writeAfterFIN [as write] (/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/net.js:455)
at v.write (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2653)
at v._writeNow (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:76)
at v.flush (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:76)
at v.dispose (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:76)
at Object.S [as dispose] (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:14)
at i.dispose (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:76)
at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2659

@deepak1556
Copy link
Collaborator Author

Can you try the universal build or arm64 build insiders version https://code.visualstudio.com/insiders and see if the issue persists.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🍎 si Issues related to apple silicon freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues important Issue identified as high-priority upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-linked This is an upstream issue that has been reported upstream
Projects
None yet
Development

No branches or pull requests

7 participants
@andreialecu @deepak1556 @jtkiley @alexdima @rajtslegr @simonhyphen8 and others