Bug Report: some processes still do not terminate after closing terminal #2214

Closed
opened 2026-01-30 22:49:45 +00:00 by claunia · 6 comments
Owner

Originally created by @andrewbaker-uk on GitHub (Jun 25, 2019).

Originally assigned to: @DHowett-MSFT on GitHub.

Environment

Windows build number: 10.0.18362.175
Windows Terminal version (if applicable): 0.2.1715.0

Any other software?

Steps to reproduce

Run ping across multiple powershell tabs and close terminal without stopping ping

Check taskmgr and ping.exe will still be running

Expected behavior

Ping.exe terminates when terminal session ends

Actual behavior

Terminal not killing processes executed after being closed

Originally created by @andrewbaker-uk on GitHub (Jun 25, 2019). Originally assigned to: @DHowett-MSFT on GitHub. <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: 10.0.18362.175 Windows Terminal version (if applicable): 0.2.1715.0 Any other software? ``` # Steps to reproduce Run ping <host> across multiple powershell tabs and close terminal without stopping ping Check taskmgr and ping.exe will still be running # Expected behavior Ping.exe terminates when terminal session ends # Actual behavior Terminal not killing processes executed after being closed
Author
Owner

@Shorotshishir commented on GitHub (Jun 25, 2019):

Could recreate it inside terminal and cmd does the same as PowerShell

  • both CMD and Powershell tab hangs up for quite a long time if trying to close the tab without manually terminating the process, sometimes crashes the terminal app.
  • If checked in Task Manager, we see the Ping and Powershell running, though the app has crashed.
@Shorotshishir commented on GitHub (Jun 25, 2019): Could recreate it inside terminal and cmd does the same as PowerShell - both CMD and Powershell tab hangs up for quite a long time if trying to close the tab without manually terminating the process, sometimes crashes the terminal app. - If checked in Task Manager, we see the Ping and Powershell running, though the app has crashed.
Author
Owner

@fredless commented on GitHub (Jun 26, 2019):

have observed cmd+ping still running as well, though I cannot replicate reliably nor do I recall an associated crash or slow close as @Shorotshishir mentioned.
image
image

..and a packet trace confirms that the process is still sending traffic as you might expect.

EDIT in case it's helpful: just noticed that terminating the subprocess (ping in this case) when in this condition seems to allow cmd.exe to wrap up as well

@fredless commented on GitHub (Jun 26, 2019): have observed cmd+ping still running as well, though I cannot replicate reliably nor do I recall an associated crash or slow close as @Shorotshishir mentioned. ![image](https://user-images.githubusercontent.com/16697069/60212937-4ae98b00-9817-11e9-8d97-d4ceb8e39f5a.png) ![image](https://user-images.githubusercontent.com/16697069/60213157-bb90a780-9817-11e9-9203-3709aa21a0b7.png) ..and a packet trace confirms that the process is still sending traffic as you might expect. EDIT in case it's helpful: just noticed that terminating the subprocess (ping in this case) when in this condition seems to allow cmd.exe to wrap up as well
Author
Owner

@DHowett-MSFT commented on GitHub (Jun 27, 2019):

So, this is weird. We stuff the shell and console host into a job object so they terminate when we do. That's a system feature that should almost certainly not fail.

@DHowett-MSFT commented on GitHub (Jun 27, 2019): So, this is weird. We stuff the shell and console host into a job object so they terminate when we do. That's a system feature that should almost certainly not fail.
Author
Owner

@ShadowJonathan commented on GitHub (Aug 13, 2019):

I also see this behaviour happen with WSL terminals, in ubuntu i can see multiple instances of init running after i closed their tabs, with their processes running in them.

(i discovered this because apt locked itself up while it waited for a nonexistent user confirmation while i got bounced trying to run an install from another tab, while the apt command already should've terminated a few hours ago when i closed that window)

@ShadowJonathan commented on GitHub (Aug 13, 2019): I also see this behaviour happen with WSL terminals, in ubuntu i can see multiple instances of `init` running after i closed their tabs, with their processes running in them. (i discovered this because `apt` locked itself up while it waited for a nonexistent user confirmation while i got bounced trying to run an install from another tab, while the apt command already should've terminated a few hours ago when i closed that window)
Author
Owner

@zadjii-msft commented on GitHub (Aug 26, 2019):

#2185 Is probably related

@zadjii-msft commented on GitHub (Aug 26, 2019): #2185 Is probably related
Author
Owner

@DHowett-MSFT commented on GitHub (Aug 26, 2019):

Let's use #2185 as the master issue for these.

@DHowett-MSFT commented on GitHub (Aug 26, 2019): Let's use #2185 as the master issue for these.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#2214