-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Concurrency] Fix task status and private storage sizes. #80447
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
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[].
@swift-ci please test |
This fix exposed an issue with task child iteration in ReflectionContext. Adding a fix for that here, plus a better test. |
@swift-ci please test |
And this needs a new entry in |
@swift-ci please test |
@swift-ci please test macos platform |
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.
@swift-ci please test |
static void | ||
indented_printf(unsigned indentLevel, const char *fmt, ...) { | ||
for (unsigned i = 0; i < indentLevel; i++) | ||
fputs(" ", stdout); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You forgot your flock.
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