[PR #11386] [MERGED] [deadlock fix] Remove lock for SIUP::GetSelectionRange() #28538

Open
opened 2026-01-31 09:29:10 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/11386
Author: @carlos-zamora
Created: 9/30/2021
Status: ✅ Merged
Merged: 9/30/2021
Merged by: @undefined

Base: main ← Head: dev/cazamor/a11y/bugfix-selection-crashes


📝 Commits (1)

  • 36c6620 [deadlock fix] Remove lock for SIUP::GetSelectionRange()

📊 Changes

4 files changed (+18 additions, -6 deletions)

View changed files

📝 src/cascadia/TerminalCore/Terminal.cpp (+12 -0)
📝 src/cascadia/TerminalCore/Terminal.hpp (+3 -0)
📝 src/cascadia/TerminalCore/terminalrenderdata.cpp (+3 -0)
📝 src/types/TermControlUiaProvider.cpp (+0 -6)

📄 Description

Summary of the Pull Request

The deadlock was caused by ScreenInfoUiaProviderBase::GetSelection() calling TermControlUiaProvider::GetSelectionRange (both of which attempted to lock the console). This PR removes the lock and initialization check from TermControlUiaProvider. It is no longer necessary because the only one that calls it is SIUPB::GetSelection().

Additionally, this adds some code that was useful in debugging this race condition. That should help us figure out any locking issues that may come up in the future.

References

#11312
Closes #11385

Validation Steps Performed

✅ Repro steps don't cause hang


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/11386 **Author:** [@carlos-zamora](https://github.com/carlos-zamora) **Created:** 9/30/2021 **Status:** ✅ Merged **Merged:** 9/30/2021 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/cazamor/a11y/bugfix-selection-crashes` --- ### 📝 Commits (1) - [`36c6620`](https://github.com/microsoft/terminal/commit/36c66208d5fb264e15739fbcfe413335718caaf7) [deadlock fix] Remove lock for SIUP::GetSelectionRange() ### 📊 Changes **4 files changed** (+18 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalCore/Terminal.cpp` (+12 -0) 📝 `src/cascadia/TerminalCore/Terminal.hpp` (+3 -0) 📝 `src/cascadia/TerminalCore/terminalrenderdata.cpp` (+3 -0) 📝 `src/types/TermControlUiaProvider.cpp` (+0 -6) </details> ### 📄 Description ## Summary of the Pull Request The deadlock was caused by `ScreenInfoUiaProviderBase::GetSelection()` calling `TermControlUiaProvider::GetSelectionRange` (both of which attempted to lock the console). This PR removes the lock and initialization check from `TermControlUiaProvider`. It is no longer necessary because the only one that calls it is `SIUPB::GetSelection()`. Additionally, this adds some code that was useful in debugging this race condition. That should help us figure out any locking issues that may come up in the future. ## References #11312 Closes #11385 ## Validation Steps Performed ✅ Repro steps don't cause hang --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:29:10 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#28538