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.
Together with #87533, this PR fixed #76929.
Causes
The root cause of the bug is that because we are allocating small POH objects, they may share the same mark word. Before these changes, the mark word could be concurrently accessed by the background mark phase as well as the various allocating threads.
Fixes
@Maoni0's fix avoided the marking of the object while background mark phase is in progress, and therefore we are left with the concurrent marking among allocating threads.
This fix move the marking of the objects inside of
more_space_lock, this will guarantee no two allocating threads will mark the same word at the same time, and therefore eliminated all concurrent accesses.Testing
The customer repro were run under workstation mode for 8,000 iterations and it doesn't crash.
ReliabilityFramework is ran for 13 hours for both (workstation/server), (Debug/Release). The release server version crashed with OutOfMemory. The OOM is unrelated to the fix, I just don't have enough memory.