Pig of a crash - "Pure virtual function being called while application was running"

The problem is still there, we really need a solution.

1 Like

Going to need a lot more information other than “the problem”.

1 Like

Can attest to this as well (UE4.26, custom game instance, seems like adding new variables/functions tends to cause an eventual crash after hot reloading)

Keeping an eye out to see if this occurs in my case on UE runs without hot reloads or in a packaged version of the game, as there are other possible causes that results in this error. ie, in my personal case I may have multiple root causes (such as bad pointer management which is its own can of worms in my attempt to rapidly prototype)

For me 4.27.2 engine crashes 100% anytime, if the Cascade effect is running in editor, and I press Play button.

1 Like

It also occurs in 5.0, I’ve had this error for years. Is seriously no one in the Unreal C++ community using custom game instances? I find this hard to believe, and yet no one seems to have found a workaround. It happens with a bare-bones child class, and with some implementation and overriding.

In my case there are usually two different crashes that occur when I have a custom GameInstance C++ class specified in the project settings. See below for the two stack traces. I get the first one more often than the second. They occur usually when I compile or when I try to play through PIE. They have occurred in four entirely different projects, on different pieces of hardware, across the last 4-5 years.

I have tried implementing the three methods mentioned earlier in this thread. That didn’t work. The only workaround I’ve come around to is just turn off my custom game instance. The crashes are annoyingly frequent, many times per hour. They’re not very predictable, other than sometimes when you try to play through PIE. I cannot recall if they happen in packaged projects, but I want to say I remember them happening the last time I bothered trying to debug this error.

[2022.08.06-01.57.17:415][  6]LogWindows: Error: === Critical error: ===
[2022.08.06-01.57.17:415][  6]LogWindows: Error: 
[2022.08.06-01.57.17:415][  6]LogWindows: Error: Fatal error: [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\Windows\WindowsPlatformMisc.cpp] [Line: 441] 
[2022.08.06-01.57.17:415][  6]LogWindows: Error: Pure virtual function being called
[2022.08.06-01.57.17:415][  6]LogWindows: Error: 
[2022.08.06-01.57.17:415][  6]LogWindows: Error: 
[2022.08.06-01.57.17:415][  6]LogWindows: Error: 
[2022.08.06-01.57.17:415][  6]LogWindows: Error: 
[2022.08.06-01.57.17:415][  6]LogWindows: Error: [Callstack] 0x00007ffd988064f6 UnrealEditor-Core.dll!PureCallHandler() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\Windows\WindowsPlatformMisc.cpp:443]
[2022.08.06-01.57.17:415][  6]LogWindows: Error: [Callstack] 0x00007ffde7926e44 VCRUNTIME140.dll!UnknownFunction []
[2022.08.06-01.57.17:415][  6]LogWindows: Error: [Callstack] 0x00007ffd978bc546 UnrealEditor-CoreUObject.dll!UGCObjectReferencer::VerifyGCObjectNames() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\Misc\GCObjectReferencer.cpp:199]
[2022.08.06-01.57.17:415][  6]LogWindows: Error: [Callstack] 0x00007ffd9788a151 UnrealEditor-CoreUObject.dll!TBaseUObjectMethodDelegateInstance<0,UGCObjectReferencer,void __cdecl(void),FDefaultDelegateUserPolicy>::ExecuteIfSafe() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:611]
[2022.08.06-01.57.17:415][  6]LogWindows: Error: [Callstack] 0x00007ffd978f217d UnrealEditor-CoreUObject.dll!TMulticastDelegate<void __cdecl(void),FDefaultDelegateUserPolicy>::Broadcast() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Delegates\DelegateSignatureImpl.inl:967]
[2022.08.06-01.57.17:415][  6]LogWindows: Error: [Callstack] 0x00007ffd97a896c8 UnrealEditor-CoreUObject.dll!CollectGarbageInternal() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\GarbageCollection.cpp:2232]
[2022.08.06-01.57.17:415][  6]LogWindows: Error: [Callstack] 0x00007ffd97a88eec UnrealEditor-CoreUObject.dll!CollectGarbage() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\GarbageCollection.cpp:2543]
[2022.08.06-01.57.17:415][  6]LogWindows: Error: [Callstack] 0x00007ffd73861dd8 UnrealEditor-PythonScriptPlugin.dll!FPyReferenceCollector::PurgeUnrealGeneratedTypes() [D:\build\++UE5\Sync\Engine\Plugins\Experimental\PythonScriptPlugin\Source\PythonScriptPlugin\Private\PyReferenceCollector.cpp:167]
[2022.08.06-01.57.17:415][  6]LogWindows: Error: [Callstack] 0x00007ffd738726f6 UnrealEditor-PythonScriptPlugin.dll!FPythonScriptPlugin::ShutdownPython() [D:\build\++UE5\Sync\Engine\Plugins\Experimental\PythonScriptPlugin\Source\PythonScriptPlugin\Private\PythonScriptPlugin.cpp:1067]
[2022.08.06-01.57.17:415][  6]LogWindows: Error: [Callstack] 0x00007ffd73841bbf UnrealEditor-PythonScriptPlugin.dll!TBaseRawMethodDelegateInstance<0,FPythonScriptPlugin,void __cdecl(void),FDefaultDelegateUserPolicy>::ExecuteIfSafe() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:469]
[2022.08.06-01.57.17:415][  6]LogWindows: Error: [Callstack] 0x00007ff72bd77f7d UnrealEditor.exe!TMulticastDelegate<void __cdecl(void),FDefaultDelegateUserPolicy>::Broadcast() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Delegates\DelegateSignatureImpl.inl:967]
[2022.08.06-01.57.17:415][  6]LogWindows: Error: [Callstack] 0x00007ff72bd777e6 UnrealEditor.exe!FEngineLoop::AppPreExit() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:6103]
[2022.08.06-01.57.17:415][  6]LogWindows: Error: [Callstack] 0x00007ff72bd80097 UnrealEditor.exe!FEngineLoop::Exit() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:4524]
[2022.08.06-01.57.17:415][  6]LogWindows: Error: [Callstack] 0x00007ff72bd80e2b UnrealEditor.exe!GuardedMain() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Launch.cpp:197]
[2022.08.06-01.57.17:415][  6]LogWindows: Error: [Callstack] 0x00007ff72bd80e8a UnrealEditor.exe!GuardedMainWrapper() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:147]
[2022.08.06-01.57.17:415][  6]LogWindows: Error: [Callstack] 0x00007ff72bd83c4d UnrealEditor.exe!LaunchWindowsStartup() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:283]
[2022.08.06-01.57.17:415][  6]LogWindows: Error: [Callstack] 0x00007ff72bd95564 UnrealEditor.exe!WinMain() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:330]
[2022.08.06-01.57.17:415][  6]LogWindows: Error: [Callstack] 0x00007ff72bd98736 UnrealEditor.exe!__scrt_common_main_seh() [d:\a01\_work\6\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
[2022.08.06-01.57.17:415][  6]LogWindows: Error: [Callstack] 0x00007ffdfeae7034 KERNEL32.DLL!UnknownFunction []
[2022.08.06-01.57.17:415][  6]LogWindows: Error: [Callstack] 0x00007ffdff702651 ntdll.dll!UnknownFunction []
[2022.08.06-01.57.17:415][  6]LogWindows: Error: 
[2022.08.06-01.57.17:423][  6]LogExit: Executing StaticShutdownAfterError
[2022.08.06-01.57.17:427][  6]LogWindows: FPlatformMisc::RequestExit(1)
[2022.08.06-01.57.17:427][  6]LogWindows: FPlatformMisc::RequestExitWithStatus(1, 3)
[2022.08.06-01.57.17:427][  6]LogCore: Engine exit requested (reason: Win RequestExit; note: exit was already requested)
[2022.08.06-01.57.17:434][  6]Log file closed, 08/05/22 21:57:17
[2022.08.06-02.07.11:526][936]LogThreadingWindows: Error: Runnable thread Foreground Worker #1 crashed.
[2022.08.06-02.07.11:527][936]LogWindows: Error: === Critical error: ===
[2022.08.06-02.07.11:527][936]LogWindows: Error: 
[2022.08.06-02.07.11:527][936]LogWindows: Error: Fatal error!
[2022.08.06-02.07.11:527][936]LogWindows: Error: 
[2022.08.06-02.07.11:527][936]LogWindows: Error: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0xffffffffffffffff
[2022.08.06-02.07.11:527][936]LogWindows: Error: 
[2022.08.06-02.07.11:527][936]LogWindows: Error: [Callstack] 0x00007ffd97880391 UnrealEditor-CoreUObject.dll!UGCObjectReferencer::AddReferencedObjects() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\Misc\GCObjectReferencer.cpp:52]
[2022.08.06-02.07.11:527][936]LogWindows: Error: [Callstack] 0x00007ffd97c245b2 UnrealEditor-CoreUObject.dll!TFastReferenceCollector<FAllReferencesProcessor,TDefaultReferenceCollector<FAllReferencesProcessor,0,0>,FGCArrayPool,6>::ProcessObjectArray() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Public\UObject\FastReferenceCollector.h:788]
[2022.08.06-02.07.11:527][936]LogWindows: Error: [Callstack] 0x00007ffd97c00438 UnrealEditor-CoreUObject.dll!<lambda_0920b702532fa6a0d31a969b60fd5832>::operator()() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\ReferencerFinder.cpp:125]
[2022.08.06-02.07.11:527][936]LogWindows: Error: [Callstack] 0x00007ffd97a81379 UnrealEditor-CoreUObject.dll!`ParallelForImpl::NewParallelForInternal<TFunctionRef<void __cdecl(int)>,<lambda_600b85aa2a81f4761389a82b02631227>,std::nullptr_t>'::`2'::FParallelExecutor::operator()() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Async\ParallelFor.h:566]
[2022.08.06-02.07.11:527][936]LogWindows: Error: [Callstack] 0x00007ffd97a87e91 UnrealEditor-CoreUObject.dll!LowLevelTasks::TTaskDelegate<void __cdecl(bool),48>::TTaskDelegateImpl<<lambda_a7d909f875cf8fde887b62459e73acd4>,0>::CallAndMove() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Async\Fundamental\TaskDelegate.h:171]
[2022.08.06-02.07.11:527][936]LogWindows: Error: [Callstack] 0x00007ffd9811e398 UnrealEditor-Core.dll!LowLevelTasks::FTask::ExecuteTask() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Async\Fundamental\Task.h:426]
[2022.08.06-02.07.11:527][936]LogWindows: Error: [Callstack] 0x00007ffd98102a78 UnrealEditor-Core.dll!LowLevelTasks::FScheduler::TryExecuteTaskFrom<&LowLevelTasks::TLocalQueueRegistry<1024>::TLocalQueue::DequeueGlobal,0>() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\Async\Fundamental\Scheduler.cpp:280]
[2022.08.06-02.07.11:527][936]LogWindows: Error: [Callstack] 0x00007ffd9813ea02 UnrealEditor-Core.dll!LowLevelTasks::FScheduler::WorkerMain() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\Async\Fundamental\Scheduler.cpp:320]
[2022.08.06-02.07.11:527][936]LogWindows: Error: [Callstack] 0x00007ffd9810f4d0 UnrealEditor-Core.dll!UE::Core::Private::Function::TFunctionRefCaller<<lambda_776551d1e343b6cb7eaf0e5521c77c81>,void __cdecl(void)>::Call() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Templates\Function.h:549]
[2022.08.06-02.07.11:527][936]LogWindows: Error: [Callstack] 0x00007ffd98273d45 UnrealEditor-Core.dll!FThreadImpl::Run() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\HAL\Thread.cpp:69]
[2022.08.06-02.07.11:527][936]LogWindows: Error: [Callstack] 0x00007ffd98807a2b UnrealEditor-Core.dll!FRunnableThreadWin::Run() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\Windows\WindowsRunnableThread.cpp:146]
[2022.08.06-02.07.11:527][936]LogWindows: Error: [Callstack] 0x00007ffd98800a90 UnrealEditor-Core.dll!FRunnableThreadWin::GuardedRun() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\Windows\WindowsRunnableThread.cpp:76]
[2022.08.06-02.07.11:527][936]LogWindows: Error: [Callstack] 0x00007ffdfeae7034 KERNEL32.DLL!UnknownFunction []
[2022.08.06-02.07.11:527][936]LogWindows: Error: [Callstack] 0x00007ffdff702651 ntdll.dll!UnknownFunction []
[2022.08.06-02.07.11:527][936]LogWindows: Error: 
[2022.08.06-02.07.11:527][936]LogWindows: Error: Crash in runnable thread Foreground Worker #1
[2022.08.06-02.07.11:542][936]LogExit: Executing StaticShutdownAfterError
[2022.08.06-02.07.11:542][936]LogWindows: FPlatformMisc::RequestExit(1)
[2022.08.06-02.07.11:543][936]LogWindows: FPlatformMisc::RequestExitWithStatus(1, 3)
[2022.08.06-02.07.11:543][936]LogCore: Engine exit requested (reason: Win RequestExit)
[2022.08.06-02.07.11:547][936]Log file closed, 08/05/22 22:07:11

2 Likes

Sure, that works fine. My project has an extremely complex GameInstance, although it doesn’t look like we’ve implemented anything from the base class other than Init() and Shutdown().

I’d love to see a debugger hit on these crashes, that would probably be pretty helpful.

On the first one you have there, it looks like the trace is going right through Garbage Collection. If you’re crashing in Garbage Collection, that usually means there’s a strong likelihood that you’ve stomped on memory somewhere that didn’t get detected, and now Bad Things are happening elsewhere. The usual culprit is not having some object pointer as UPROPERTY when you should, although there are other ways to also completely blow up the Garbage Collector.

The second one is blowing up in an AddReferencedObjects(), which makes little sense to me, unless you’ve also seriously corrupted memory somehow.

I don’t think this is happening simply because you’ve extended UGameInstance. I think somewhere you’re stomping all over memory in the garbage collector.

I’ll get back to you tomorrow, as with the new project I’m working on I’d really like to have a custom GameInstance, and after spending a little bit of time on it again I’ve run into the same issues my previous projects have. I got a debugger hit a few minutes ago on the crash but its late at this point and can’t be bothered to get into it now. I got one of each crash - pure virtual function being called and the AddReferencedObjects one, both I have not had until today when I tried to implement a custom GameInstance.

One thing I noticed is I actually got the crash after reverting back to the default GameInstance, and now I remember another oddity about this crash - you have to completely remove the file from the project, not just revert the game instance class to its default in the project settings, in order to get an Unreal experience that doesn’t involve crashing every ten minutes.

1 Like

Finally got around to looking into this a bit further, sorry for the wait. Here is the information I’ve gathered so far.

A screencap of one of the types of crashes I get (as detailed above, there are two ones, both relating to GC it seems).

There is some external code I do not have access to. This seems to be happening most often on map change, so the GC is probably going through a lot of memory and cleaning up. Makes sense. However, again this never happened until after I set my own custom GameInstance class, which I now have as of yesterday.

Going through the stack, the crash occurs in UGCObjectReference::VerifyGCObjectName():

void UGCObjectReferencer::VerifyGCObjectNames()
{
	if (bReferencedObjectsChangedSinceLastNameVerify && GShouldVerifyGCAssumptions && GVerifyGCObjectNames)
	{
		FVerifyReferencerNameCollector VerifyReferencerNameCollector;

>>>>		for (FGCObject* GCObject : ReferencedObjects)
		{
			check(GCObject);
			VerifyReferencerNameCollector.SetCurrentGCObject(GCObject);
			GCObject->AddReferencedObjects(VerifyReferencerNameCollector);
		}
	}
}

Error line denoted by angle brackets. The GCObject in question:

One other thing I can think of is I sometimes get a crash due something wrong with “qualified names”. It happens sporadically, usually when I try to run the game through PIE, just as this error sometimes does.

I’m not sure where to go from here, but I’ll do some digging on how object names are determined and how it could relate to this crash, as a failure to verify or determine an object names seems to be causing this, but again, ony when a custom GameInstance is set.

EDIT: Adding another investigation of the other crash (this is the second of the two crashes I think are related to this issue):

Same function as above, but a different line:

void UGCObjectReferencer::VerifyGCObjectNames()
{
	if (bReferencedObjectsChangedSinceLastNameVerify && GShouldVerifyGCAssumptions && GVerifyGCObjectNames)
	{
		FVerifyReferencerNameCollector VerifyReferencerNameCollector;

		for (FGCObject* GCObject : ReferencedObjects)
		{
			check(GCObject);
			VerifyReferencerNameCollector.SetCurrentGCObject(GCObject);
>>>>		GCObject->AddReferencedObjects(VerifyReferencerNameCollector);
		}
	}
}

GCObject at the line with angle brackets above is nullptr. I was trying to provoke the crash by rebuilding the project and launching through PIE. I had UE_DEBUG_BREAK() set in a newly created constructor and destructor in the CustomGameInstance class. I created these because I noticed the “vector deleting destructor” tag in the stack vptr for the GCObject (see screenshot above). I noticed prior to this crash that three CustomGameInstance destructor calls were made. I noticed that when I closed PIE, it did not always destruct the custom GameInstance (not sure if this is intended behavior, might just be GC hadn’t got around to clean up).

I also noticed when Unreal launches, it creates a CustomGameInstance object called something like Default___CustomGameInstance, then when you launch your game through PIE, it creates another one called CustomGameInstance#, where # is just a number (each launch it adds one to this number), just as it would for any other object created. Most of the time, that CustomGameInstance# is destroyed on PIE close, but not all the time, but maybe this is just the GC being the GC. So, there is always at least one CustomGameInstance, when playing through PIE, there is always at least two.

One other oddity… When you compile, the Default__CustomGameInstance constructor is called, and with new memory address for this. However, the destructor for any previous Default__CustomGameInstance objects is NOT called until after you open and close PIE. I may have just found a way to reproduce at least this crash, which may help solve the other crash. I’ll update with another post if I can confirm with a new project.

2 Likes

Ok, I can finally reproduce this crash:

> [Inline Frame] UnrealEditor-Core.dll!PureCallHandler::__l2::<lambda_c97a0b2756f1237c2313cf65d6ce6659>::operator()() Line 425 C++
UnrealEditor-Core.dll!PureCallHandler() Line 425 C++
[External Code]
UnrealEditor-CoreUObject.dll!UGCObjectReferencer::VerifyGCObjectNames() Line 199 C++
[Inline Frame] UnrealEditor-CoreUObject.dll!Invoke(void(UGCObjectReferencer::*)()) Line 66 C++
[Inline Frame] UnrealEditor-CoreUObject.dll!UE::Core::Private::Tuple::TTupleBase<TIntegerSequence>::ApplyAfter(void(UGCObjectReferencer::*)() &) Line 324 C++
UnrealEditor-CoreUObject.dll!TBaseUObjectMethodDelegateInstance<0,UGCObjectReferencer,void __cdecl(void),FDefaultDelegateUserPolicy>::ExecuteIfSafe() Line 611 C++
UnrealEditor-CoreUObject.dll!TMulticastDelegate<void __cdecl(void),FDefaultDelegateUserPolicy>::Broadcast() Line 967 C++
UnrealEditor-CoreUObject.dll!CollectGarbageInternal(EObjectFlags KeepFlags, bool bPerformFullPurge) Line 2232 C++
UnrealEditor-CoreUObject.dll!CollectGarbage(EObjectFlags KeepFlags, bool bPerformFullPurge) Line 2543 C++
UnrealEditor-UnrealEd.dll!UEditorEngine::EndPlayMap() Line 415 C++
UnrealEditor-UnrealEd.dll!UEditorEngine::Tick(float DeltaSeconds, bool bIdleMode) Line 2097 C++
UnrealEditor-UnrealEd.dll!UUnrealEdEngine::Tick(float DeltaSeconds, bool bIdleMode) Line 474 C++
UnrealEditor.exe!FEngineLoop::Tick() Line 5215 C++
[Inline Frame] UnrealEditor.exe!EngineTick() Line 62 C++
UnrealEditor.exe!GuardedMain(const wchar_t * CmdLine) Line 183 C++
UnrealEditor.exe!LaunchWindowsStartup(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow, const wchar_t * CmdLine) Line 272 C++
UnrealEditor.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * pCmdLine, int nCmdShow) Line 330 C++
[External Code]
  1. Create a new Unreal Project
  2. Set it as a C++ Project
  3. Create a C++ subclass of the GameInstance class
  4. Open Project Settings, search Game Instance, set the new GameInstance subclass as the new default game instance class.
  5. Compile in editor
  6. Compile in editor (again)
  7. Play through PIE
  8. Close PIE
  9. Crash (‘Pure virtual function being called while application was running’ OR ‘EXCEPTION_ACCESS_VIOLATION’ - see stack below)

It is the two compilations before opening and closing PIE that causes this crash, and I’ll admit that I do this quite often when I get side tracked after doing the first compile, and wonder if I actually tried to compile, so I’ll compile again to make sure.

On my second attempt to verify this indeed causes this crash, I got the other of the two errors I think are closely related to this problem:

Fatal error!

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000000008

0x00007ffe56d6c543 UnrealEditor-CoreUObject.dll!UGCObjectReferencer::VerifyGCObjectNames() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\Misc\GCObjectReferencer.cpp:203]
0x00007ffe56d3a151 UnrealEditor-CoreUObject.dll!TBaseUObjectMethodDelegateInstance<0,UGCObjectReferencer,void __cdecl(void),FDefaultDelegateUserPolicy>::ExecuteIfSafe() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:611]
0x00007ffe56da217d UnrealEditor-CoreUObject.dll!TMulticastDelegate<void __cdecl(void),FDefaultDelegateUserPolicy>::Broadcast() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Delegates\DelegateSignatureImpl.inl:967]
0x00007ffe56f396c8 UnrealEditor-CoreUObject.dll!CollectGarbageInternal() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\GarbageCollection.cpp:2232]
0x00007ffe56f38eec UnrealEditor-CoreUObject.dll!CollectGarbage() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\GarbageCollection.cpp:2543]
0x00007ffe43cf1540 UnrealEditor-UnrealEd.dll!UEditorEngine::EndPlayMap() [D:\build\++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\PlayLevel.cpp:415]
0x00007ffe436dfa40 UnrealEditor-UnrealEd.dll!UEditorEngine::Tick() [D:\build\++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\EditorEngine.cpp:2097]
0x00007ffe4406aac6 UnrealEditor-UnrealEd.dll!UUnrealEdEngine::Tick() [D:\build\++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\UnrealEdEngine.cpp:474]
0x00007ff7efe882f6 UnrealEditor.exe!FEngineLoop::Tick() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:5215]
0x00007ff7efea0d9c UnrealEditor.exe!GuardedMain() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Launch.cpp:183]
0x00007ff7efea0e8a UnrealEditor.exe!GuardedMainWrapper() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:147]
0x00007ff7efea3c4d UnrealEditor.exe!LaunchWindowsStartup() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:283]
0x00007ff7efeb5564 UnrealEditor.exe!WinMain() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:330]
0x00007ff7efeb8736 UnrealEditor.exe!__scrt_common_main_seh() [d:\a01\_work\6\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
0x00007ffe95097034 KERNEL32.DLL!UnknownFunction []
0x00007ffe964c2651 ntdll.dll!UnknownFunction []

To reiterate: If you simply compile once the crash does not occur after opening and closing PIE. So I guess that’s the “workaround” - don’t compile more than once between PIE open and closes. And it doesn’t matter if you actually made changes to the code or not before the compilations.

That said, I do believe this occurs in packaged builds so I’m not entirely convinced this is the only way to produce this crash, but it certainly is one way I have been able to.

Here is the repo for this minimal project:

3 Likes

I’ve been wondering about this problem for some time.

The crash has been occurring much less frequently for the past 2-3 weeks for me when using Hot Reload. Sometimes I can re-compile in VS many times before triggering the issue, much more than only twice. Some days I don’t run into the issue at all.

I normally compile from within VS rather than initiating it through the Unreal editor though.

EDIT: I cannot remember ever running into this crash when I was working with UE5 EA/EA2 for many months. Issues started for me when I tested the Preview version of UE5 very shortly before UE5 stable release.

2 Likes

Do you have a custom GameInstance specified in your project settings?

I also don’t compile via VS, I compile through the Editor’s compile button in the bottom right, so perhaps that’s another workaround.

2 Likes

I do use a custom Game Instance, but I only recently added it for my current project.

The interesting thing is that I had the issues in this new project for months before I recently added the custom Game Instance. Past projects I used one and had the issue, but this time, I would have the issue regardless of whether I had one or not.

2 Likes

I’m experiencing the same crash, for me it is caused by calling a BlueprintImplementable / native event in Tick

2 Likes

Interesting.

The only type of Blueprint I use in my project is Animation Blueprint (ABP), even so, those are all using a parent C++ class that handles the real logic other than the State Machine graphs.

I’m also hardly ever using Tick in general, other than override routines such as UAnimInstance::NativeUpdateAnimation really (which is basically the equivalent/similar but for animation instances).

On that note, I’ve been experiencing this crash more frequently for the past week - week and a half. I haven’t updated the engine, still using 5.0.2 as I have been for months.

I recently enabled Live Coding, and have not had any issues with crashes of this kind. I highly recommend switching to Live Coding as a workaround. It also generally works a lot better than Hot Reloading.

2 Likes

I’ve continued using Hot Reload and haven’t had this issue happen once since my last post despite me using Hot Reload 10-20 times in the same editor session sometimes.

I haven’t updated the engine either so it can’t have been fixed in an update and that’d explain why I haven’t experienced it for a while.

Strange…

My issue was a mistake in the function I made. The function was to get the name of something and set text in a HUD. When the function was bound to the text it cause the crash mentioned in this page. The issue was that I called a different function inside the GetName() Function causing a loop. Once the called function was removed the issue went away. In summary my advice is to isolate the function that is causing the issue and make sure you aren’t causing a loop.

Since I create a cpp subclass of the GameInstance class and compile twice before opening and closing the PIE, I have this error. (As said previously)
It only happens when using the Hot Reloading, and seem to not appear using Live Coding.

It’s maybe due to something external ?

I’ve been getting this error but it only happens inside a third party plugin. I’ve tried debugging it, but the stacktrace always ends up at the Windows.cpp file. The really weird thing is if I duplicate the project, the duplicate project doesn’t have this issue. And since this error only seems to happen on the original project, it makes it even harder to chase down because it is not consistent across projects.

For the meantime I am just using the original project as a backup and continuing work in the duplicate project. I will keep trying to figure this out, but I have been very lost on this issue for a while.

Hope someone can come and save us one day and provide a fix lol.

1 Like

Are people still getting this error? I have a mechanic where I activate a beacon (Press E for 3 seconds) it does not trigger the error on the first 2 beacons but on the third ( doesn’t matter which order) it breaks.
Any clue? its driving me insane.

LoginId:080c367346bfa51e4bc29dac8831eeda
EpicAccountId:c44994ddb8404e49be607907c4202e1a

Fatal error: [File:D:\build++UE5\Sync\Engine\Source\Runtime\Core\Private\Windows\WindowsPlatformMisc.cpp] [Line: 440] Pure virtual function being called

UnrealEditor_Core
VCRUNTIME140
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_SlateCore
UnrealEditor_Slate
UnrealEditor_Slate
UnrealEditor_Slate
UnrealEditor_Slate
UnrealEditor_Slate
UnrealEditor_Slate
UnrealEditor
UnrealEditor
UnrealEditor
UnrealEditor
UnrealEditor
UnrealEditor
kernel32
ntdll