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

[NativeAOT] Fix MD array GC series #86877

Merged
merged 4 commits into from
May 30, 2023
Merged

[NativeAOT] Fix MD array GC series #86877

merged 4 commits into from
May 30, 2023

Conversation

VSadov
Copy link
Member

@VSadov VSadov commented May 29, 2023

this was triggering GC asserts and test failures in a side project.

turns out it s not GC’s fault

@ghost
Copy link

ghost commented May 29, 2023

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

Issue Details

need to figure how to make a test for this

Author: VSadov
Assignees: VSadov
Labels:

area-NativeAOT-coreclr

Milestone: -

@@ -550,7 +550,7 @@ private static unsafe int CreateArrayGCDesc(LowLevelList<bool> bitfield, int ran
{
if (numSeries > 0)
{
*ptr-- = (short)((bitfield.Count - last + baseOffset - 2) * IntPtr.Size);
*ptr-- = (short)((i - last) * IntPtr.Size);
Copy link
Member Author

@VSadov VSadov May 29, 2023

Choose a reason for hiding this comment

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

baseOffset is not a factor in computing the last "skip" in a GC series element. It should be just
the end of the element - offset of the last GC pointer.

For SZ arrays the baseOffset is 2, so adding baseOffset - 2 was harmless.
In MD array it results in incorrect "skip".

Copy link
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.

Thank you!

…untime/TypeLoader/EETypeCreator.cs

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
@jkotas jkotas merged commit 0a3fb4c into dotnet:main May 30, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Jun 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants