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

Skip finalizer test if precise GC is not supported #56364

Merged
merged 1 commit into from
Jul 27, 2021
Merged

Skip finalizer test if precise GC is not supported #56364

merged 1 commit into from
Jul 27, 2021

Conversation

uweigand
Copy link
Contributor

  • Finalizer_OperationNotCompleted_CompletesOperation assumes precise GC

This test assumes the AsyncOperation object created in NotCompleted is collected by the GC.Collect() call. That is not guaranteed with the current Mono GC, which conservatively scans the whole stack. If a pointer to that object is still visible anywhere on that stack (or in any register, as the stack also contains register context save areas at the time GC.Collect() executes), the object may erroneously still be considered live.

Whether or not the test actually fails depends on accidental details of the generated code; the test used to pass on s390x but after some unrelated codegen changes (enabling the linears optimization in Mono), it now fails.

Simply make the test depend on IsPreciseGcSupported, like many similar tests already are.

* Finalizer_OperationNotCompleted_CompletesOperation assumes precise GC
@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Jul 27, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added area-System.ComponentModel and removed community-contribution Indicates that the PR has been added by a community member labels Jul 27, 2021
@ghost
Copy link

ghost commented Jul 27, 2021

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

Issue Details
  • Finalizer_OperationNotCompleted_CompletesOperation assumes precise GC

This test assumes the AsyncOperation object created in NotCompleted is collected by the GC.Collect() call. That is not guaranteed with the current Mono GC, which conservatively scans the whole stack. If a pointer to that object is still visible anywhere on that stack (or in any register, as the stack also contains register context save areas at the time GC.Collect() executes), the object may erroneously still be considered live.

Whether or not the test actually fails depends on accidental details of the generated code; the test used to pass on s390x but after some unrelated codegen changes (enabling the linears optimization in Mono), it now fails.

Simply make the test depend on IsPreciseGcSupported, like many similar tests already are.

Author: uweigand
Assignees: -
Labels:

area-System.ComponentModel

Milestone: -

@stephentoub stephentoub merged commit 6a5eaed into dotnet:main Jul 27, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Aug 26, 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.

2 participants