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

Fix ABIStress test hashing padding #88097

Merged
merged 1 commit into from
Jun 27, 2023

Conversation

jakobbotsch
Copy link
Member

@jakobbotsch jakobbotsch commented Jun 27, 2023

ABIStress was storing data inside of padding and hashing it when trying to determine if all values made it through correctly. Make sure we only hash the fields.

With physical promotion enabled this causes the test to fail. That's because of this type:

public struct I128_2 { public byte F0; public Int128 F1; public I128_2(byte f0, Int128 f1) => (F0, F1) = (f0, f1); }

which has 15 bytes of padding in it. When the constructor is invoked, a temp is created, and physical promotion ends up promoting that temp and only writing the significant "field" parts.

I verified that regular promotion also causes the test to fail if a type is added that is regularly promoted, e.g. with struct S { public byte F0; public long F1; } the same problem is hit on main.

ABIStress was including padding in its hashing when trying to determine
if all values made it through correctly. Make sure we only hash the
fields that actually store data.
@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 Jun 27, 2023
@ghost ghost assigned jakobbotsch Jun 27, 2023
@ghost
Copy link

ghost commented Jun 27, 2023

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

Issue Details

ABIStress was including padding in its hashing when trying to determine if all values made it through correctly. Make sure we only hash the fields that actually store data.

With physical promotion enabled this causes the test to fail. That's because of this type:

public struct I128_2 { public byte F0; public Int128 F1; public I128_2(byte f0, Int128 f1) => (F0, F1) = (f0, f1); }

which has 15 bytes of padding in it.

I verified that regular promotion also causes the test to fail if a type is added that is regularly promoted, e.g. with struct S { public byte F0; public long F1; } the same problem is hit on main.

Author: jakobbotsch
Assignees: jakobbotsch
Labels:

area-CodeGen-coreclr

Milestone: -

@jakobbotsch
Copy link
Member Author

cc @dotnet/jit-contrib PTAL @AndyAyersMS

@jakobbotsch jakobbotsch requested a review from AndyAyersMS June 27, 2023 19:03
@jakobbotsch jakobbotsch merged commit d879656 into dotnet:main Jun 27, 2023
@jakobbotsch jakobbotsch deleted the fix-abistress-test branch June 27, 2023 22:36
@ghost ghost locked as resolved and limited conversation to collaborators Jul 28, 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.

2 participants