Skip to content

[lldb] Prevent Task formatter from showing bogus children #10495

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

kastiglione
Copy link

@kastiglione kastiglione commented Apr 15, 2025

Very rarely, we've seen a task include a bogus child task. When this has occurred, the task id has been zero, which is invalid. This change filters out a Task's children if they have a task id of 0.

@kastiglione kastiglione requested a review from a team as a code owner April 15, 2025 17:19
@kastiglione
Copy link
Author

@swift-ci test

// Very rarely, the child tasks include a bogus task which has an
// invalid task id of 0.
llvm::remove_if(tasks, [&](auto task_ptr) {
auto task_info = m_reflection_ctx->asyncTaskInfo(task_ptr);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just FYI, another pattern to drop an error is llvm::expectedToOptional()

Copy link

@felipepiovezan felipepiovezan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is a bug with this patch, left some suggestions.

We should try to assert in some of the tests that we no longer print tasks with ID's 0, even if this error is rare

@kastiglione
Copy link
Author

@swift-ci test

Copy link

@felipepiovezan felipepiovezan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@kastiglione kastiglione merged commit 529abca into stable/20240723 Apr 15, 2025
2 of 3 checks passed
@kastiglione kastiglione deleted the dl/lldb-Prevent-Task-formatter-from-showing-bogus-children branch April 15, 2025 21:38
kastiglione added a commit that referenced this pull request Apr 15, 2025
Very rarely, we've seen a task include a bogus child task. When this has occurred, the task id has been zero, which is invalid. This change filters out a Task's children if they have a task id of 0.

(cherry picked from commit 529abca)
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.

3 participants