talshalti

#54840: fix: prevent renderer crashes during ShadowRealm GC

Merged
Created: Oct 11, 2026, 4:07:38 PM
Merged: Oct 12, 2026, 8:12:19 PM
10 comments
Target: main

Description of Change

Fixes #54637. Backports the landed Chromium fix until Electron's Chromium rolls include it. Full-GC metrics attributed to a ShadowRealm currently reach NOTREACHED() in its UKM accessor and crash the renderer. Return no recorder and an invalid source ID, which the existing metrics caller handles.

Adds a crash fixture covering ordinary, ShadowRealm, and nested ShadowRealm full GC. Credits Hidekazu Kondo's original fix in #52386 and supplies the upstream change and regression coverage requested there.

Please consider backporting to 44-x-y and 45-x-y. The patch applies cleanly to the Chromium versions currently pinned by main (157.0.8091.0), Electron 44 (152.0.7977.130), and Electron 45 (156.0.8078.12).

Validation on Windows x64:

  • Built the PR's native source with Electron's standard testing configuration.
  • All 39 crash cases passed, including the ShadowRealm GC regression.
  • Full repository lint passed on the PR source.
  • Full, unfiltered npm test completed but did not pass; failures remain under investigation.
  • Local validation covers Windows x64; release-branch and cross-platform validation remain pending.

Checklist

Release Notes

Notes: Fixed renderer crashes during garbage collection inside ShadowRealms.

Backports

44-x-y
Merged
PR Number
#54865
Merged At
Oct 13, 2026, 4:56:41 AM
Released In
Not yet
Release Date
Not yet
45-x-y
Merged
PR Number
#54864
Merged At
Oct 13, 2026, 7:01:54 AM
Released In
Not yet
Release Date
Not yet

Semver Impact

Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.

Semantic Versioning helps users understand the impact of updates:

  • Major (X.y.z): Breaking changes that may require code modifications
  • Minor (x.Y.z): New features that maintain backward compatibility
  • Patch (x.y.Z): Bug fixes that don't change the API
  • None: Changes that don't affect using facing parts of Electron