Skip to content

Fix actor/job/task leaks in the back deployment runtime. #59288

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

DougGregor
Copy link
Member

When initializing an actor, job, or task, use _swift_instantiateInertHeapObject to have the OS's libswiftCore set up the object's refcounts field, to ensure we get a valid initial state.

There is no equivalent for immortal objects, but by a stroke of luck the new representation for immortal refcounts happens to set the immortal bit in the old representation.

rdar://93087343

DougGregor and others added 5 commits June 6, 2022 14:37
… library.

Change the order of paths provided for `DYLD_LIBRARY_PATH` when running
tests for the back-deployed concurrency library, so they supersede the
ones in `/usr/lib/swift`. This way, we can test the back-deployed
concurrency library even on OS's that have the concurrency library in
them. It's not a complete test, because the standard library and
runtime will still vary, but can reproduce many failures more easily.

When using the back-deployed concurrency library, set the lit feature
`back_deploy_concurrency`. Update some tests that are unsupported with
back-deployment to check this.

Finally, add some logging when the concurrency runtime cannot be
tested at all, to help with debugging CI in the future.
When initializing an actor, job, or task, use _swift_instantiateInertHeapObject to have the OS's libswiftCore set up the object's refcounts field, to ensure we get a valid initial state.

There is no equivalent for immortal objects, but by a stroke of luck the new representation for immortal refcounts happens to set the immortal bit in the old representation.

rdar://93087343
This detects a bug unique to the oldest back-deployment targets
for Swift concurrency, where Tasks were getting created with an
incorrect bit pattern that made them immortal.

Verifies that rdar://93087343 has been fixed.
@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor DougGregor merged commit 1e8f306 into swiftlang:main Jun 7, 2022
@DougGregor DougGregor deleted the back-deploy-concurrency-task-leak branch June 7, 2022 07:44
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