Skip to content

Conversation

@clavin
Copy link
Member

@clavin clavin commented Jul 16, 2025

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

@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Jul 16, 2025
@clavin clavin added semver/patch backwards-compatible bug fixes target/37-x-y PR should also be added to the "37-x-y" branch. target/38-x-y PR should also be added to the "38-x-y" branch. labels Jul 16, 2025
@clavin clavin marked this pull request as ready for review July 16, 2025 05:08
@clavin clavin requested a review from a team as a code owner July 16, 2025 05:08
Copy link
Member

@deepak1556 deepak1556 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh nice one! Maybe this needs to be called out in the release notes more than a normal fix ?

Copy link
Member

@samuelmaddock samuelmaddock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great patch description and overview. Thanks @clavin!

Copy link
Member

@VerteDinde VerteDinde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going to fast-track this one, since it has independent approvals

@VerteDinde VerteDinde added the fast-track 🚅 Indicates that this PR is intended to bypass the 24 hour rule. Needs approval from Releases label Jul 16, 2025
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Jul 16, 2025
@VerteDinde VerteDinde merged commit 67afc10 into main Jul 16, 2025
108 of 114 checks passed
@VerteDinde VerteDinde deleted the clavin/macos-memory-query-fallback branch July 16, 2025 15:18
@release-clerk
Copy link

release-clerk bot commented Jul 16, 2025

Release Notes Persisted

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

@trop
Copy link
Contributor

trop bot commented Jul 16, 2025

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

@trop trop bot added in-flight/38-x-y and removed target/38-x-y PR should also be added to the "38-x-y" branch. labels Jul 16, 2025
@trop
Copy link
Contributor

trop bot commented Jul 16, 2025

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

@trop trop bot added in-flight/37-x-y and removed target/37-x-y PR should also be added to the "37-x-y" branch. labels Jul 16, 2025
@trop trop bot added merged/37-x-y PR was merged to the "37-x-y" branch. merged/38-x-y PR was merged to the "38-x-y" branch. and removed in-flight/37-x-y in-flight/38-x-y labels Jul 16, 2025
kigh-ota pushed a commit to kigh-ota/electron that referenced this pull request Sep 30, 2025
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/37-x-y PR was merged to the "37-x-y" branch. merged/38-x-y PR was merged to the "38-x-y" branch. semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants