Skip to content

[6.2][Distributed] thread-safety also for parameter type metadata #81124

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

Conversation

ktoso
Copy link
Contributor

@ktoso ktoso commented Apr 26, 2025

Description: This is a bug where concurrent access to type metadata can end up returning in-complete metadata and therefore cause a crash at runtime trying to use that type. This happened during type metadata lookups from the distributed runtime. We had the same bug for return types (#79381), but this is for parameter types.

Scope/Impact: Only distributed function invocations are affected. No other piece of the runtime uses these methods.

Risk: Very low, we have fixed the same bug in a different place in the past and are very confident in the fix.
Testing: Added reproduction test and confirmed fix solves it.
Reviewed by: @mikeash

Original PR: #81123
Radar: rdar://146679254

We had fixed this bug in swiftlang#79381
but missed to realize the same problem existed for parameters as well.

This corrects the swift_func_getParameterTypeInfo impl, and also removes
the entire "unsafe" method, we no longer use it anywhere.

Resolves rdar://146679254
@ktoso ktoso requested review from mikeash and hborla April 26, 2025 12:43
@ktoso ktoso requested a review from a team as a code owner April 26, 2025 12:43
@ktoso
Copy link
Contributor Author

ktoso commented Apr 26, 2025

@swift-ci please test

@ktoso ktoso merged commit 676457a into swiftlang:release/6.2 Apr 28, 2025
5 checks passed
@ktoso ktoso deleted the pick-wip-correct-metadata-handling-distributed branch April 28, 2025 02:07
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.

2 participants