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.
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 ofrelocate_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.