Skip to content

[Distributed] Fix handling indirect @in convention params in distributed funcs #67240

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 Jul 12, 2023

Description: This resolves a crash in some projects where the parameter to a distributed func is passed indirect @in on Linux.

Specifically, the following assertion would trigger due to the argument count mismatch: ssert(NextValue + n <= Values.size()); // 3 + 1 <= 3 -> boom (Values expected to be 4 in this particular case)

Seems we never triggered this codepath before, even though many distributed functions with all kinds of parameters were written, they all ended up @in_guaranteed not triggering the bad codepath. It is tricky to force this behavior in a test so we're continuing to look into this with @xedin right now. Added test reproducing the issue and showcasing that it is fixed now.

Risk: Low, limited to @in passed parameters to distributed funcs which previously would crash
Review by: @xedin @jckarter
Testing: Added CI exercising this code-path, verified in real project with fixed compiler
Radar: rdar://111887706

@ktoso
Copy link
Contributor Author

ktoso commented Jul 12, 2023

@swift-ci please test

@ktoso
Copy link
Contributor Author

ktoso commented Jul 12, 2023

@swift-ci please test

@ktoso ktoso added the distributed Feature → concurrency: distributed actor label Jul 12, 2023
@xedin xedin changed the title [Distributed] Fix handling indirect @in convention params in distributed funds [Distributed] Fix handling indirect @in convention params in distributed funcs Jul 12, 2023
DougGregor added a commit that referenced this pull request Jul 12, 2023
…-irgen-dist

🍒[5.9][Distributed] Fix handling indirect @in convention params in distributed funcs #67240
@xedin xedin merged commit 69cbb45 into swiftlang:main Jul 12, 2023
@ktoso ktoso deleted the wip-fix-indirect_in-handling-in-irgen-dist branch July 12, 2023 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
distributed Feature → concurrency: distributed actor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants