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/6.0] Fix code heap reservation size #59918

Merged
merged 1 commit into from
Oct 4, 2021

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Oct 4, 2021

Backport of #59883 to release/6.0

/cc @janvorli

Customer Impact

Methods with huge amount of code can cause crashes at runtime due to not enough memory reserved for the related code heap. This happens when the code heap reservation size is above a minimum reservation (64kB on 32 bit platforms, 512kB on 64 bit platforms) and it is less than 16 bytes smaller than a virtual memory allocation granularity multiple.

Testing

CoreCLR pri 1 tests.

Risk

Low, the fix just enlarges size of memory reservation for code heap in the affected cases by 16 bytes.

When I've moved the heap metadata out of the actual code heaps some time
ago, I've forgotten to account for the personality routine slot
allocated at the beginning of the heaps. This was exposed by an assert when
executing under the JIT stress mode 2.

This change fixes it by adding accounting for those.

Close #59794
@janvorli janvorli requested a review from jkotas October 4, 2021 14:29
@janvorli janvorli self-assigned this Oct 4, 2021
@janvorli janvorli added this to the 6.0.0 milestone Oct 4, 2021
@janvorli janvorli added the Servicing-consider Issue for next servicing release review label Oct 4, 2021
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 should take this for consideration in .NET 6

@jeffschwMSFT jeffschwMSFT added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Oct 4, 2021
@jeffschwMSFT jeffschwMSFT merged commit 7a751b0 into release/6.0 Oct 4, 2021
@hoyosjs hoyosjs deleted the backport/pr-59883-to-release/6.0 branch October 4, 2021 23:09
@ghost ghost locked as resolved and limited conversation to collaborators Nov 4, 2021
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.

3 participants