Skip to content

[6.2][Concurrency] Fix task status and private storage sizes. #80644

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 2 commits into from
Apr 9, 2025

Conversation

mikeash
Copy link
Contributor

@mikeash mikeash commented Apr 8, 2025

ActiveTaskStatusSize is 2 words, not 4, on most targets.

PrivateStorageSize is measured in bytes, not words, so the Storage field needs to be a char[].

rdar://148836760

@mikeash mikeash requested a review from a team as a code owner April 8, 2025 17:18
@mikeash
Copy link
Contributor Author

mikeash commented Apr 8, 2025

@swift-ci please test

mikeash added 2 commits April 8, 2025 15:23
ActiveTaskStatusSize is 2 words, not 4, on most targets.

PrivateStorageSize is measured in bytes, not words, so the Storage field needs to be a char[].

(cherry picked from commit d1cb5d9)
Iterating child tasks depends on knowing the size of AsyncTask, and changing the size of the task broke it. Instead of relying on mirroring the full structure in our out-of-process definitions, add a debug variable to libswift_Concurrency that contains the size of AsyncTask.

While we're there, add some more validation to child task enumeration. Check each child task's metadata pointer to make sure that it actually points to the AsyncTask metadata, and have the inner loop also increment and check ChildTaskLoopCount to stop runaway iteration in that loop.

rdar://148836760

(cherry picked from commit e305703)
@mikeash mikeash force-pushed the fix-task-sizes-6.2 branch from 3561df8 to 7edc799 Compare April 8, 2025 19:23
@mikeash mikeash changed the title [6.2][RemoteMirror] Fix AsyncTask child iteration. [6.2][Concurrency] Fix task status and private storage sizes. Apr 8, 2025
@mikeash
Copy link
Contributor Author

mikeash commented Apr 8, 2025

@swift-ci please test

@mikeash mikeash merged commit 29db1ec into swiftlang:release/6.2 Apr 9, 2025
5 checks passed
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