From f7667d7deb21b34ea63c93e393ec3f2795ef08ef Mon Sep 17 00:00:00 2001 From: "cpu@google.com" Date: Tue, 26 Aug 2008 18:37:05 +0000 Subject: Remove false 'process crash' signal (again) This is a redo of a previous CL that has been lgtm (by sky) that got hosed. - Sometimes we kill a plugin or a renderer by calling exitprocess(.., HUNG) we were counting that as a crash - Check for the return code and make a dchek into a regular case. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1389 0039d316-1c4b-4281-b951-d872f2087c98 --- base/process_util_win.cc | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'base/process_util_win.cc') diff --git a/base/process_util_win.cc b/base/process_util_win.cc index 940ee77..f09228fb 100644 --- a/base/process_util_win.cc +++ b/base/process_util_win.cc @@ -164,15 +164,26 @@ bool KillProcess(int process_id, int exit_code, bool wait) { bool DidProcessCrash(ProcessHandle handle) { DWORD exitcode = 0; - BOOL success = ::GetExitCodeProcess(handle, &exitcode); - DCHECK(success); - DCHECK(exitcode != STILL_ACTIVE); - - if (exitcode == 0 || // Normal termination. - exitcode == 1 || // Killed by task manager. - exitcode == 0xC0000354 || // STATUS_DEBUGGER_INACTIVE - exitcode == 0xC000013A || // Control-C/end session. - exitcode == 0x40010004) { // Debugger terminated process/end session. + if (!::GetExitCodeProcess(handle, &exitcode)) { + NOTREACHED(); + return false; + } + if (exitcode == STILL_ACTIVE) { + // The process is likely not dead or it used 0x103 as exit code. + NOTREACHED(); + return false; + } + + // Warning, this is not generic code; it heavily depends on the way + // the rest of the code kills a process. + + if (exitcode == 0 || // Normal termination. + exitcode == 1 || // Killed by task manager. + exitcode == 14 || // Killed because of a bad message. + exitcode == 16 || // Killed by hung detector (see ResultCodes) + exitcode == 0xC0000354 || // STATUS_DEBUGGER_INACTIVE. + exitcode == 0xC000013A || // Control-C/end session. + exitcode == 0x40010004) { // Debugger terminated process/end session. return false; } -- cgit v1.1