Skip to content

[🍒 swift/release/6.2] [lldb] Fix lock inversion between statusline mutex and output mutex (#135956) #10523

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

JDevlieghere
Copy link

No description provided.

…#134203)

When you run lldb without colors (`-X`), the status line looks weird
because it doesn't have a background. You end up with what appears to be
floating text at the bottom of your terminal.

This patch changes the statusline to use the reverse video effect, even
when colors are off. The effect doesn't introduce any new colors and
just inverts the foreground and background color.

I considered an alternative approach which changes the behavior of the
`-X` option, so that turning off colors doesn't prevent emitting
non-color related control characters such as bold, underline, and
reverse video. I decided to go with this more targeted fix as (1) nobody
is asking for this more general change and (2) it introduces significant
complexity to plumb this through using a setting and driver flag so that
it can be disabled when running the tests.

Fixes llvm#134112.

(cherry picked from commit 5f99e0d)
…lvm#135956)

Fix a deadlock between the statusline mutex (in Debugger) and the output
file mutex (in LockedStreamFile). The deadlock occurs when the main
thread is calling the statusline callback while holding the output mutex
in Editline, while the default event thread is trying to update the
statusline.

Extend the uncritical section so we can redraw the statusline there.
The loop in Editline::GetCharacter should be unnecessary. It would only
loop if we had a successful read with length zero, which shouldn't be
possible or when we can't convert a partial UTF-8 character, in which
case we bail out.

rdar://149251156
(cherry picked from commit 8311620)
@JDevlieghere JDevlieghere requested a review from a team as a code owner April 22, 2025 15:08
@JDevlieghere
Copy link
Author

@swift-ci test

@JDevlieghere
Copy link
Author

The macOS build seems stuck at:

[5482/5484][ 99%][655.464s] Completed 'compiler-rt'

@JDevlieghere
Copy link
Author

@swift-ci test macOS

1 similar comment
@JDevlieghere
Copy link
Author

@swift-ci test macOS

@JDevlieghere JDevlieghere merged commit 8ec8cfb into swift/release/6.2 Apr 23, 2025
3 checks passed
@JDevlieghere JDevlieghere deleted the cherrypick-swift/release/6.2-5f99e0d4b9ea-83116209331a branch April 23, 2025 18:29
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