Skip to content

Add the _requiresAlign8 bool to the compare and mangled name for GCStaticEETypeNode.cs#107650

Merged
MichalStrehovsky merged 2 commits intodotnet:mainfrom
yowl:gcstaticee-compare
Sep 11, 2024
Merged

Add the _requiresAlign8 bool to the compare and mangled name for GCStaticEETypeNode.cs#107650
MichalStrehovsky merged 2 commits intodotnet:mainfrom
yowl:gcstaticee-compare

Conversation

@yowl
Copy link
Copy Markdown
Contributor

@yowl yowl commented Sep 10, 2024

This PR (from downstream dotnet/runtimelab#2681) adds the _requiresAlign8 bool to both the compare and mangled name. It is possible for 2 nodes to have the same GC map but have differing align 8 requirements causing an assert in the sort, and a duplicate symbol name.

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Sep 10, 2024
Copy link
Copy Markdown
Member

@MichalStrehovsky MichalStrehovsky left a comment

Choose a reason for hiding this comment

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

Thank you!

Copy link
Copy Markdown
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

Thanks! I assume we want to backport this to .NET 9

@MichalStrehovsky MichalStrehovsky merged commit de8e66d into dotnet:main Sep 11, 2024
@MichalStrehovsky
Copy link
Copy Markdown
Member

Thanks! I assume we want to backport this to .NET 9

I'm on the fence. The duplicate symbol means that this will not actually link and the failure mode will be pretty obvious (duplicate symbol for a GCStatic EEType). We haven't hit this in testing so I assume it's quite rare to have doubles in threadstatics. It's not a regression since we didn't have ARM32 previously. @dotnet/ilc-contrib for thoughts.

@jkotas
Copy link
Copy Markdown
Member

jkotas commented Sep 11, 2024

It is a bug in new .NET 9 feature. Bugs in new features meet the backport bar.

@yowl How did you find this bug? Was it in something real?

@yowl
Copy link
Copy Markdown
Contributor Author

yowl commented Sep 11, 2024

@jkotas, it was in compiling a real Avalonia XPF app. Avalonia don't support NativeAOT-LLVM for the Wasm target, so in that sense it was not real.

@yowl
Copy link
Copy Markdown
Contributor Author

yowl commented Sep 11, 2024

The duplicate symbol

You don't actually get that far as the sorting asserts. The only way I saw the duplicate symbol was with half the fix.

@jkotas
Copy link
Copy Markdown
Member

jkotas commented Sep 11, 2024

it was in compiling a real Avalonia XPF app

It means that Avalonia contains thread static fields that need alignment. We should backport this to .NET 9.

@jkotas
Copy link
Copy Markdown
Member

jkotas commented Sep 11, 2024

/backport to release/9.0

@github-actions
Copy link
Copy Markdown
Contributor

Started backporting to release/9.0: https://github.com/dotnet/runtime/actions/runs/10817533064

jtschuster pushed a commit to jtschuster/runtime that referenced this pull request Sep 17, 2024
sirntar pushed a commit to sirntar/runtime that referenced this pull request Sep 30, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Oct 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-NativeAOT-coreclr community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants