Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix race condition in AllocateManagedClassObject #81947

Merged
merged 1 commit into from
Feb 10, 2023

Conversation

EgorBo
Copy link
Member

@EgorBo EgorBo commented Feb 10, 2023

This PR applies @jkotas's patch #81884 (comment)

I've verified the other places where FOH->TryAllocate is used:

  1. AllocateStaticBox - should be fine as its return value is saved via write barrier + additional volatile operations here
  2. AllocateString - should be fine, pIsFrozen is a stack local. The result of AllocateString is saved here and the AddStringLiteral itself is invoked under string-literal-lock

Hopefully, closes #81884

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.

Thanks

@jkotas jkotas merged commit e994b20 into dotnet:main Feb 10, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Mar 12, 2023
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Race in RuntimeTypeCache / metadata reading
2 participants