From 0804abcca6021bc600294737ee2a8a55b3f1a313 Mon Sep 17 00:00:00 2001 From: Clement Date: Tue, 24 Apr 2018 10:57:31 -0700 Subject: [PATCH] Heap corruption crashes CR --- interface/src/Crashpad.cpp | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/interface/src/Crashpad.cpp b/interface/src/Crashpad.cpp index 27da619af1..ae2f341337 100644 --- a/interface/src/Crashpad.cpp +++ b/interface/src/Crashpad.cpp @@ -40,27 +40,13 @@ extern QString qAppFileName(); #include LONG WINAPI vectoredExceptionHandler(PEXCEPTION_POINTERS pExceptionInfo) { - static const DWORD EXTERNAL_EXCEPTION_CODE{ 0xe06d7363 }; - static const DWORD HEAP_CORRUPTION_CODE{ 0xc0000374 }; - - auto exceptionCode = pExceptionInfo->ExceptionRecord->ExceptionCode; - if (exceptionCode == EXTERNAL_EXCEPTION_CODE) { - return EXCEPTION_CONTINUE_SEARCH; - } - - if (exceptionCode == HEAP_CORRUPTION_CODE) { - qCritical() << "VectoredExceptionHandler: Heap corruption:" << QString::number(exceptionCode, 16); - + if (pExceptionInfo->ExceptionRecord->ExceptionCode == STATUS_HEAP_CORRUPTION || + pExceptionInfo->ExceptionRecord->ExceptionCode == STATUS_STACK_BUFFER_OVERRUN) { CrashpadClient client; if (gIPCPipe.length()) { - bool rc = client.SetHandlerIPCPipe(gIPCPipe); - qCritical() << "SetHandlerIPCPipe = " << rc; - } else { - qCritical() << "No IPC Pipe was previously defined for crash handler."; + client.SetHandlerIPCPipe(gIPCPipe); } - qCritical() << "Calling DumpAndCrash()"; client.DumpAndCrash(pExceptionInfo); - return EXCEPTION_CONTINUE_SEARCH; } return EXCEPTION_CONTINUE_SEARCH;