This repository was archived by the owner on Nov 1, 2020. It is now read-only.
Wasm: clear shadow stack slots in case of call to RhCollect #8195
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.
As part of fixing #8171, its apparent that there is a bug in the call to
GC.Collectwhich prevents some objects from being collected. This PR fixes this.What happens is that in
RhCollectandSystem_Runtime_InternalCalls__RhpCollect3 slots are allocated on the shadow stack but are not all set before the call toRhpCollect. If these slots have object references in them, from previous calls which used more of the shadow stack, then these references will still be there, and if they are the only references left to live objects, will prevent those objects from being collected.Not a huge deal in the long term as at some point they would probably have gotten overwritten or collected, but a definitely a problem when testing.