Fix cgroup v2 memory max extraction#130377
Merged
janvorli merged 3 commits intoJul 9, 2026
Merged
Conversation
In the edge case when the current process is assigned to the root cgroup, the hierarchical memory limit extraction goes past the root cgroup hierarchy mount path and the process ends up crashing. This was discovered in google colab environment when attempting to run NativeAOT application in a jupyter notebook Close dotnet#130092
mangod9
approved these changes
Jul 8, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a crash in cgroup v2 memory limit discovery by stopping the parent-walk when the current cgroup path reaches the cgroup hierarchy mount (root cgroup case), avoiding attempts to resolve paths above the mount.
Changes:
- Add an explicit break when
cgroupPathLengthreachesmemory_cgroup_hierarchy_mount_lengthto prevent walking above the mount path. - Change the traversal loop to an unconditional loop (
while (true)) relying on the new break condition.
janvorli
commented
Jul 8, 2026
Member
Author
|
@mangod9 can you please re-approve? I've modified a comment based on copilot's feedback. |
mangod9
approved these changes
Jul 8, 2026
Member
Author
|
@mangod9 I am sorry, the github UI screwed the multiline comment edit, I had to fix it. Can you please approve it again? |
mangod9
approved these changes
Jul 8, 2026
Open
3 tasks
Member
Author
|
/backport to release/10.0 |
Contributor
|
Started backporting to |
4 tasks
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.
In the edge case when the current process is assigned to the root cgroup, the hierarchical memory limit extraction goes past the root cgroup hierarchy mount path and the process ends up crashing.
This was discovered in google colab environment when attempting to run NativeAOT application in a jupyter notebook
Close #130092