[PR #10357] [MERGED] Lock for writing in ControlCore::SetBackgroundOpacity #27997

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/10357
Author: @miniksa
Created: 6/7/2021
Status: ✅ Merged
Merged: 6/9/2021
Merged by: @undefined

Base: main ← Head: dev/miniksa/leonard_crash


📝 Commits (1)

  • 6cd7bde Changes to render engine must be done under lock to prevent changing in-use variables.

📊 Changes

1 file changed (+1 additions, -0 deletions)

View changed files

📝 src/cascadia/TerminalControl/ControlCore.cpp (+1 -0)

📄 Description

PR Checklist

  • Closes random crash that @lhecker sent me on Teams
  • I work here.

Detailed Description of the Pull Request / Additional comments

  • Any change to the renderer engine has to be done under lock. Leonard gave me a crash where the dirty rectangles changed out from under the renderer thread. By inspection, only one spot in ControlCore is modifying the engine outside of lock.... here. The dump is too far along to definitively prove the issue and it's sort of a race so its difficult to repro. But the theory is sound that all writes to the dirty regions must be done under lock. So here's a fix.

🔄 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/10357 **Author:** [@miniksa](https://github.com/miniksa) **Created:** 6/7/2021 **Status:** ✅ Merged **Merged:** 6/9/2021 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/miniksa/leonard_crash` --- ### 📝 Commits (1) - [`6cd7bde`](https://github.com/microsoft/terminal/commit/6cd7bde82a6be4dd58666c5db603c769caefeb64) Changes to render engine must be done under lock to prevent changing in-use variables. ### 📊 Changes **1 file changed** (+1 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalControl/ControlCore.cpp` (+1 -0) </details> ### 📄 Description ## PR Checklist * [x] Closes random crash that @lhecker sent me on Teams * [x] I work here. ## Detailed Description of the Pull Request / Additional comments - Any change to the renderer engine has to be done under lock. Leonard gave me a crash where the dirty rectangles changed out from under the renderer thread. By inspection, only one spot in `ControlCore` is modifying the engine outside of lock.... here. The dump is too far along to definitively prove the issue and it's sort of a race so its difficult to repro. But the theory is sound that all writes to the dirty regions must be done under lock. So here's a fix. --- <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:25:39 +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#27997