Fix native aot outerloop#121541
Merged
MichalStrehovsky merged 1 commit intodotnet:mainfrom Nov 12, 2025
Merged
Conversation
Test merging in dotnet#121078 caused us to start compiling this test again. We were not compiling it because more than 64k fields hits CodeView limitations in LF_STRUCTURE/LF_CLASS (can't have more than 65534 _introduced fields_). We assert and crash compilation. CoreCLR has it's own limitation of 65535 fields, including inherited, but not counting `object.m_pEEType` (that doesn't exist in CoreCLR CoreLib). This changes the test to not have a class with > 65535 introduced fields. This avoids the CodeView assert. We still don't generate correct CodeView for bigger classes. Not sure if it's worth adding blocking. We could block loading such types but 65534 is an odd number and CodeView is an odd reason.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a Native AOT compilation crash caused by CodeView limitations when a class has more than 65534 introduced fields. The test was inadvertently re-enabled after test merging in #121078, exposing an assert failure during compilation.
Key Changes:
- Restructured the
ManyFieldstest classes to comply with the 65534 introduced fields limit per class - Moved field m65535 from the base class to the derived class, reducing
ManyFieldsto 65534 introduced fields - Renamed
ManyFieldsPlusOnetoManyFieldsPlusTwoto reflect that the derived class now introduces two fields instead of one
Member
Author
|
/azp run runtime-nativeaot-outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
Author
|
/ba-g timeouts |
This was referenced Nov 12, 2025
Open
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Test merging in #121078 caused us to start compiling this test again. We were not compiling it because more than 64k fields hits CodeView limitations in LF_STRUCTURE/LF_CLASS (can't have more than 65534 introduced fields). We assert and crash compilation.
CoreCLR has it's own limitation of 65535 fields, including inherited, but not counting
object.m_pEEType(that doesn't exist in CoreCLR CoreLib).This changes the test to not have a class with > 65534 introduced fields. This avoids the CodeView assert. We still don't generate correct CodeView for bigger classes. Not sure if it's worth adding blocking. We could block loading such types but 65534 is an odd number and CodeView is an odd reason.
Cc @dotnet/ilc-contrib