mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 08:43:47 +02:00
Heap corruption crashes CR
This commit is contained in:
parent
f2c471558c
commit
0804abcca6
1 changed files with 3 additions and 17 deletions
|
@ -40,27 +40,13 @@ extern QString qAppFileName();
|
|||
#include <Windows.h>
|
||||
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue