fix: use allocationtype kold in v8 scriptormodule legacy lifetime #32339
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Change
In a recent Chromium upgrade, this CL changed the default value of
V8_SCRIPTORMODULE_LEGACY_LIFETIME
to false, and removed kOld type allocations. This change is causing a potential crash in v8 for Electron versions 17.0.0-alpha.4 and higher. This PR adds a suggested upsteam fix as a patch.There is an open PR for the upsteam fix here. Because we're moving 17-x-y from alpha to beta this week, I added this patch until the upsteam fix was merged, to add more stability to 17.0.0-beta.1.
This patch can be removed when either A) the linked upstream PR is merged, or B) Node.js removes weak refs from ScriptOrModule.
Checklist
npm test
passesRelease Notes
Notes: Fixes a potential crash in v8 by using allocation type: kOld in v8 ScriptOrModule legacy lifetime