Skip to content

[6.2][Concurrency] Correct memory effect attributes of task_create #82180

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 Jun 11, 2025

Description: Without this, llvm would sometimes wrongly assume there's no indirect
accesses and the optimizations can lead to a runtime crash, by optimizing away initializing options properly.

Scope/Impact: Users of some apis which have multiple task options can experience crashes; This only manifested on some startSynchronously legacy API users so far but this is purely accidental -- it seems other APIs were just "lucky" (for years), since the functions were AEIC.
Risk: Low, corrects memory semantics annotation to prevent too aggressive optimizations.
Testing: Added test which triggered the miscompile.
Reviewed by: @mikeash @fhahn @rjmccall

Original PR: #82179
Radar: rdar://152548190

Without this, llvm would sometimes wrongly assume there's no indirect
accesses and the optimizations can lead to a runtime crash, by
optimizing away initializing options properly.

Resolves rdar://152548190
@ktoso ktoso requested a review from a team as a code owner June 11, 2025 13:07
@ktoso
Copy link
Contributor Author

ktoso commented Jun 11, 2025

@swift-ci please test

@ktoso ktoso merged commit 85347b2 into swiftlang:release/6.2 Jun 12, 2025
5 checks passed
@ktoso ktoso deleted the pick-3aa28b4de9e4074e813cd3932f2aa52a6af415be branch June 12, 2025 04:49
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