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

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

mikeash
mikeash1 year ago

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

mikeash [6.0][Concurrency] Refine getResumeFunctionForLogging to avoid readin…
e9313c96
mikeash mikeash requested a review 1 year ago
mikeash
mikeash1 year ago

@swift-ci please test

mikeash
mikeash1 year ago

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 1 year ago
DougGregor
DougGregor approved these changes on 2024-05-22
ktoso
ktoso approved these changes on 2024-05-23
ktoso
ktoso approved these changes on 2024-05-23
mikeash mikeash merged cb2051bd into release/6.0 1 year ago

Login to write a write a comment.

Login via GitHub

Reviewers
Assignees
No one assigned
Labels
Milestone