Skip to content

Conversation

@PeterSolMS
Copy link
Contributor

The problem here is that during GCScan::GcWeakPtrScan, we call GCHeap::IsPromoted so we can zero out object pointers to objects that weren't marked. At the same time, one thread may do the same for the sync block table. When the first kind of threads validate the object, they also validate the sync block entry that may have already been zeroed - this causes an assert failure. I don't think there is any bad effect apart from the assert failure though, i.e. retail builds should work fine.

The fix is to simply call Object::Validate with a bVerifySyncBlock of FALSE if the object hasn't been marked.

…::IsPromoted so we can zero out object pointers to objects that weren't marked. At the same time, one thread may do the same for the sync block table. When the first kind of threads validate the object, they also validate the sync block entry that may have already been zeroed - this causes an assert failure. I don't think there is any bad effect apart from the assert failure though.

The fix is to simply call Object::Validate with a bVerifySyncBlock of FALSE if the object hasn't been marked.
@ghost
Copy link

ghost commented Aug 30, 2022

Tagging subscribers to this area: @dotnet/gc
See info in area-owners.md if you want to be subscribed.

Issue Details

The problem here is that during GCScan::GcWeakPtrScan, we call GCHeap::IsPromoted so we can zero out object pointers to objects that weren't marked. At the same time, one thread may do the same for the sync block table. When the first kind of threads validate the object, they also validate the sync block entry that may have already been zeroed - this causes an assert failure. I don't think there is any bad effect apart from the assert failure though, i.e. retail builds should work fine.

The fix is to simply call Object::Validate with a bVerifySyncBlock of FALSE if the object hasn't been marked.

Author: PeterSolMS
Assignees: -
Labels:

area-GC-coreclr

Milestone: -

Copy link
Member

@AntonLapounov AntonLapounov left a comment

Choose a reason for hiding this comment

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

Thanks!

…eader::Validate with just one parameter that is used in Native AOT and the standalone GC.

Fix is simply to declare, but ignore the extra parameters.
@AntonLapounov
Copy link
Member

/backport to release/7.0

@github-actions
Copy link
Contributor

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

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

3 participants