Skip to content

🍒[5.10][Distributed] Destroy decoded parameters after executeDistributedTarget #70808

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
merged 1 commit into from
Jan 11, 2024

Conversation

ktoso
Copy link
Contributor

@ktoso ktoso commented Jan 10, 2024

Description: We recently fixed a similar issue where the objects created from decodeNextArgument in a distributed thunk were not properly destroyed. The fix was in #65952

In that fix, we missed handling of Indirect_In_Guaranteed which also need to be destroyed, this patch corrects that omission.

Risk: Low, impacts only distributed methods, and only struct arguments. The specific shape of fix was previously done already, but was missing for one of the cases of parameter ownership kind.
Impact: The problem manifests in deinitialization not running as expected for decoded arguments. The memory for those parameters freed but destroy logic is not run on those. This results in memory leak detection triggering for distributed methods. All distributed actor adopters are impacted.

Review by: @jckarter @xedin
Testing: CI testing, added test coverage for remaining cases; Confirmed two separate reproducers are fixed.
Original PR: #70806
Radar: rdar://119943672 rdar://119446012

Resolves #70004

@ktoso ktoso requested a review from a team as a code owner January 10, 2024 10:02
@ktoso
Copy link
Contributor Author

ktoso commented Jan 10, 2024

@swift-ci please test

@ktoso ktoso changed the title [Distributed] Destroy decoded parameters after executeDistributedTarget 🍒[5.10][Distributed] Destroy decoded parameters after executeDistributedTarget Jan 10, 2024
We recently fixed a similar issue where the objects created from
decodeNextArgument in a distributed thunk were not properly destroyed.
The fix was in swiftlang#65952

In that fix, we missed handling of Indirect_In_Guaranteed which also
need to be destroyed, this patch corrects that omission.

Resolves swiftlang#70004
Resolves rdar://119943672
Resolves rdar://119446012
@ktoso ktoso force-pushed the pick-fix-dist-param-leak branch from d9055bf to 899c89e Compare January 10, 2024 13:55
@ktoso
Copy link
Contributor Author

ktoso commented Jan 10, 2024

@swift-ci please test

@ktoso ktoso merged commit d5a07e9 into swiftlang:release/5.10 Jan 11, 2024
@ktoso ktoso deleted the pick-fix-dist-param-leak branch January 11, 2024 02:56
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