I am writing my own code (Visual Studio, C++) and, often, when I compile in the Release configuration and run the code - if it crashes the process continues to exist in the task manager (I find it under the 'Details' tab). It's status shows up as 'Suspended' and the User name associated with it is my own.

The first problem that this presents is that when I go back to Visual Studio and try to fix the bug and recompile the Release configuration, the linker fails, presumably b/c the program is still present in Task manager. The only way I can get the program to recompile is with a full system restart (which is *such* a pain since I have to shut everything down and open everything back up).

The second problem which is a bit scary is that even after the reboot - the program still shows up in my Task Manager as 'Suspended' (even though now it's not stopping me from recompiling). So I'm building up a collection of Mark-40.exe (Mark-40 is the project name I've given to my code) Suspended processes (all with different PID's) in my task manager. They all seem benign - but I hate to think that they're eating up system resources in the background when I'd just like them to go away!

So I've tried everything I can think of to kill these processes:
- In Task Manager, I tried End Task and End process tree
- From the Command Prompt (as administrator), I've tried
- taskkill /PID 48956 /F
- taskkill /f /s localhost /pid 4800
- taskkill /f /s localhost /im Mark-40.exe
- And, e.g. when I enter the last line, the response I get is:
Code:
ERROR: The process "Mark-40.exe" with PID 4800 could not be terminated.
Reason: Access Denied.
ERROR: The process "Mark-40.exe" with PID 31068 could not be terminated.
Reason: Access Denied.
ERROR: The process "Mark-40.exe" with PID 24504 could not be terminated.
Reason: Access Denied.
ERROR: The process "Mark-40.exe" with PID 52184 could not be terminated.
Reason: Access Denied.
- I've installed and tried to run ProcessExplorer, ProcessMonitor and Process Hacker and tried to run all three as Administrator to kill the process and they fail.
- For example, with Process Hacker, when I try to terminate, I get the error:
Code:
Unable to terminiate Mark-40.exe (PID 4800): An attempt was made to access an exiting process.
- So, apparently, the code is stuck in some exit 'loop' and can't get out
- I'm willing to edit my registry (though I don't really know how) to get rid of these processes

I'm at a complete loss. Does anyone have an idea about what I might do?