WindowsTerminal.exe leak (never exit) after the wtd.exe new-tab ... command line process exits. #20982

Closed
opened 2026-01-31 07:29:40 +00:00 by claunia · 4 comments
Owner

Originally created by @ShenHongFei on GitHub (Dec 12, 2023).

Windows Terminal version

latest commit of main branch

Windows build number

10.0.22631.0

Other Software

No response

Steps to reproduce

Execute the following command on the command line:

wtd.exe new-tab ping.exe localhost

Expected Behavior

There is only one WindowsTerminal.exe process after the ping command ends

Actual Behavior

Each time the above command is executed, there will be one more WindowsTerminal.exe process.

I debugged the redundant WindowsTerminal.exe process and found that it was stuck on the line highlighted in the picture below.
D:\1\winterm\packages\Microsoft.Windows.ImplementationLibrary.1.0.230824.2\include\wil\filesystem.h

image

I guessed it might be related to Microsoft.Windows.ImplementationLibrary, and then revert this PR https://github.com/microsoft/terminal/pull/16120
After recompiling and building, the problem disappeared and there were no redundant leaking processes.

Originally created by @ShenHongFei on GitHub (Dec 12, 2023). ### Windows Terminal version latest commit of main branch ### Windows build number 10.0.22631.0 ### Other Software _No response_ ### Steps to reproduce Execute the following command on the command line: ``` wtd.exe new-tab ping.exe localhost ``` ### Expected Behavior There is only one WindowsTerminal.exe process after the ping command ends ### Actual Behavior Each time the above command is executed, there will be one more WindowsTerminal.exe process. I debugged the redundant WindowsTerminal.exe process and found that it was stuck on the line highlighted in the picture below. `D:\1\winterm\packages\Microsoft.Windows.ImplementationLibrary.1.0.230824.2\include\wil\filesystem.h` ![image](https://github.com/microsoft/terminal/assets/15074472/ffed717b-3d10-466c-83cd-ede1950cbdfd) I guessed it might be related to `Microsoft.Windows.ImplementationLibrary`, and then revert this PR https://github.com/microsoft/terminal/pull/16120 After recompiling and building, the problem disappeared and there were no redundant leaking processes.
Author
Owner

@github-actions[bot] commented on GitHub (Dec 12, 2023):

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@github-actions[bot] commented on GitHub (Dec 12, 2023): Hi I'm an AI powered bot that finds similar issues based off the issue title. Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you! ### Closed similar issues: - [Closing last tab crashes WindowsTerminal.exe (#1552)](https://github.com/microsoft/terminal/issues/1552), similarity score: 0.81 > Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Author
Owner

@zadjii-msft commented on GitHub (Dec 12, 2023):

Thanks for filing this!

I noticed this a few weeks back and totally forgot to file or investigate it. I'm guessing we're starting up the settings file watcher as we do the handoff to the monarch, but then never closing.

@zadjii-msft commented on GitHub (Dec 12, 2023): Thanks for filing this! I noticed this a few weeks back and totally forgot to file or investigate it. I'm guessing we're starting up the settings file watcher as we do the handoff to the monarch, but then never closing.
Author
Owner

@DHowett commented on GitHub (Dec 12, 2023):

Oh, @zadjii-msft, this is the one that was caused by https://github.com/microsoft/wil/pull/326.

It may have been fixed in https://github.com/microsoft/wil/pull/386

Which we should ingest!

@DHowett commented on GitHub (Dec 12, 2023): Oh, @zadjii-msft, this is the one that was caused by https://github.com/microsoft/wil/pull/326. It may have been fixed in https://github.com/microsoft/wil/pull/386 Which we should ingest!
Author
Owner

@DHowett commented on GitHub (Dec 12, 2023):

(it hasn't been shipped to the nuget feed yet)

@DHowett commented on GitHub (Dec 12, 2023): (it hasn't been shipped to the nuget feed yet)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#20982