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

fix: microtasks policy in CreateEnvironment #29809

Conversation

trop[bot]
Copy link
Contributor

@trop trop bot commented Jun 21, 2021

Backport of #29531

See that PR for details.

Notes: fix crashes in debug builds caused by microtasks policy mismatch

indutny and others added 7 commits June 21, 2021 05:06
Microtasks policy should not be updated for the renderer because
`NodeBindings::CreateEnvironment` might be entered with or without
`UvRunOnce()` on stack. One of the examples of such calls is
`window.open()` which is possible to invoke while `uv_run()` is still
running (e.g. with `setImmediate()`).

All in all, it doesn't matter that much which policy we use since
`v8::MicrotasksScope` has a check for the policy in its destructor and
no commits will be made if the policy is `kExplicit`. It is important,
however, to not change the policy in the middle of `UvRunOnce()` so we
should respect whatever we currently have and move on.

Fix: #29463
…index.html

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
…index.html

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Jun 21, 2021
@trop trop bot mentioned this pull request Jun 21, 2021
5 tasks
@trop trop bot added 14-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes labels Jun 21, 2021
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Jun 21, 2021
@zcbenz zcbenz merged commit 12f8358 into 14-x-y Jun 21, 2021
@zcbenz zcbenz deleted the trop/14-x-y-bp-fix-microtasks-policy-in-createenvironment-1624251993310 branch June 21, 2021 06:49
@release-clerk
Copy link

release-clerk bot commented Jun 21, 2021

Release Notes Persisted

fix crashes in debug builds caused by microtasks policy mismatch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
14-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants