Repository navigation
[release/10.0] Preserve module initialization across ReadyToRun inlining - #135376
Draft
AaronRobinsonMSFT wants to merge 2 commits into
Draft
AaronRobinsonMSFT wants to merge 2 commits into
AaronRobinsonMSFT wants to merge 2 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a4258af2-2f1f-4af6-b46e-0f6a1fae207f
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @dotnet/crossgen-contrib |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a4258af2-2f1f-4af6-b46e-0f6a1fae207f
AaronRobinsonMSFT
marked this pull request as draft
October 8, 2026 00:10
jkotas
reviewed
Oct 8, 2026
| #define ARM64_MAX_BREAKPOINTS 8 | ||
| #define ARM64_MAX_WATCHPOINTS 2 | ||
|
|
||
| #ifndef CONTEXT_UNWOUND_TO_CALL |
This branch has not been deployed
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.
Fixes Issue #134283
main PR #134359
Description
Backports the ReadyToRun module-activation fix from #134359 to
release/10.0.Composite ReadyToRun can inline away the call that activates another assembly, leaving its module initializer unexecuted. This preserves activation dependencies for cross-module inlining, permits the global module type's stable token outside the version bubble, and activates the declaring module before resolving RVA static fields.
The executable regression coverage from the main PR is included. The compiler-test runner changed by the main PR no longer exists on
release/10.0, so that test-only change is intentionally omitted and the production fix is adapted to the older token-resolution implementation.Customer Impact
Without this fix, ReadyToRun-published applications can observe incorrect state when a module initializer's activation call is removed by cross-module inlining. In the reported case, an
UnsafeAccessorwrite performed by a module initializer is not observed and a private static field incorrectly remains unset.Regression
No. The original report confirms the issue also reproduces on .NET 10.
Testing
.\build.cmd clr+libs+host -arch x64 -rc Checked -lc Releasesrc\coreclr\inc\crosscomp.hredefinesCONTEXT_UNWOUND_TO_CALL, which is also defined by Windows SDK10.0.28000.0; warning C4005 is treated as error C2220.Risk
Moderate. The production changes are the narrowly scoped ReadyToRun fix already merged to main, adapted to the older
release/10.0token-resolution implementation, and the executable regression tests are included. Local validation is limited by the unrelated Windows SDK compatibility failure described above, so CI validation is required.Package authoring no longer needed in .NET 9
IMPORTANT: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older versions.
Note
This pull request was prepared with GitHub Copilot assistance.