Skip to content

[release/11.0-preview6] Avoid stripping IL of non-async Task-returning methods#129975

Merged
svick merged 1 commit into
release/11.0-preview6from
backport/pr-129884-to-release/11.0-preview6
Jun 30, 2026
Merged

[release/11.0-preview6] Avoid stripping IL of non-async Task-returning methods#129975
svick merged 1 commit into
release/11.0-preview6from
backport/pr-129884-to-release/11.0-preview6

Conversation

@github-actions

@github-actions github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Backport of #129884 to release/11.0-preview6

/cc @jakobbotsch

Customer Impact

  • Customer reported
  • Found internally

Crossgen2 may strip IL of Task-returning methods that will be needed at runtime if runtime async is enabled. This results in NullReferenceException at runtime. Reported in #129813.

Regression

  • Yes
  • No

Introduced in #128384 that started depending on user IL when compiling async variants of non-async Task/ValueTask-returning methods.

Testing

Verified that customer's test case progresses further when IL stripping is disabled.

Risk

Low. Disable stripping of IL for non-async Task-returning methods.

The IL of these may be needed at runtime to compile async versions.
@github-actions github-actions Bot added the area-crossgen2-coreclr only use for closed issues label Jun 29, 2026
@JulieLeeMSFT

Copy link
Copy Markdown
Member

/ba-g all known test errors.

@JulieLeeMSFT JulieLeeMSFT added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Jun 29, 2026
@JulieLeeMSFT JulieLeeMSFT added this to the 11.0.0 milestone Jun 29, 2026
@JulieLeeMSFT

JulieLeeMSFT commented Jun 29, 2026

Copy link
Copy Markdown
Member

@wtgodbe and @svick, it is approved, but please hold. Checking if Jakob is working on a new fix. #129990

@JulieLeeMSFT

Copy link
Copy Markdown
Member

@jakobbotsch, is this PR still needed or do we need the new PR - #129999?

@jakobbotsch

Copy link
Copy Markdown
Member

@jakobbotsch, is this PR still needed or do we need the new PR - #129999?

Yes, we need this PR, it is a separate issue from what #129999 is solving.

@wtgodbe

wtgodbe commented Jun 29, 2026

Copy link
Copy Markdown
Member

I don't have perms to JIT and merge this

@svick svick merged commit 3e2ff44 into release/11.0-preview6 Jun 30, 2026
145 of 154 checks passed
@svick svick deleted the backport/pr-129884-to-release/11.0-preview6 branch June 30, 2026 10:15
@dotnet-milestone-bot dotnet-milestone-bot Bot modified the milestones: 11.0.0, 11.0-preview6 Jun 30, 2026
rolfbjarne pushed a commit to dotnet/macios that referenced this pull request Jul 3, 2026
…ons and re-enable the x64 CoreLib composite root (#25876)

## Description

This PR improves R2R on Apple mobile in Debug.

The first fix addresses the crossgen2 failure in #25867. The `_SelectR2RAssemblies` target excluded user assemblies from the ReadyToRun composite by bare file name, but loose assemblies copied into resource subfolders of the app bundle, such as Uno's `uno.ai.xamlgeneration.assets` tooling assets, have a `PublishFolderType` of Resource and an empty `NuGetPackageId`, so they were misclassified as user assemblies and added to `PublishReadyToRunExclude`. 

The second change re-enables the `System.Private.CoreLib` composite-root optimization on x64. That optimization was scoped to arm64 RuntimeIdentifiers in #25787 because it regressed x64 builds with a `System.Runtime.Intrinsics.Vector256` crash, but the underlying crossgen2 issue is fixed by dotnet/runtime#129975, now backported to release/11.0-preview6, so the arm64-only restriction is removed and `PublishReadyToRunCompositeRoots` is applied to all RuntimeIdentifiers again.

Fixes #25867
Fixes #25734

---------

Co-authored-by: Milos Kotlar <kotlarmilos@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants