Startup crash, error message references commented out lines

I am in the progress of making my first game in UE4. I have experienced UE4 crashing on startup a few times now, and the problem has always turned out to be that the project fails to compile in Visual Studio. After fixing the compilation issue, I would have no issue opening it in UE.

This time, when UE crashed upon opening, I looked at the log in /Saved/Logs/ and saw this at the bottom:

[2018.09.23-01.48.00:707][  0]LogWindows: Error: === Critical error: ===
[2018.09.23-01.48.00:707][  0]LogWindows: Error: 
[2018.09.23-01.48.00:707][  0]LogWindows: Error: Fatal error!
[2018.09.23-01.48.00:707][  0]LogWindows: Error: 
[2018.09.23-01.48.00:707][  0]LogWindows: Error: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x00000230
[2018.09.23-01.48.00:707][  0]LogWindows: Error: 
[2018.09.23-01.48.00:707][  0]LogWindows: Error: [Callstack] 0x00007ffc57687766 UE4Editor-Engine.dll!UnknownFunction []
[2018.09.23-01.48.00:707][  0]LogWindows: Error: [Callstack] 0x00007ffc4b2b8c93 UE4Editor-KeyLime.dll!USlowdownEffectApplier::USlowdownEffectApplier() [c:\dev\ue\keylime_4.19 4.20\source\keylime\slowdowneffectapplier.cpp:7]
[2018.09.23-01.48.00:707][  0]LogWindows: Error: [Callstack] 0x00007ffc737da5bd UE4Editor-CoreUObject.dll!UnknownFunction []
[2018.09.23-01.48.00:707][  0]LogWindows: Error: [Callstack] 0x00007ffc73abd798 UE4Editor-CoreUObject.dll!UnknownFunction []
[2018.09.23-01.48.00:707][  0]LogWindows: Error: [Callstack] 0x00007ffc73a9d53f UE4Editor-CoreUObject.dll!UnknownFunction []
[2018.09.23-01.48.00:707][  0]LogWindows: Error: [Callstack] 0x00007ffc737e0517 UE4Editor-CoreUObject.dll!UnknownFunction []
[2018.09.23-01.48.00:707][  0]LogWindows: Error: [Callstack] 0x00007ffc718be08e UE4Editor-Core.dll!UnknownFunction []
[2018.09.23-01.48.00:707][  0]LogWindows: Error: [Callstack] 0x00007ffc71a77841 UE4Editor-Core.dll!UnknownFunction []
[2018.09.23-01.48.00:707][  0]LogWindows: Error: [Callstack] 0x00007ffc96d9d11c UE4Editor-Projects.dll!UnknownFunction []
[2018.09.23-01.48.00:707][  0]LogWindows: Error: [Callstack] 0x00007ffc96d9d404 UE4Editor-Projects.dll!UnknownFunction []
[2018.09.23-01.48.00:707][  0]LogWindows: Error: [Callstack] 0x00007ff66f928521 UE4Editor.exe!UnknownFunction []
[2018.09.23-01.48.00:707][  0]LogWindows: Error: [Callstack] 0x00007ff66f92d907 UE4Editor.exe!UnknownFunction []
[2018.09.23-01.48.00:707][  0]LogWindows: Error: [Callstack] 0x00007ff66f925968 UE4Editor.exe!UnknownFunction []
[2018.09.23-01.48.00:707][  0]LogWindows: Error: [Callstack] 0x00007ff66f925bba UE4Editor.exe!UnknownFunction []
[2018.09.23-01.48.00:707][  0]LogWindows: Error: [Callstack] 0x00007ff66f933dac UE4Editor.exe!UnknownFunction []
[2018.09.23-01.48.00:707][  0]LogWindows: Error: [Callstack] 0x00007ff66f935aaa UE4Editor.exe!UnknownFunction []
[2018.09.23-01.48.00:707][  0]LogWindows: Error: [Callstack] 0x00007ffca81a1fe4 KERNEL32.DLL!UnknownFunction []
[2018.09.23-01.48.00:707][  0]LogWindows: Error: [Callstack] 0x00007ffca884f061 ntdll.dll!UnknownFunction []
[2018.09.23-01.48.00:707][  0]LogWindows: Error: 
[2018.09.23-01.48.00:729][  0]LogExit: Executing StaticShutdownAfterError
[2018.09.23-01.48.00:732][  0]LogWindows: FPlatformMisc::RequestExit(1)
[2018.09.23-01.48.00:736][  0]Log file closed, 09/22/18 18:48:00

So I went to slowdowneffectapplier.cpp and commented out the function body that included line 7, resulting in this:

#include "SlowdownEffectApplier.h"

USlowdownEffectApplier::USlowdownEffectApplier()
	: UTimedEffectApplier()
{
	/*auto playerController = GetWorld()->GetFirstPlayerController();
	if (playerController != nullptr)
	{
		auto pawn = dynamic_cast<APlayerPawn*>(playerController->GetPawn());
		if (pawn != nullptr)
		{
			m_playerPawn = pawn;
		}
	}*/
}

void USlowdownEffectApplier::beginEffect()
{
	UTimedEffectApplier::beginEffect();
	m_playerPawn->applySlowdown();
}

However, after building successfully, the project still failed to open in in UE application. I looked at the new log generated on crash, and it was identical to the previous one.

This makes me suspect that the build files (the generated headers? the .exe’s? .dll’s?) being read are out of date, since it still said that line 7 of SlowDownEffectApplier.cpp was causing the problem, even though I’d commented out that line.

I’ve tried:

  • Spending hours googling my general problem (unfortunately I don’t remember everything that I tried, but I failed to find mention of anyone having an identical problem)
  • Switching build configurations in VS, since I remember experimenting with those before (tried DebugGame, DebugGame Editor, Development, and Development Editor)
  • Deleting the contents of the Intermediate directory
  • Regenerating visual studio proejct files by right-clicking the .uproject file
  • Deleting the files SlowDownEffectApplier.cpp and .h, recompiling, and running UE again. It crashes, and the log produced is identical except the line that mentions SlowDownEffectApplier.cpp now says E4Editor-CoreUObject.dll!UnknownFunction [] like the line below it, as though it is missing debug files.

This is the first time I’ve failed to find the information online and been driven to actually post here myself. Please let me know if I can provide any other information that would make this easier to diagnose. Thank you in advance for any insight.

Finally fixed this by deleting the contents of the \Binaries and \Saved directories (likely the \Binaries did it), regenerating the VS project and rebuilding. From now on I think I will delete \Binaries before opening a project in UE that I’ve edited in VS.