[PR #10937] [MERGED] Prevent deadlock in UIA Move API #28316

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/10937
Author: @carlos-zamora
Created: 8/12/2021
Status: ✅ Merged
Merged: 8/13/2021
Merged by: @undefined

Base: main ← Head: dev/cazamor/a11y/bugfix-prevent-deadlock


📝 Commits (2)

  • fe32c70 Prevent deadlock in UIA Move API
  • ed04a2e apply method try/catch to appease audit mode

📊 Changes

2 files changed (+75 additions, -63 deletions)

View changed files

📝 src/types/UiaTextRangeBase.cpp (+73 -63)
📝 src/types/UiaTextRangeBase.hpp (+2 -0)

📄 Description

Fixes a bug where interacting with Windows Terminal when using Narrator causes Windows Terminal to hang.

UiaTextRangeBase::Move() locks, but later calls UiaTextRangeBase::ExpandToEnclosingUnit() which attempts to lock again. The workaround for this is to introduce a _expandToEnclosingUnit() that does not lock the console. Then, Move() calls this new method, thus only allowing one lock to be established at a time.

This bug is observed to be in v1.11.2221.0 and not in v1.9.1942.0.


🔄 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/10937 **Author:** [@carlos-zamora](https://github.com/carlos-zamora) **Created:** 8/12/2021 **Status:** ✅ Merged **Merged:** 8/13/2021 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/cazamor/a11y/bugfix-prevent-deadlock` --- ### 📝 Commits (2) - [`fe32c70`](https://github.com/microsoft/terminal/commit/fe32c708b746e4c1ee1913f4d1a72bcff9ff23b7) Prevent deadlock in UIA Move API - [`ed04a2e`](https://github.com/microsoft/terminal/commit/ed04a2ef910e81fbc0d5fa4fd2ad36b78a943d96) apply method try/catch to appease audit mode ### 📊 Changes **2 files changed** (+75 additions, -63 deletions) <details> <summary>View changed files</summary> 📝 `src/types/UiaTextRangeBase.cpp` (+73 -63) 📝 `src/types/UiaTextRangeBase.hpp` (+2 -0) </details> ### 📄 Description Fixes a bug where interacting with Windows Terminal when using Narrator causes Windows Terminal to hang. `UiaTextRangeBase::Move()` locks, but later calls `UiaTextRangeBase::ExpandToEnclosingUnit()` which attempts to lock again. The workaround for this is to introduce a `_expandToEnclosingUnit()` that _does not_ lock the console. Then, `Move()` calls this new method, thus only allowing one lock to be established at a time. This bug is observed to be in v1.11.2221.0 and _not_ in v1.9.1942.0. --- <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:27:44 +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#28316