microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
95.27k stars 8.27k forks source link

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

Closed ShenHongFei closed 8 months ago

ShenHongFei commented 10 months ago

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.

github-actions[bot] commented 10 months ago

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.

zadjii-msft commented 10 months ago

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.

DHowett commented 10 months ago

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 10 months ago

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