Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/7.0] Fix reserving executable memory as per allocation type in ClrVirtualAllocWithinRange() #83958

Merged

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Mar 27, 2023

Backport of #83819 to release/7.0

/cc @janvorli @k15tfu

Customer Impact

A customers sometimes get a System.OutOfMemoryException exception in .NET 7 app on macOS ARM64 in arbitrary places. The issue is caused by a bug in the ClrVirtualAllocWithinRange specific to macOS. It happens when the application uses up all the executable memory preallocated at app start time and the ExecutableAllocator tries to allocate more using the ClrVirtualAllocWithinRange. That function doesn't set the special MEM_RESERVE_EXECUTABLE flag that causes the PAL to mmap the memory range with the MAP_JIT flag that enables the special Apple M1 processor support for regions that can be switched between read-execute and read-write modes per thread.

Testing

CI testing, local targeted testing

Risk

Low, the change is very small and only influences the problematic case and doesn't change any other behavior.

@janvorli
Copy link
Member

In the failed leg, only one test has failed and that was with a known issue:
#83901

@janvorli janvorli added the Servicing-consider Issue for next servicing release review label Mar 27, 2023
@janvorli janvorli added this to the 7.0.x milestone Mar 27, 2023
@janvorli janvorli requested a review from jkotas March 27, 2023 20:40
Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

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

approved. we will take for consideration in 7.0.x

@rbhanda rbhanda added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Mar 28, 2023
@rbhanda rbhanda modified the milestones: 7.0.x, 7.0.6 Mar 28, 2023
@carlossanlop
Copy link
Member

I'm retargeting this PR to the new release/7.0-staging branch, which is the one that we will use from now on for servicing fixes.

Repo maintainers will now be allowed to merge their own servicing PR as long as it meets the requirements:

  • It is approved by Tactics (signaled by adding the Servicing-approved label).
  • It's signed-off by an area owner.
  • The CI is green, or the failures are investigated as unrelated.
  • And if the PR touches an OOB package, the necessary OOB authoring changes are added.

The new process is described here: runtime/docs/project/library-servicing.md.

The infra team will be actively monitoring servicing PRs to ensure all requirements are met and to help with any issues.

Let me know if you have any questions.

@carlossanlop
Copy link
Member

Reminder: April 10th is the last day to merge backport PRs to ensure they get included in the May Release. PR owners are now in charge of merging their own PRs.

@janvorli
Copy link
Member

janvorli commented Apr 4, 2023

@jkotas can you please approve this?

@janvorli janvorli closed this Apr 5, 2023
@janvorli janvorli reopened this Apr 5, 2023
@janvorli
Copy link
Member

janvorli commented Apr 7, 2023

@carlossanlop I can see that an extra commit 6a533c1 was added to this PR by dotnet-maestro. It updates emsdk version. I don't know why that happened - could it be some bad merge when you have retargetted this PR? I can see that wasm / tvos tests are failing, so I wonder if it is because of that.

@carlossanlop
Copy link
Member

carlossanlop commented Apr 7, 2023

@carlossanlop I can see that an extra commit 6a533c1 was added to this PR by dotnet-maestro.

Not sure why that commit was added, but it shouldn't be there. Can you please remove it, @janvorli? The dependency flows are happening in separate automated PRs.

Edit: Fixed it with GitHub suggestions.

NuGet.config Outdated Show resolved Hide resolved
eng/Version.Details.xml Outdated Show resolved Hide resolved
eng/Version.Details.xml Outdated Show resolved Hide resolved
eng/Version.Details.xml Outdated Show resolved Hide resolved
eng/Version.Details.xml Outdated Show resolved Hide resolved
eng/Versions.props Outdated Show resolved Hide resolved
@AaronRobinsonMSFT
Copy link
Member

@carlossanlop Any chance we can merge this isn now that it is green?

@AaronRobinsonMSFT AaronRobinsonMSFT merged commit 50722b0 into release/7.0-staging Apr 10, 2023
@AaronRobinsonMSFT AaronRobinsonMSFT deleted the backport/pr-83819-to-release/7.0 branch April 10, 2023 22:08
@ghost ghost locked as resolved and limited conversation to collaborators May 11, 2023
@leecow leecow modified the milestones: 7.0.6, 7.0.7 Jun 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-VM-coreclr Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants