Skip to content

fix: enable wasm trap handlers in all Node.js processes#48788

Merged
deepak1556 merged 2 commits intomainfrom
robo/enable_wasm_trap_handler
Nov 7, 2025
Merged

fix: enable wasm trap handlers in all Node.js processes#48788
deepak1556 merged 2 commits intomainfrom
robo/enable_wasm_trap_handler

Conversation

@deepak1556
Copy link
Copy Markdown
Member

Description of Change

Found while investigating microsoft/vscode#273191

Since #47186 we had accidentally disabled V8 trap handlers in browser and utility process. This incurs performance cost when executing wasm due to inlined bound checks.

Enable the feature back and align it with upstream based on the feature parameter across all processes features::kWebAssemblyTrapHandler

Current matrix of enabled platforms.

Linux, Windows, MacOS - x86_64
Linux, MacOS - arm64

Release Notes

Notes: Reenable V8 trap handlers for wasm in browser and utility process, improves runtime execution of wasm

@deepak1556 deepak1556 added semver/patch backwards-compatible bug fixes target/37-x-y PR should also be added to the "37-x-y" branch. target/38-x-y PR should also be added to the "38-x-y" branch. target/39-x-y PR should also be added to the "39-x-y" branch. target/40-x-y PR should also be added to the "40-x-y" branch. labels Nov 5, 2025
@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Nov 5, 2025
@deepak1556 deepak1556 force-pushed the robo/enable_wasm_trap_handler branch from e6e6567 to 4032771 Compare November 6, 2025 15:26
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Nov 6, 2025
@deepak1556 deepak1556 force-pushed the robo/enable_wasm_trap_handler branch from 4032771 to f7ea5f4 Compare November 6, 2025 17:49
@deepak1556 deepak1556 requested a review from codebytere November 6, 2025 17:50
@deepak1556
Copy link
Copy Markdown
Member Author

New commit pushes the registration to respective process since we need to wait for feature list initialization.

@deepak1556 deepak1556 merged commit ca0b46b into main Nov 7, 2025
105 of 106 checks passed
@deepak1556 deepak1556 deleted the robo/enable_wasm_trap_handler branch November 7, 2025 11:56
@release-clerk
Copy link
Copy Markdown

release-clerk bot commented Nov 7, 2025

Release Notes Persisted

Reenable V8 trap handlers for wasm in browser and utility process, improves runtime execution of wasm

@trop
Copy link
Copy Markdown
Contributor

trop bot commented Nov 7, 2025

I was unable to backport this PR to "37-x-y" cleanly;
you will need to perform this backport manually.

@trop
Copy link
Copy Markdown
Contributor

trop bot commented Nov 7, 2025

I have automatically backported this PR to "39-x-y", please check out #48837

@trop trop bot added the in-flight/39-x-y label Nov 7, 2025
@trop
Copy link
Copy Markdown
Contributor

trop bot commented Nov 7, 2025

I have automatically backported this PR to "38-x-y", please check out #48838

@trop trop bot removed the target/39-x-y PR should also be added to the "39-x-y" branch. label Nov 7, 2025
@trop
Copy link
Copy Markdown
Contributor

trop bot commented Nov 7, 2025

I have automatically backported this PR to "40-x-y", please check out #48839

@trop trop bot added the in-flight/38-x-y label Nov 7, 2025
@trop trop bot added merged/40-x-y PR was merged to the "40-x-y" branch. and removed in-flight/40-x-y labels Nov 7, 2025
@trop trop bot added merged/39-x-y PR was merged to the "39-x-y" branch. and removed in-flight/38-x-y in-flight/39-x-y labels Nov 11, 2025
@beyondkmp
Copy link
Copy Markdown

crashed caused by this pr.

Translated Report (Full Report Below)

Process:               Electron [73343]
Path:                  /Users/USER/*/[Electron.app/Contents/MacOS/Electron](http://electron.app/Contents/MacOS/Electron)
Identifier:            com.github.Electron
Version:               39.2.0 (39.2.0)
Code Type:             ARM-64 (Native)
Parent Process:        node [73228]
Responsible:           iTerm2 [1488]
User ID:               501

Date/Time:             2025-11-14 12:57:52.0055 +0800
OS Version:            macOS 15.7.1 (24G231)
Report Version:        12
Anonymous UUID:        04D8546F-C1A9-8ADB-CBF0-29627135DF07

Sleep/Wake UUID:       6E542B32-28CE-4B78-A0FE-42275B19A43C

Time Awake Since Boot: 140000 seconds
Time Since Wake:       88027 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BREAKPOINT (SIGTRAP)
Exception Codes:       0x0000000000000001, 0x000000010ebcc140

Termination Reason:    Namespace SIGNAL, Code 5 Trace/BPT trap: 5
Terminating Process:   exc handler [73343]

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   Electron Framework                       0x10ebcc140 v8::V8::EnableWebAssemblyTrapHandler(bool) + 100
1   Electron Framework                       0x10facf50c v8::CpuProfileNode::GetNodeId() const + 162012
2   Electron Framework                       0x10f3514f4 rust_png$cxxbridge1$Reader$try_get_chrm + 187688
3   Electron Framework                       0x11132468c _v8_internal_Node_Print(void*) + 5989516
4   Electron Framework                       0x10f07fe24 node::PrincipalRealm::wasm_streaming_object_constructor() const + 54672
5   Electron Framework                       0x10f07fd4c node::PrincipalRealm::wasm_streaming_object_constructor() const + 54456
6   Electron Framework                       0x10ec92690 node::inspector::protocol::Value::AppendSerialized(std::__Cr::vector<unsigned char, std::__Cr::allocator<unsigned char>>*) const + 71688
7   Electron Framework                       0x10ec8f014 node::inspector::protocol::Value::AppendSerialized(std::__Cr::vector<unsigned char, std::__Cr::allocator<unsigned char>>*) const + 57740
8   Electron Framework                       0x10ef1a3bc v8::Message::GetScriptOrigin() const + 22332
9   Electron Framework                       0x10ef19d7c v8::Message::GetScriptOrigin() const + 20732
10  Electron Framework                       0x10f9e0aec ElectronMain + 124
11  dyld                                     0x19b3deb98 start + 6076

@deepak1556
Copy link
Copy Markdown
Member Author

@beyondkmp please share the minidump file from crashpad or if you have a repro that would be better too.

VerteDinde added a commit that referenced this pull request Nov 14, 2025
VerteDinde added a commit that referenced this pull request Nov 14, 2025
)

Revert "fix: enable wasm trap handlers in all Node.js  processes (#48788)"

This reverts commit ca0b46b.
trop bot added a commit that referenced this pull request Nov 14, 2025
…)"

This reverts commit ca0b46b.

Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
trop bot added a commit that referenced this pull request Nov 14, 2025
…)"

This reverts commit ca0b46b.

Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
VerteDinde added a commit that referenced this pull request Nov 15, 2025
)

Revert "fix: enable wasm trap handlers in all Node.js processes (#48788)"

This reverts commit ca0b46b.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
VerteDinde added a commit that referenced this pull request Nov 15, 2025
)

Revert "fix: enable wasm trap handlers in all Node.js processes (#48788)"

This reverts commit ca0b46b.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
nilayarya pushed a commit to nilayarya/electron that referenced this pull request Nov 21, 2025
* fix: enable wasm trap handlers in all Node.js  processes

* fix: separate registrations to account for featurelist init
nilayarya pushed a commit to nilayarya/electron that referenced this pull request Nov 21, 2025
…ctron#48973)

Revert "fix: enable wasm trap handlers in all Node.js  processes (electron#48788)"

This reverts commit ca0b46b.
nilayarya added a commit to nilayarya/electron that referenced this pull request Nov 21, 2025
* fix: enable wasm trap handlers in all Node.js  processes

* fix: separate registrations to account for featurelist init
nilayarya added a commit to nilayarya/electron that referenced this pull request Nov 21, 2025
…ctron#48973)

Revert "fix: enable wasm trap handlers in all Node.js  processes (electron#48788)"

This reverts commit ca0b46b.
nilayarya added a commit to nilayarya/electron that referenced this pull request Nov 21, 2025
* fix: enable wasm trap handlers in all Node.js  processes

* fix: separate registrations to account for featurelist init
nilayarya added a commit to nilayarya/electron that referenced this pull request Nov 21, 2025
…ctron#48973)

Revert "fix: enable wasm trap handlers in all Node.js  processes (electron#48788)"

This reverts commit ca0b46b.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged/39-x-y PR was merged to the "39-x-y" branch. merged/40-x-y PR was merged to the "40-x-y" branch. needs-manual-bp/37-x-y semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants