-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[NativeAOT] Respect Align8 flag for thread statics #105905
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this work? AFAICT,
RhNewObject
already takesRequiresAlign8
into account.When I looked at the root cause of this a while back, the problem was that
RequiresAlign8
isn't set on the specialgcDesc
method tables (by the compiler, at least - I didn't check dynamic statics).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point.
I will double check when I get to office with my ARM device. I assumed that if the test passes it should be all right but I could have overlooked something in the process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The relevant place to fix would be this one:
runtime/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ILScanner.cs
Line 760 in ffc1174
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SingleAccretion Good catch!
dotnet/runtimelab#2609 worked around this problem by allocating all thread statics with 8-byte alignment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree we should revert it... I wanted to do a clean build on my RPi to figure out if I had some stale build artifacts... but unfortunately that turned out to be more painful than I expected. The combination of build tool updates and zlib-ng seems to hit a compiler bug now and I need to figure out first how to get past it:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out, it was indeed failing even on my machine. I suspect that I accidentally made the final change with adding the
if (pMethodTable->RequiresAlign8)
in a wrong VS Code window and I changed it on my local machine instead of the remote SSH session on the Raspberry Pi. I waited for the CI to be green but I also forgot that the inner loop doesn't run the smoke tests on ARM32.I started working on a proper fix. Some early working attempt is here:
filipnavara@0ccb0d4. It's not exactly pretty. I'll sleep on it for a day or two before submitting it.