[PR #1015] [MERGED] Fix #936: misuse of uninitialized objects causes AppVerifier breaks on Windows Terminal startup #24440

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/1015
Author: @metathinker
Created: 5/25/2019
Status: Merged
Merged: 5/28/2019
Merged by: @undefined

Base: masterHead: appverifier-break-on-startup


📝 Commits (2)

  • 9992706 move the render thread init up; gets rid of verifier stops
  • aa0679f s/INVALID_HANDLE_VALUE/NULL/g since CreateEvent() and CreateThread() return a NULL HANDLE on failure; resolves another cause of AppVerifier breaks

📊 Changes

2 files changed (+20 additions, -16 deletions)

View changed files

📝 src/cascadia/TerminalControl/TermControl.cpp (+8 -4)
📝 src/renderer/base/thread.cpp (+12 -12)

📄 Description

This PR makes a couple of small changes:

  • In src\cascadia\TerminalControl\TermControl.cpp, the TermControl::_InitializeTerminal() method now initializes the RenderThread it creates before making any calls into the Renderer it also creates, as the Renderer has been given the RenderThread and expects it to be fully initialized.
  • In src\renderer\base\thread.cpp, the RenderThread's members of type HANDLE are now initialized to NULL instead of INVALID_HANDLE_VALUE. The latter is not appropriate for these HANDLEs because they are returned from CreateThread() or CreateEvent(), which both return NULL on failure.

Using manual testing, I verified that either of these changes alone will resolve one or both of the 2 AppVerifier stops cited in the bug report.

PR Checklist


🔄 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/1015 **Author:** [@metathinker](https://github.com/metathinker) **Created:** 5/25/2019 **Status:** ✅ Merged **Merged:** 5/28/2019 **Merged by:** [@undefined](undefined) **Base:** `master` ← **Head:** `appverifier-break-on-startup` --- ### 📝 Commits (2) - [`9992706`](https://github.com/microsoft/terminal/commit/99927062d7a5bc32aca7949073ce80c8ced160a8) move the render thread init up; gets rid of verifier stops - [`aa0679f`](https://github.com/microsoft/terminal/commit/aa0679f7c792aa28bf1795b835bce5bbd9a78d5c) s/INVALID_HANDLE_VALUE/NULL/g since CreateEvent() and CreateThread() return a NULL HANDLE on failure; resolves another cause of AppVerifier breaks ### 📊 Changes **2 files changed** (+20 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalControl/TermControl.cpp` (+8 -4) 📝 `src/renderer/base/thread.cpp` (+12 -12) </details> ### 📄 Description This PR makes a couple of small changes: - In src\cascadia\TerminalControl\TermControl.cpp, the `TermControl::_InitializeTerminal()` method now initializes the `RenderThread` it creates before making any calls into the `Renderer` it also creates, as the Renderer has been given the RenderThread and expects it to be fully initialized. - In src\renderer\base\thread.cpp, the RenderThread's members of type `HANDLE` are now initialized to NULL instead of INVALID_HANDLE_VALUE. The latter is not appropriate for these HANDLEs because they are returned from CreateThread() or CreateEvent(), which both return NULL on failure. Using manual testing, I verified that either of these changes alone will resolve one or both of the 2 AppVerifier stops cited in the bug report. <!-- Please review the items on the PR checklist before submitting--> ### PR Checklist * [x] Closes #936 TermControl._InitializeTerminal() gives Renderer an uninitialized RenderThread then calls into Renderer. Cleanup needed? * [x] I've discussed this with core contributors already -- See bug thread - mr * [ ] Tests added/passed -- not sure where to put new test code? - mr --- <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:03:20 +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#24440