Skip to content

[6.1][Distributed] Improve getting return type metadata for distributed invocations #79386

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

ktoso
Copy link
Contributor

@ktoso ktoso commented Feb 14, 2025

Description: The way type metadata is obtained in swift_func_getReturnTypeInfo may result in partial metadata be returned, which can result in a zero size buffer allocation, which then is going to be too small to fit a write of the result data, leading to a crash if this partial metadata was returned. This patch corrects how we obtain the metadata so we always get complete information.
Scope/Impact: Very rarely an incomplete metadata may have been obtained from swift_func_getReturnTypeInfo causing a crash as the result would then not fit the allocated result buffer.
Risk: Low, the fix is local to distributed returns and definitely correct (same as some other method nearby)
Testing: Reproduced exact issue in new test, tracked down root cause with logging in applications
Reviewed by: @mikeash

Original PR: #79381
Radar: rdar://141313340

@ktoso ktoso requested a review from a team as a code owner February 14, 2025 06:14
@ktoso
Copy link
Contributor Author

ktoso commented Feb 14, 2025

@swift-ci please test

@ktoso
Copy link
Contributor Author

ktoso commented Feb 17, 2025

@swift-ci please test

@ktoso ktoso requested a review from hborla February 17, 2025 03:01
@ktoso ktoso merged commit 97d775b into swiftlang:release/6.1 Feb 17, 2025
5 checks passed
@ktoso ktoso deleted the pick-wip-correct-metadata-lookup-result-type branch February 17, 2025 23:35
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