Skip to content

Fix infinite recursion in TSF - #18248

Merged
Dustin L. Howett (DHowett) merged 3 commits into
mainfrom
dev/lhecker/tsf-recursion
Nov 26, 2024
Merged

Dustin L. Howett (DHowett) merged 3 commits into
mainfrom
dev/lhecker/tsf-recursion

Conversation

@lhecker

Copy link
Copy Markdown
Member

The current FindWindowOfActiveTSF implementation can
result in infinite recursion which we must guard again.
This change is not tested as I don't know how to trigger
the issue to begin with (a missing CoreInput thread).

@lhecker Leonard Hecker (lhecker) added Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. Priority-1 A description (P1) labels Nov 25, 2024
// This can then in infinite recursion because we're calling
// GetWnd() below, which may call GetHwnd(), which may call
// FindWindowOfActiveTSF(), and so on.
// By temporarily clearing the _provider we fix that flaw.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is the determination to bail out made based on _provider?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Throughout the file. All places that use _provider are already doing a null check.

@DHowett
Dustin L. Howett (DHowett) deleted the dev/lhecker/tsf-recursion branch November 26, 2024 18:39
Dustin L. Howett (DHowett) pushed a commit that referenced this pull request Nov 26, 2024
The current `FindWindowOfActiveTSF` implementation can
result in infinite recursion which we must guard again.
This change is not tested as I don't know how to trigger
the issue to begin with (a missing CoreInput thread).

(cherry picked from commit 9243104)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgVIDM8
Service-Version: 1.21
Dustin L. Howett (DHowett) pushed a commit that referenced this pull request Nov 26, 2024
The current `FindWindowOfActiveTSF` implementation can
result in infinite recursion which we must guard again.
This change is not tested as I don't know how to trigger
the issue to begin with (a missing CoreInput thread).

(cherry picked from commit 9243104)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgVIDNA
Service-Version: 1.22
@Smallthing

Smallthing commented Feb 6, 2025 •

Copy link
Copy Markdown

after upgrade to the last 1.21 and 1.22.the hang problem return.
system version : 24H2 26100.3037
the hang problem gone with 2025.1 windows update and back in these WT verison

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-1 A description (P1) Product-Terminal The new Windows Terminal.

Projects

Status: Cherry Picked
Status: Cherry Picked

Development

Successfully merging this pull request may close these issues.

4 participants