[*] TODO: Fix and revert (this is already being rewritten. just need this to not break for now)

Reece, [16/09/2024 21:22]
need to finish audebug update on the laptop

Reece, [16/09/2024 21:22]
loading broken dlls (incl missing iat resolves) results in a telemetry deadlock

Reece, [16/09/2024 21:23]
win32 ldr lock is held while dbghelp tries to acquire lock
This commit is contained in:
Reece Wilson 2024-09-16 22:17:42 +01:00
parent 9acc56431a
commit 31193f6c4d

View File

@ -31,6 +31,8 @@
#include <WerApi.h> #include <WerApi.h>
#endif #endif
#include <Aux_ulib.h>
static thread_local int gDebugLocked = 0; static thread_local int gDebugLocked = 0;
namespace Aurora::Debug namespace Aurora::Debug
@ -206,6 +208,21 @@ namespace Aurora::Debug
}; };
StackTrace backtrace; StackTrace backtrace;
BOOL bLocked {};
if (AuxUlibIsDLLSynchronizationHeld(&bLocked))
{
if (bLocked)
{
ParseStack(ExceptionInfo->ContextRecord, backtrace);
AuLogWarn("DLL Load NT Exception: 0x{:x}", ExceptionInfo->ExceptionRecord->ExceptionCode);
AuLogWarn("{}", StringifyStackTrace(backtrace));
gDebugLocked = 0;
return EXCEPTION_CONTINUE_SEARCH;
}
}
{ {
static bool bRunOnce {}; static bool bRunOnce {};
struct ArrowEx : Grug::Arrow struct ArrowEx : Grug::Arrow
@ -245,10 +262,17 @@ namespace Aurora::Debug
CONTEXT ctx {}; CONTEXT ctx {};
ctx.ContextFlags = CONTEXT_ALL; ctx.ContextFlags = CONTEXT_ALL;
if (ExceptionInfo->ContextRecord)
{
ctx = *ExceptionInfo->ContextRecord;
}
else
{
if (!GetThreadContext(GetCurrentThread(), &ctx)) if (!GetThreadContext(GetCurrentThread(), &ctx))
{ {
Debug::Panic(); Debug::Panic();
} }
}
AuVoidFunc doReportLocal; AuVoidFunc doReportLocal;
{ {