clavin

#47765: fix: add macos memory query fallback patch to avoid crash

Merged
Created: Jul 16, 2025, 12:05:32 AM
Merged: Jul 16, 2025, 10:18:54 AM
3 comments
Target: main

Description of Change

In https://crrev.com/c/6274964 the implementation for querying the physical memory on macOS was changed to use a sysctl call. In that same change the sysctl call was added to the sanbox allowlist.

This causes a problematic behavior: if an app that's running the old implementation (no sandbox exclusion for that sysctl call) gets swapped with the new implementation (uses new sysctl call) while it's running, then new child processes will trigger a sandbox permission error when calling the new method.

While this "hot-swapping" behavior isn't supported, many enterprise update scripts may do this anyways, triggering an unfortunate user experience where child processes can never spawn but the browser process continues to live and terminate them (until the app is restarted).

This PR adds a patch to incorporate the old implementation as a fallback, giving apps a reasonable grace period as they update Electron versions.

Checklist

Release Notes

Notes: Fixed a child process crash on macOS when the running application is replaced with one that has a newer implementation triggering the sandbox

Backports

37-x-y
Merged
PR Number
#47784
Merged At
Jul 16, 2025, 1:04:23 PM
Released In
v37.2.3
Release Date
Jul 16, 2025, 2:05:30 PM
38-x-y
Merged
PR Number
#47783
Merged At
Jul 16, 2025, 1:34:28 PM
Released In
v38.0.0-alpha.7
Release Date
Jul 17, 2025, 8:32:12 AM

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