Skip to content

[release/6.0] Fix code heap reservation size - #59918

Merged
jeffschwMSFT merged 1 commit into
release/6.0from
backport/pr-59883-to-release/6.0
Oct 4, 2021
Merged

[release/6.0] Fix code heap reservation size#59918
jeffschwMSFT merged 1 commit into
release/6.0from
backport/pr-59883-to-release/6.0

Conversation

@github-actions

@github-actionsgithub-actionsBot commented Oct 4, 2021

Copy link
Copy Markdown
Contributor

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
@ghostghost added the area-VM-coreclr label Oct 4, 2021
@janvorli
janvorli requested a review from jkotasOctober 4, 2021 14:29
@janvorlijanvorli self-assigned this Oct 4, 2021
@janvorlijanvorli added this to the 6.0.0 milestone Oct 4, 2021
@janvorlijanvorli added the Servicing-consider Issue for next servicing release review label Oct 4, 2021

@jeffschwMSFTjeffschwMSFT left a comment

Copy link
Copy Markdown
Member

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

@jeffschwMSFTjeffschwMSFT 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.0Oct 4, 2021
@hoyosjs
hoyosjs deleted the backport/pr-59883-to-release/6.0 branch October 4, 2021 23:09
@ghostghost locked as resolved and limited conversation to collaborators Nov 4, 2021
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-VM-coreclrServicing-approvedApproved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@jkotas@jeffschwMSFT@janvorli