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

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