fix: add macos memory query fallback patch to avoid crash#47765
Merged
VerteDinde merged 1 commit intomainfrom Jul 16, 2025
Merged
fix: add macos memory query fallback patch to avoid crash#47765VerteDinde merged 1 commit intomainfrom
VerteDinde merged 1 commit intomainfrom
Conversation
deepak1556
approved these changes
Jul 16, 2025
Member
deepak1556
left a comment
There was a problem hiding this comment.
Oh nice one! Maybe this needs to be called out in the release notes more than a normal fix ?
samuelmaddock
approved these changes
Jul 16, 2025
Member
samuelmaddock
left a comment
There was a problem hiding this comment.
Great patch description and overview. Thanks @clavin!
VerteDinde
approved these changes
Jul 16, 2025
Member
VerteDinde
left a comment
There was a problem hiding this comment.
Going to fast-track this one, since it has independent approvals
|
Release Notes Persisted
|
This was referenced Jul 16, 2025
Contributor
|
I have automatically backported this PR to "38-x-y", please check out #47783 |
Contributor
|
I have automatically backported this PR to "37-x-y", please check out #47784 |
georgexu99
pushed a commit
that referenced
this pull request
Jul 16, 2025
kigh-ota
pushed a commit
to kigh-ota/electron
that referenced
this pull request
Sep 30, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 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
npm testpassesRelease 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