Skip to content

[Concurrency] TaskExecutors may be non-swift objects; dont swift_release them #75059

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 8, 2024

Since we introduced proper ownership of task executors, they are now released and retained. The problem appears with a dispatch_queue_t which conforms to TaskExecutor being passed to Task initializer and retains work okey because it is __owned. However, upon destroy we swift_released the executor reference, which is incorrect as we must be using object specific release methods -- in this case the safe way to support all kinds of objects is swift_unknownObjectRelease

resolves rdar://131151645

…ase them

Since we introduced proper ownership of task executors, they are now
released and retained. The problem appears with a dispatch_queue_t which
conforms to TaskExecutor being passed to Task initializer and retains
work okey because it is __owned. However, upon destroy we swift_released
the executor reference, which is incorrect as we must be using object
specific release methods -- in this case the safe way to support all
kinds of objects is `swift_unknownObjectRelease`

resolves rdar://131151645
@ktoso
Copy link
Contributor Author

ktoso commented Jul 8, 2024

I'll add a follow up test soon

@ktoso
Copy link
Contributor Author

ktoso commented Jul 8, 2024

@swift-ci please smoke test

@ktoso
Copy link
Contributor Author

ktoso commented Jul 9, 2024

@swift-ci please smoke test

@ktoso
Copy link
Contributor Author

ktoso commented Jul 9, 2024

Added a test to cover this situation where the object is not a swift reference counted type

@ktoso ktoso enabled auto-merge (squash) July 9, 2024 07:09
@ktoso ktoso added the concurrency Feature: umbrella label for concurrency language features label Jul 9, 2024
@ktoso ktoso merged commit a3e0b17 into swiftlang:main Jul 9, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
concurrency Feature: umbrella label for concurrency language features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant