Skip to content

[release/9.0-staging] JIT: revised fix for fp division issue in profile synthesis #115026

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: release/9.0-staging
Choose a base branch
from

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Apr 24, 2025

Backport of #115005 to release/9.0-staging

/cc @AndyAyersMS

Customer Impact

  • Customer reported
  • Found internally

Unexpected floating-point divide by zero exception. While we generally don't support running managed code with FP exceptions enabled, we also should not be generating such exceptions needlessly.

There is precedent for us back porting this kind of change, see eg: #76334

This is a revised version of a previous fix #113418. The original fix removed the divide by zero case, but allowed for 0.0/0.0, which also causes an FP exception (invalid operation).

Regression

  • Yes
  • No

.NET 9 added a fair amount of FP processing to the JIT that wasn't there in .NET 8.

Testing

Verified the JIT will no longer cause any FP exception from this computation.

Risk

Low, no diffs in SPMI.

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.

The previous fix #113396 could still leave us trying to evaluate 0.0/0.0,
which causes an invalid FP operation exception.

Make sure the divisor is non-zero.
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Apr 24, 2025
Copy link
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

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

lgtm. we will take for consideration in 9.0.x

@jeffschwMSFT jeffschwMSFT added the Servicing-consider Issue for next servicing release review label Apr 24, 2025
@jeffschwMSFT jeffschwMSFT added this to the 9.0.x milestone Apr 24, 2025
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 Servicing-consider Issue for next servicing release review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants