Skip to content

fix: revert enabling WASM trap handlers in all Node.js processes - #48973

Merged
VerteDinde merged 1 commit into
mainfrom
revert-wasm-trap-handlers
Nov 14, 2025
Merged

VerteDinde merged 1 commit into
mainfrom
revert-wasm-trap-handlers

Conversation

@VerteDinde

Copy link
Copy Markdown
Member

Description of Change

Addresses #48956

Looking into the dmp file stacktrace attached to the above issue, the wasm trap handlers appear to be crashing shortly after app launch. This PR reverts the change while we investigate and find a forward fix.

This reverts commit ca0b46b and PR #48788

Checklist

Release Notes

Notes: Fixed an issue where some apps would throw an exception on launch.

@VerteDinde VerteDinde added semver/patch backwards-compatible bug fixes 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 14, 2025
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Nov 14, 2025
@VerteDinde VerteDinde added the fast-track 🚅 Indicates that this PR is intended to bypass the 24 hour rule. Needs approval from Releases label Nov 14, 2025
@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Nov 14, 2025
@deepak1556

deepak1556 commented Nov 14, 2025 •

Copy link
Copy Markdown
Member

This is an issue with the main process and possibly I introduced a breaking change. Basically the wasm trap handlers need to be initialized before any wasm file can be compiled, however due to the requirement of feature flag parsing the code to enable it was added once the user main script start but before app#ready is called in

if (base::FeatureList::IsEnabled(features::kWebAssemblyTrapHandler)) {
electron::SetUpWebAssemblyTrapHandler();
}
. This is very likely the cause for crash if some apps were to trigger wasm compilation in that time. I suggest we sacrifice the feature flag detection for main process and move the code to enable it before NodeBindings::Initialize in

@deepak1556

Copy link
Copy Markdown
Member

For child processes renderer and utility, it is done at the correct stages as feature list there gets initialized by content layer before our code gets invoked so it allowed moving the code earlier before user script execution.

@VerteDinde

Copy link
Copy Markdown
Member Author

Spoke to @deepak1556 and @MarshallOfSound outside of this PR, we're going to land this clean revert to fix the crash and then do a fast follow fix 🙇‍♀️

@VerteDinde
VerteDinde merged commit 71be38f into main Nov 14, 2025
@VerteDinde
VerteDinde deleted the revert-wasm-trap-handlers branch November 14, 2025 23:23
@release-clerk

release-clerk Bot commented Nov 14, 2025

Copy link
Copy Markdown

Release Notes Persisted

Fixed an issue where some apps would throw an exception on launch.

@trop

trop Bot commented Nov 14, 2025

Copy link
Copy Markdown
Contributor

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

@trop

trop Bot commented Nov 14, 2025

Copy link
Copy Markdown
Contributor

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

@trop trop Bot added in-flight/40-x-y 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. and removed 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. in-flight/39-x-y in-flight/40-x-y labels Nov 14, 2025
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
…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
…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

fast-track 🚅 Indicates that this PR is intended to bypass the 24 hour rule. Needs approval from Releases 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. semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants