Skip to content

Fix race condition in DacEnumerableHashTable::BaseFindNextEntryByHash #75099

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

Merged

Conversation

AntonLapounov
Copy link
Member

See #75041 (comment) for details. Fixes #75041.

@ghost ghost added the area-VM-coreclr label Sep 6, 2022
@ghost ghost assigned AntonLapounov Sep 6, 2022
@jkotas jkotas requested a review from VSadov September 6, 2022 03:07
@VSadov
Copy link
Member

VSadov commented Sep 6, 2022

I think VolatileEntry needs to be renamed just an Entry. The name seems deceiving.

@VSadov
Copy link
Member

VSadov commented Sep 6, 2022

Or perhaps m_pNextEntry should be declared as volatile - in "ISO volatile" sense. I generally prefer explicit VolatileLoadWithoutBarrier as more obvious at the point of reading, but if all the places where we read m_pNextEntry need to be changed and there are lots of them, maybe volatile would work better.
Perhaps that is what was meant when the type got "Volatile" in its name and we lost it somehow.

@AntonLapounov
Copy link
Member Author

The failure in the 'Build OSX x64 release NativeAOT' job is #75005.

@AntonLapounov
Copy link
Member Author

but if all the places where we read m_pNextEntry need to be changed and there are lots of them, maybe volatile would work better.

Volatile loads are not necessary on the writer code path. I tried to make a safest/easiest fix for porting to 7.0. Do the changes look reasonable?

@AntonLapounov AntonLapounov merged commit a7eda3e into dotnet:main Sep 7, 2022
@AntonLapounov AntonLapounov deleted the FixRaceInBaseFindNextEntryByHash branch September 7, 2022 03:19
@AntonLapounov
Copy link
Member Author

/backport to release/7.0

@github-actions
Copy link
Contributor

github-actions bot commented Sep 7, 2022

Started backporting to release/7.0: https://github.com/dotnet/runtime/actions/runs/3004820401

@ghost ghost locked as resolved and limited conversation to collaborators Oct 7, 2022
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.

Race condition in DacEnumerableHashTable::BaseFindNextEntryByHash
3 participants