I help maintain a plugin that makes uses of some helper DLLs. Un-encrypted builds of these DLLs load fine, but the encrypted builds crash the editor immediately at launch on UE 5.8. The same encrypted DLLs worked on 5.7, so this is new 5.8 behaviour. I have tracked this crash to WindowsCallstackTrace.cpp FBacktracer::AddModule(). From what I can tell this is called no matter what when loading a DLL and attempts to construct an unwind table using the function pointers from the DLL. I’m not that familiar with what the encryption does but it seems to jumble these up so they then point to invalid memory which is what causes the crash. Because of the company policy I can’t ship un-encrypted versions of the DLL to make it work. If a check could be added to ensure that the access violation can’t be reached or a way to opt out of the tracing for certain DLLs that would be great. I was able to get around this problem by modifying the engine source to provide a helper function to make sure the data is readable before de-referecing:
static bool BacktraceReadable(const void* Ptr, SIZE_T Size, UPTRINT ModuleBase, UPTRINT ModuleEnd,
const TCHAR* Name, const TCHAR* Where, uint32 FuncIndex, uint32 NumFunctions)
{
MEMORY_BASIC_INFORMATION Mbi = {};
const uint8* Cur = (const uint8*)Ptr;
const uint8* PtrEnd = Cur + Size;
bool bReadable = true;
while (Cur < PtrEnd)
{
if (::VirtualQuery(Cur, &Mbi, sizeof(Mbi)) == 0 ||
Mbi.State != MEM_COMMIT ||
(Mbi.Protect & (PAGE_NOACCESS | PAGE_GUARD)))
{
bReadable = false;
break;
}
Cur = (const uint8*)Mbi.BaseAddress + Mbi.RegionSize;
}
if (!bReadable)
{
const bool bInImage = (UPTRINT(Ptr) >= ModuleBase) && (UPTRINT(Ptr) < ModuleEnd);
const int64 Rva = (int64)(UPTRINT(Ptr) - ModuleBase);
FPlatformMisc::LowLevelOutputDebugStringf(
TEXT("[RS-UNWIND] skip module=%s where=%s func=%u/%u ptr=0x%p rva=0x%llx base=0x%p end=0x%p inImage=%d state=0x%08x protect=0x%08x\n"),
Name ? Name : TEXT("<null>"), Where, FuncIndex, NumFunctions, Ptr, Rva,
(void*)ModuleBase, (void*)ModuleEnd, bInImage ? 1 : 0, (uint32)Mbi.State, (uint32)Mbi.Protect);
}
return bReadable;
}
This just skips the problematic DLL entirely and allows the editor to launch. If it’s possible to add something like this that would be greatly appreciated.
Let me know if I can provide anymore information.
[Attachment Removed]