GenerateConsoleCtrlEvent creates "zombie" process handle in conhost.exe #346
Labels
Area-Server
Down in the muck of API call servicing, interprocess communication, eventing, etc.
Issue-Bug
It either shouldn't be doing this or needs an investigation.
Product-Conhost
For issues in the Console codebase
Windows build number: 10.0.17763.195
What you're doing and what's happening: I have an application that starts and stops many sub processes. We use 'GenerateConsoleCtrlEvent' to stop sub processes. Every time we use this function, the conhost.exe process associated with our main / parent process acquires a "zombie" process handle to the stopped sub process.
Here is sample code illustrating the issue which opens notepad, sends a Ctrl-C signal, and then terminates it:
If we open Process Explorer and view the handles owned by the conhost.exe process associated with the sample program ("Sandbox.exe" in my case):
We see that there is a "zombie" process handle to the terminated notepad process:
If you step through the sample code, you can see that the process handle is opened on the call to 'GenerateConsoleCtrlEvent'.
The text was updated successfully, but these errors were encountered: