4.11.0 / 4.11.1 UObjectArray crashes game reproducible

Hey guys,

first things first: in our last used version 4.9.1 the following problems never happened.

We have updated the engine directly to 4.11.0, where the problems started (the 4.11.1 hot fix didn’t help neither):

We cannot compile our BP_PlayerController anymore

This is an error that is related to the second…

  1. It’s a huge blueprint so far and it took about 20-30 seconds in 4.9.1, but it was built every single time, no matter what. Now in 4.11.0 (and 4.11.1), if we make changes in the blueprint, our work-around is to save the Blueprint and restart the engine. The compiler worker will then safely recompile it during the engine load phase.
  2. If I wait long enough for the in-engine-compiler (about 20 mins), the engine will crash with the message 2, described under the next headline in this post and has eaten up ~16 GB of my RAM.
  3. I also tried removing everything from the event graph, when the Player Controller started to compile again in engine with errors obviously, but it compiles. Unfortunately, I couldn’t figure out which particular node was causing it to compile again.

The UnrealFrontend-built game crashes on startup

Side node: What we changed to build with UnrealFrontend properly, was simply changing MediaPlayerEditor’s plugin type to “Developer”. In 4.9.1 the UnrealFrontend could build it with type “Editor”, but 4.11.0 (nor 4.11.1) did not. But I think that’s not the true reason for the problems here.

  1. The game executable in Saved\StagedBuilds\WindowsNoEditor will crash directly with the message:

    LowLevelFatalError [File:C:\Tools\Unreal Engine\4.9-gametology\Engine\Source\Runtime\CoreUObject\Private\UObject\UObjectArray.cpp] [Line: 175]
    Unexpected concurency while adding new object

  2. The game executable in Binaries\Win64 will crash with a different message:

    Assertion failed: NumElements + 1 <= MaxElements [File:c:\tools\unreal engine\4.9-gametology\engine\source\runtime\coreuobject\public\uobject\UObjectArray.h] [Line: 204]
    Maximum number of UObjects (0) exceeded, make sure you update MaxObjectsInGame/MaxObjectsInEditor in project settings.

In DefaultEngine.ini I found these parameters accordingly:

[/Script/Engine.GarbageCollectionSettings]
gc.CreateGCClusters=False
gc.MaxObjectsInGame=0
gc.MaxObjectsInGame=0
gc.MergeGCClusters=False
gc.MergeGCClusters=False
gc.MaxObjectsInEditor=16777216

Nevertheless what values I change or high I set the MaxObjectsInGame, it will crash reproducible. Well, with a higher MaxObjectsInGame it needs its time, but it will crash. The strange thing is, if I drastically lower MaxObjectsInEditor to, say 1,024 to ~20,000, even the project will crash from visual studio with this error if I start it, nor the UnrealFrontend will be able to build the game at all.

Conclusion

My guess is, that the garbage collector update in 4.11.0 broke things heavily for us (and maybe other developers). Referring to UObjectArray.h:204 (int32 AddSingle()), somehow the UObjects get counted up pretty fast, but will never be cleaned up at startup.

I hope you can clarfiy or solve the problem fast.


If it may help, computer specs:

  • Win 10 Pro 64-bit
  • Intel i7-5820K at 3.30GHz (12 CPUs)
  • 32 GB RAM