-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If a program is terminated by unhandled exception, its OS process remains #102568
Comments
I tried this on another Windows 11 machine and I got same result. I also tried this on Windows Server 2022, and this problem does not exist. Back in year 2022, when I was using .Net 6 with Windows 10, I never noticed this issue. So I guess this problem only happens on Windows 11. I will install a virtual machine and try this on older Windows 11 versions. I will report later. Another detail that I noticed: I saw two processes in Task Manager and one of them (with state 'Running') exited normally while another one (with state 'Suspend') remained in Task Manager. |
Can you try with .NET Framework as well? |
Hi @danmoseley , |
I tried Windows 11 21H2 ver 22000.675 with built-in .NET Framework 4.8.4161. |
Hi @wsy! The "suspended" process is likely an artifact of Windows Error Reporting (WER) collecting a dump of the process after the unhandled exception. In task manager, please determine if there is a |
Hi @tommcdon , |
FWIW, i've been running into this a lot. Processes left behind int eh suspended state, never fully closing down. Perhaps it's a werfault issue? They do some reporting, but then don't properly clean up once done? |
Hi, |
Hi @CyrusNajmabadi , int main()
{
int *p = 0;
int e = *p;
return 0;
} |
I'll be happy to report it to the WER team. Doing some quick research it seems that the suspended process might caused by leaving task manager open. @wsy would you mind trying to close task manager, then re-open it to see if the suspended/defunct process is still there? |
Hi, |
By the way, I have to say, the new taskmgr is really far away from the word 'stable'. |
@wsy I suggest reporting the task manager issue using the Feedback Hub tool in Windows - https://go.microsoft.com/fwlink/?linkid=760672. This will help ensure the problem will be routed to the right team and will be tracked properly. Since this is not a dotnet specific problem, I will close this issue. |
Well, during the weekends, I installed some Windows updates. Just now, I opened Windows Feedback app and filled out the form. Then I tried to reproduce the bug so that I could take screenshots of them. However the bug disappeared. Maybe it's already fixed in those updates I installed during the weekends. |
Description
If a program gets terminated by unhandled exception, the underlying OS process will not be terminated as expected.
Reproduction Steps
Expected behavior
Actual behavior
Further operation:
If you try to kill process "sample.exe", you will "succeed" for the first time.
However, the process "sample.exe" is still shown in taskmgr.exe with "Commit Size" of "84K". (No matter how much memory was requested before program exited.)
If you try to kill process "sample.exe" again, you will get "Access denied" error.
If you try to delete "sample.exe" at this time, file delete operation will succeed. However, the process still remains in taskmgr.exe
Regression?
No response
Known Workarounds
No response
Configuration
.NET version: 8.x, 7.x, 6.x
OS: Windows 11 22621.3593
Architecture: x64
Other information
I tried this in Windows Sandbox, which should be a clean environment.
I first noticed this bug with .Net 8. However, when I was taking screenshots for this bug report, I tried with .Net7 and .Net6 and this bug can still be re-produced.
The text was updated successfully, but these errors were encountered: