Exception in ExtMemoryPool::initTLS(void). No references to user code in call stack

Our game crashes in reproducible scenarios. But the call stack has no references to our own code. It’s just UE4 core “.dll” files all the way down.
Crash is present in packaged game, as well as while running in editor.

Clearly our code is doing something, somewhere, that milliseconds later in execution, upsets UE4 engine code.
Unfortunately, since the crash doesn’t happen while executing our code, breakpoints, call stacks, etc, don’t provide any clues as to what part of out code is causing problems.

I’ve posted the full call stack below. Does anyone have any ideas as to the type of actions that might be upsetting the ExtMemoryPool::initTLS(void) function?

Exception thrown at 0x00007FF92DC6370A (UE4Editor-Core.dll) in UE4Editor.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF.

UE4Editor-Core.dll!rml::internal::ExtMemoryPool::initTLS(void)	Unknown
UE4Editor-Core.dll!scalable_realloc()	Unknown
UE4Editor-Core.dll!FMallocTBB::Realloc(void * Ptr, unsigned __int64 NewSize, unsigned int Alignment) Line 105	C++
UE4Editor-Core.dll!FMemory::Realloc(void * Original, unsigned __int64 Count, unsigned int Alignment) Line 48	C++
UE4Editor-Core.dll!TArray<wchar_t,FDefaultAllocator>::ResizeGrow(int OldNum) Line 2244	C++
UE4Editor-Core.dll!FStatsUtils::ToEscapedFString(const wchar_t * Source) Line 2092	C++
UE4Editor-Core.dll!FStatNameAndInfo::ToLongName(FName InStatName, const char * InGroup, const char * InCategory, const wchar_t * InDescription) Line 734	C++
UE4Editor-Core.dll!FStartupMessages::AddMetadata(FName InStatName, const wchar_t * InStatDesc, const char * InGroupName, const char * InGroupCategory, const wchar_t * InGroupDesc, bool bShouldClearEveryFrame, EStatDataType::Type InStatType, bool bCycleStat, FWindowsPlatformMemory::EMemoryCounterRegion InMemoryRegion) Line 327	C++
UE4Editor-Core.dll!FDynamicStats::CreateStatId<FStatGroup_STATGROUP_UObjects>(const FName StatNameOrDescription) Line 489	C++
UE4Editor-Core.dll!FModuleManager::LoadModuleWithFailureReason(const FName InModuleName, EModuleLoadResult & OutFailureReason, const bool bWasReloaded) Line 369	C++
UE4Editor-Core.dll!FModuleManager::LoadModule(const FName InModuleName, const bool bWasReloaded) Line 338	C++
UE4Editor-Core.dll!FModuleManager::LoadModuleChecked(const FName InModuleName, const bool bWasReloaded) Line 349	C++
UE4Editor-UnrealEd.dll!UEditorEngine::Tick(float DeltaSeconds, bool bIdleMode) Line 1780	C++
UE4Editor-UnrealEd.dll!UUnrealEdEngine::Tick(float DeltaSeconds, bool bIdleMode) Line 396	C++
UE4Editor.exe!FEngineLoop::Tick() Line 3296	C++
UE4Editor.exe!GuardedMain(const wchar_t * CmdLine, HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, int nCmdShow) Line 166	C++
UE4Editor.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow) Line 199	C++

its weird… two thing weird about this crash…
one is engine try to allocate memory. two engine try to load a module or try to create an object… im not sure why engine try to load his module in runtime (because i assume modules should be loaded during startup)…

Maybe you using a module (like editor module?) which is not allowed to be used in packaged game?

There’s a third weird thing about this crash. The module that the engine is trying to load is different every time we reproduce the crash.

Hi, has there every been a solution for this? This is happening to me on UE version 4.19.2

At the time, our codebase wasn’t using the UObject system, and we were managing our own memory using “new” and “delete”. Something in there was very suddenly and reproducibly confusing UE4’s memory management, likely something to do with a memory leak we found a small time later. When it came time to write the final system (the existing code was a prototype), we went all-in on the UObject system, and never had any problems. Good luck!