Pre-initialize InvariantCulture such that it can be safely used when creating stack traces#129189
Open
eduardo-vp wants to merge 2 commits into
Open
Pre-initialize InvariantCulture such that it can be safely used when creating stack traces#129189eduardo-vp wants to merge 2 commits into
eduardo-vp wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR changes CoreCLR startup to proactively run System.Globalization.CultureInfo’s class initializer during AppDomain::SetupSharedStatics(), so CultureInfo.InvariantCulture is initialized before stack trace generation paths might try to use it under extreme memory pressure (avoiding the checked-build assert observed in #129159).
Changes:
- During default AppDomain startup, force
CultureInfoclass initialization viaCheckRunClassInitThrowing(). - Add a targeted comment documenting the motivation (stack trace creation under high memory pressure).
Member
Author
|
/azp list |
Member
Author
|
/azp run runtime-coreclr outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
Author
|
/azp run runtime-coreclr outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Open
3 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.
The following assert is being hit when creating the stack trace in the test.
runtime/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureInfo.cs
Lines 444 to 451 in 89cd18a
Fixes #129159.