Skip to content

[6.0][Concurrency] Refine getResumeFunctionForLogging to avoid reading invalid future contexts. #73827

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

Merged

Conversation

mikeash
Copy link
Contributor

@mikeash mikeash commented May 22, 2024

When using a future adapter, the resume context may not be valid after the task starts running. Only peer through the adapter when we're starting to run.

rdar://126298035

…g invalid future contexts.

When using a future adapter, the resume context may not be valid after the task starts running. Only peer through the adapter when we're starting to run.

rdar://126298035
(cherry picked from commit 0f226b6)
@mikeash mikeash requested a review from a team as a code owner May 22, 2024 21:06
@mikeash
Copy link
Contributor Author

mikeash commented May 22, 2024

@swift-ci please test

@mikeash
Copy link
Contributor Author

mikeash commented May 22, 2024

Explanation: Our os_signpost code tries to peer through some wrapper functions when posting the address of the resume function. This change avoids doing this in cases where the context data may no longer be valid.
Original PR: #73796
Reviewed by: @ktoso
Risk: Low. We now signpost the wrapper functions themselves instead of trying to dig into the context, which is strictly safer. This changes the info we provide to Instruments, but code inspection and testing indicate that it tolerates the change.
Resolves: rdar://126298035
Tests: Manually tested with a reproducer.

@mikeash mikeash enabled auto-merge May 22, 2024 21:18
@mikeash mikeash merged commit cb2051b into swiftlang:release/6.0 May 23, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants