How can I fix "Fatal error!" at initialization 71% during UE4 Editor 4.11.2 launch via MYGAME.uproject?

I’m developing a C++ project, using a source build of UE 4.11.2. I’m using VS Community 2015, and I’ve verified I’m using the Development Editor configuration and Win64 platform with the UnrealBuildTool.

I can no longer launch my project within the UE4 editor. The launch graphic reaches 71% initialization and consistency crashes with a “Fatal error!”

LogWindows:Error: === Critical error: ===

Fatal error!

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x00000128

I’ve rebuilt my project, regenerated project files, removed code modifications made after the previous successful, regenerated project files and rebuilt the project again - all successful compiles without error, but I still can’t open the project in the editor.

I often get a warning that my project .dlls have been built with a different version or are unavailable. The dialogue warning prompts me to rebuild them, and I do. Sometimes it then goes on to begin initializing the editor (and then crashes at 71%), other times it says the build failed and prompts me to rebuild the source manually. When I do, I get no errors in my compile and can verify that the .dlls have all been modified, but the launch behavior does not change.

Looking at the log file (link text) it seems to crash while loading a file: “/Engine/Content/Editor/Slate/Common/Selection_16x.png” which I verified does not exist. I have “selection.png” and “selector.png” but nothing with “_16x”.

I tried associating the project with a 4.11.release source build, and with a new build of 4.11.2, and I tried associating it with a prebuilt (downloaded and installed via the Epic/UE4 launch utility) 4.11 engine - all with the same result (the “selection_16x.png” file does not exist in either).

When I launch the editor alone (not via the .uproject file) it launches without error. I can start and build a new, blank c++ project without error, and I can launch the editor from that .uproject without error.

If I open my project from within the already launched editor, it crashes.

Do I need this image file? Can I replace it with something similar (guessing it’s 16x16)? Is this a legacy bug from renamed slate content?
Am I missing another (un)related error that’s actually causing the crash? Did I only notice this missing file in my log because it isn’t actually a problem?

I’ve been fighting this for three days now and I’m getting to my wits end.

Any ideas?

Help!

That warning is unrelated to your crash.

Here’s your callstack:

UE4Editor-Engine.dll!UWorld::GetAuthGameMode() [d:\program files\epic games\unrealengine-4.11.2\engine\source\runtime\engine\classes\engine\world.h:2922]
UE4Editor-MyGame001.dll
UE4Editor-MyGame001.dll
UE4Editor-MyGame001.dll
UE4Editor-CoreUObject.dll!UClass::CreateDefaultObject() [d:\program files\epic games\unrealengine-4.11.2\engine\source\runtime\coreuobject\private\uobject\class.cpp:2763]
UE4Editor-CoreUObject.dll!UObjectLoadAllCompiledInDefaultProperties() [d:\program files\epic games\unrealengine-4.11.2\engine\source\runtime\coreuobject\private\uobject\uobjectbase.cpp:724]
UE4Editor-CoreUObject.dll!ProcessNewlyLoadedUObjects() [d:\program files\epic games\unrealengine-4.11.2\engine\source\runtime\coreuobject\private\uobject\uobjectbase.cpp:818]
UE4Editor-CoreUObject.dll!TBaseStaticDelegateInstance<void __cdecl(void)>::ExecuteIfSafe() [d:\program files\epic games\unrealengine-4.11.2\engine\source\runtime\core\public\delegates\delegateinstancesimpl_variadics.inl:1021]
UE4Editor-Core.dll!TBaseMulticastDelegate<void>::Broadcast() [d:\program files\epic games\unrealengine-4.11.2\engine\source\runtime\core\public\delegates\delegatesignatureimpl_variadics.inl:921]
UE4Editor-Core.dll!FModuleManager::LoadModuleWithFailureReason() [d:\program files\epic games\unrealengine-4.11.2\engine\source\runtime\core\private\modules\modulemanager.cpp:427]
UE4Editor-Projects.dll!FModuleDescriptor::LoadModulesForPhase() [d:\program files\epic games\unrealengine-4.11.2\engine\source\runtime\projects\private\moduledescriptor.cpp:398]
UE4Editor-Projects.dll!FProjectManager::LoadModulesForProject() [d:\program files\epic games\unrealengine-4.11.2\engine\source\runtime\projects\private\projectmanager.cpp:53]
UE4Editor.exe!FEngineLoop::LoadStartupModules() [d:\program files\epic games\unrealengine-4.11.2\engine\source\runtime\launch\private\launchengineloop.cpp:2080]
UE4Editor.exe!FEngineLoop::PreInit() [d:\program files\epic games\unrealengine-4.11.2\engine\source\runtime\launch\private\launchengineloop.cpp:1544]
UE4Editor.exe!GuardedMain() [d:\program files\epic games\unrealengine-4.11.2\engine\source\runtime\launch\private\launch.cpp:110]
UE4Editor.exe!GuardedMainWrapper() [d:\program files\epic games\unrealengine-4.11.2\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
UE4Editor.exe!WinMain() [d:\program files\epic games\unrealengine-4.11.2\engine\source\runtime\launch\private\windows\launchwindows.cpp:200]

So it looks like a CDO is causing a crash. Given the memory address in the error I’m guessing it’s a null pointer access.

  • Do you have any code in your game calling UWorld::GetAuthGameMode?
  • Are you able to run with a debugger attached so you can examine the callstack and see what the last call in your game prior to entering Engine code is?
  • Have you tried deleting your Intermediate/Build folder, re-generating projects, and then building your game?

Thanks for getting back to me. I didn’t think that missing file would be it, but I’m open to being very, very wrong.

I have tried deleting the Intermediate and Build folders, regenerating, and rebuilding, but that hasn’t fixed it.

I’ll set up the debugger, double-check instances of GetAuthGameMode (I can think of a couple of the top of my head) and post more data.

Thanks again.

Quick update:

There was one instance of UWorld::GetAuthGameMode active; but it’s rather old code that has run without problem for some time. Instances in other portions of the code had already been replaced with UGameplayStatics::GetGameMode - so I went ahead and replaced this one with a GetGameMode call as well.

After rebuilding and attempting launch I had the same crash, but at 72% initialization (instead of 71%) - so I think the GetAuthGameMode itself is unrelated.

In each case that I load the active Game Mode, after receiving the generic game mode from UGameplayStatics it’s cast the to my custom game mode, and the variable is tested for positive value before attempting to use it anywhere; so I don’t think that’s where I’m getting a nullptr; but I am parsing through the code to see what might have been modified before and after this call, or if the implementation is being called by another object without verifying the result.

Ruling one more piece out is progress, right? Still open to being wrong though!

I’ll come back with debug data.

Found it, fixed it and successfully launched the editor!

The problem ended up having nothing to do with GetAuthGameMode and wasn’t a CDO error, but the suggestion to look at GetAuthGameMode is what led me to find the problem.

I also got to learn about DebugGame Editor mode, which is very different from Debug Editor mode.

For the sake of anyone interested or experiencing a similar problem who happens to run across this, I’m including a detailed explanation below.

Thank you!

The problem was in my use of a TMap to store gameplay update times. The GetAuthGameMode call (the only one remaining in my code base that hadn’t been replaced by GetGameMode!) was in the game’s custom character class. After the character is loaded into the level it performs some initialization actions and, when finished, informs the active GameMode it is ready to play. When the GameMode recieves the update from the character it triggers some final actions before beginning actual gameplay (removes loading screen, plays quick animation etc.). At this point it also logs a time duration within a TMap.

Here’s where my problem happened: if a duration for the current level already exists, it pulls the existing duration and adds the current duration to the existing value and stores the new total; if the duration doesn’t exist for the current level, it stores the current duration to the TMap under a new label.

    //fixed and correct code
    if (Durations.Contains(DurationLabel)) {
        CurrentTimespan += *Durations.Find(DurationLabel);
    
    }
    Durations.Emplace(DurationLabel, CurrentTimespan);

There was a typo in the code, though. Rather than adding a new label if the level duration didn’t exist within the TMap, the code tried to pull the value and add it to the current duration. When you pull a value from a TMap with Find() you don’t get the actual value, you get a pointer to the value, but I was ensuring the label didn’t exist before I called it! Thus, I got a null pointer and caused my crash every time the game tried to load the first level.

    //the conditional should run if Contains() returns TRUE
    //but here it's set to run if it returns FALSE. OOPS!
    if (!Durations.Contains(DurationLabel)) {
        CurrentTimespan += *Durations.Find(DurationLabel);
    
    }
    Durations.Emplace(DurationLabel, CurrentTimespan);

I lost three days to an errant exclamation point!

Originally, the code here was set up as an if->else, with the FALSE condition first. When the code was restructured to its current form the conditional wasn’t modified, resulting in the logical error.

    //the original code before restructured/streamlined;
    //this code is logically correct, as is the fixed code above
    if (!Durations.Contains(DurationLabel)) {
        Durations.Add(DurationLabel, CurrentTimespan);
    
    } else {
        CurrentTimespan += *Durations.Find(DurationLabel);
        Durations.Emplace(DurationLabel, CurrentTimespan);
    
    }

As a side note, avoiding problems like this is probably one of the best parts of Blueprints. Thanks, Epic, for the platform and all the support.

Special thanks to Jamie Dale for seeing what I missed, getting me pointed in the right direction, and presenting alternatives to jumping out a window.