
Debugged Process will not Terminate under Win2K
I believe this is a bug in VC++ de{*filter*}; When ever you stop debugging while
the debuggee is stoppped (say after a break or hitting a bp or in your case
an AV), the de{*filter*} fails to cleanup properly.
Workarounds
0. Stop debugging while the debuggee is running
1. Doing a "go" (F5) and then Stop debugging (won't work for you since you
are at an unhandled AV)
The VS7 beta1 de{*filter*} doesn't have this issue
I can not understand this problem so I am posting here to see if anyone else
has
encountered it. This is a real headache for us since we frequently end up
rebooting after each fault we get in the de{*filter*}.
The synopsis: Terminating our application under the de{*filter*} causes a zombie
process that can not be killed and lingers for about 5 minutes.
When we debug a program under VC++ 6 and Windows 2K the process does not
terminate cleanly when you use the "Stop debugging" command to terminate the
debugged program. I have distilled this to a very small console mode
application.
I just took all the defaults from the wizard for a "hello world" console
mode
program and then added the multimedia calls that seem to cause the problem.
If I run this program and catch the fault under the de{*filter*} and then I use
the "stop debugging" command the application will terminate visually but
task
manager shows that the application keeps running for about 5 minutes. You
can not
attach to the process and you can not kill it via any means (kill command,
task
manager etc). I suspect this effects other multimedia calls as well as
midiInOpen
(). We have had the same problem with mciSendCmd().
#include "stdafx.h"
#include <windows.h>
#include <mmsystem.h>
int main(int argc, char* argv[])
{
printf("Hello World!\n");
HMIDIIN m_hMidiIn;
DWORD dwRtn, dwNumDevs;
DWORD dwInID = 0; // use first MIDI IN
dwNumDevs = midiInGetNumDevs();
if (dwNumDevs)
dwRtn = midiInOpen(&m_hMidiIn, dwInID, 0, 0, CALLBACK_NULL);
int *x = 0; // cause a fault
*x = 0;
return 0;
Quote:
}