Skip to content

Conversation

@MichalStrehovsky
Copy link
Member

@MichalStrehovsky MichalStrehovsky commented Nov 12, 2025

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

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.
Copilot AI review requested due to automatic review settings November 12, 2025 05:53
@github-actions github-actions bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Nov 12, 2025
Copilot finished reviewing on behalf of MichalStrehovsky November 12, 2025 05:55
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 ManyFields test classes to comply with the 65534 introduced fields limit per class
  • Moved field m65535 from the base class to the derived class, reducing ManyFields to 65534 introduced fields
  • Renamed ManyFieldsPlusOne to ManyFieldsPlusTwo to reflect that the derived class now introduces two fields instead of one

@MichalStrehovsky
Copy link
Member Author

/azp run runtime-nativeaot-outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

Thanks

@MichalStrehovsky
Copy link
Member Author

/ba-g timeouts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants