Skip to content
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

SPMI: Handle "successful error cases" in near differ on arm64 #91783

Merged
merged 1 commit into from
Sep 12, 2023

Conversation

jakobbotsch
Copy link
Member

After #89654 SPMI replay will succeed instead of result in replay errors in expected error cases (such as BADCODE or EE exception). To support diffing such contexts, we record zero-sized assembly that the near differ uses. However, on arm64 there is some additional code that calls repCompileMethod to make some additional adjustments to the code blob, and in the "EE exception" cases we cannot replay this function, resulting in crash during asmdiff. This fixes the problem by only making the adjustments when we know there is any code.

An alternative solution could be to avoid invoking the neardiffer at all in the succeeding error cases, but this seemed like an ok pragmatic solution. However, if there are differing opinions then I would be fine with also pursuing this.

Fix #91257

After dotnet#89654 SPMI replay will succeed instead of result in replay errors
in expected error cases (such as BADCODE or EE exception). To support
diffing such contexts, we record zero-sized assembly that the near
differ uses. However, on arm64 there is some additional code that calls
repCompileMethod to make some additional adjustments to the code blob,
and in the "EE exception" cases we cannot replay this function,
resulting in crash during asmdiff. This fixes the problem by only making
the adjustments when we know there is any code.

An alternative solution could be to avoid invoking the neardiffer at all
in the succeeding error cases, but this seemed like an ok pragmatic
solution.

Fix dotnet#91257
@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 Sep 8, 2023
@ghost ghost assigned jakobbotsch Sep 8, 2023
@ghost
Copy link

ghost commented Sep 8, 2023

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

Issue Details

After #89654 SPMI replay will succeed instead of result in replay errors in expected error cases (such as BADCODE or EE exception). To support diffing such contexts, we record zero-sized assembly that the near differ uses. However, on arm64 there is some additional code that calls repCompileMethod to make some additional adjustments to the code blob, and in the "EE exception" cases we cannot replay this function, resulting in crash during asmdiff. This fixes the problem by only making the adjustments when we know there is any code.

An alternative solution could be to avoid invoking the neardiffer at all in the succeeding error cases, but this seemed like an ok pragmatic solution. However, if there are differing opinions then I would be fine with also pursuing this.

Fix #91257

Author: jakobbotsch
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@jakobbotsch jakobbotsch marked this pull request as ready for review September 11, 2023 15:54
@jakobbotsch
Copy link
Member Author

cc @dotnet/jit-contrib PTAL @BruceForstall

Copy link
Member

@BruceForstall BruceForstall left a comment

Choose a reason for hiding this comment

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

LGTM

@jakobbotsch jakobbotsch merged commit 8d4f8b8 into dotnet:main Sep 12, 2023
110 of 113 checks passed
@jakobbotsch jakobbotsch deleted the fix-91257 branch September 12, 2023 12:29
@ghost ghost locked as resolved and limited conversation to collaborators Oct 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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.

SPMI asmdiff errors on Arm64 Linux
2 participants