Skip to content

Conversation

@jakobbotsch
Copy link
Member

@jakobbotsch jakobbotsch commented Jun 27, 2025

  • Handle extra arg for async functions
  • On x86 move the async continuation to be before the generic context arg (so that the generic context arg stays last, like ArgIterator expects)

Fix #116322

@dotnet-policy-service
Copy link
Contributor

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

@VSadov
Copy link
Member

VSadov commented Jul 3, 2025

The reason for the GC stress failures on x86 is that GC stress does not protect continuation returns.

Non-x86 platforms get that for free from the call site GC info, but for x86 GC stress needs to do an extra step, just like for protecting the ordinary returns.
I will push a fix into this PR.

@jakobbotsch
Copy link
Member Author

jakobbotsch commented Jul 3, 2025

x86 still not happy, needs more investigation/testing.

Some notes on this:

  1. I see a quite consistent crash when running async.dll DisplayName~objects-captured with GCStress=0xC under x86 with TieredCompilation=0. I have not been able to repro with TTD enabled. I have not been able to repro when running objects-captured as a standalone test.
  2. The crash most often occurs while trying to resume a continuation and the Resume function pointer points to an invalid location. It appears that the Resume field contains the unrelocated value of the Next field instead (maybe of a different continuation).
  3. Sometimes I see more generic GC stress like crashes.
  4. I don't see other corruption in the fields, i.e. method table of the continuation looks ok. The Data and GCData arrays both have the right method tables.

2 above made me suspect a bad codegen issue somewhere (storing Next in the wrong place), but I have not been able to track it down and the issue is intermittent, which makes it seem like this might be a more subtle issue.

@jakobbotsch
Copy link
Member Author

The reason for the GC stress failures on x86 is that GC stress does not protect continuation returns.

Ah... I fixed this in the prototype. I guess the fix disappeared at some point. Thanks for looking.

Copy link
Member

@VSadov VSadov left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@jakobbotsch jakobbotsch closed this Jul 8, 2025
@jakobbotsch jakobbotsch reopened this Jul 8, 2025
@jakobbotsch
Copy link
Member Author

/ba-g Infra issues

@jakobbotsch jakobbotsch merged commit 445eae4 into dotnet:main Jul 8, 2025
118 of 123 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Aug 8, 2025
@jakobbotsch jakobbotsch deleted the fix-116322-actual branch September 29, 2025 14:54
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.

[RuntimeAsync] Possible GC hole

4 participants