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

Remove an erroneous check #53889

Merged
merged 1 commit into from
Jun 8, 2021
Merged

Remove an erroneous check #53889

merged 1 commit into from
Jun 8, 2021

Conversation

cshung
Copy link
Member

@cshung cshung commented Jun 8, 2021

Fixes #53401

I claim that the check I removed is erroneous. The check is performed during the relocate_advance_to_non_sip, which is part of relocate_phase.

In the earlier plan phase, if we discovered a non-pinned plug that is too close to the earlier pinned plug, we would like to be able to relocate this plug, but then we have no space to store the relocation data. In that case, we will temporarily overwrite the last plug's end to store the relocation data after backing it up. The backup will be restored later (either after compact or sweep)

Therefore, it is possible that a pointer in the swept in plan region points to a location where it was temporarily overwritten by the relocation data at that point in time. In that case, the pointer might not be pointing to a valid method table pointer, and that why the check fails.

This explains why the bug does not repro if we do not define STRESS_REGIONS, the chances for that to happen is significantly reduced without it.

I ran the test that repro it in a loop for an hour and nothing bad happened with it, I believe this fix is good to go.

@ghost
Copy link

ghost commented Jun 8, 2021

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

Issue Details

Fixes #53401

I claim that the check I removed is erroneous. The check is performed during the relocate_advance_to_non_sip, which is part of relocate_phase.

In the earlier plan phase, if we discovered a non-pinned plug that is too close to the earlier pinned plug, we would like to be able to relocate this plug, but then we have no space to store the relocation data. In that case, we will temporarily overwrite the last plug's end to store the relocation data after backing it up. The backup will be restored later (either after compact or sweep)

Therefore, it is possible that a pointer in the swept in plan region points to a location where it was temporarily overwritten by the relocation data at that point in time. In that case, the pointer might not be pointing to a valid method table pointer, and that why the check fails.

This explains why the bug does not repro if we do not define STRESS_REGIONS, the chances for that to happen is significantly reduced without it.

I ran the test that repro it in a loop for an hour and nothing bad happened with it, I believe this fix is good to go.

Author: cshung
Assignees: -
Labels:

area-GC-coreclr

Milestone: -

@cshung cshung merged commit d35882a into dotnet:main Jun 8, 2021
@cshung cshung deleted the public/remove-check branch June 8, 2021 21:32
@ghost ghost locked as resolved and limited conversation to collaborators Jul 8, 2021
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.

GC Regions: Crash in dlstack test
2 participants