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

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

Original Pull Request: https://github.com/microsoft/terminal/pull/11386

State: closed
Merged: Yes


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

**Original Pull Request:** https://github.com/microsoft/terminal/pull/11386 **State:** closed **Merged:** Yes --- ## 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
claunia added the pull-request label 2026-01-31 09:29:12 +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#28543