Crash packaged build 4.22.2

Hello everyone, i’m packaging a newly upgraded project from 4.16.1 source to 4.22.1 source.
Upon making a build in 4.22.1 i came across a known crash, forcing me to upgrade even further to 4.22.2:

Fixed! UE-73368 Crash upon opening packaged game when Event Driven Loader is disabled

However when I’m trying to start playing a build, I see my loading screen, but before the level is loaded I still get a crash, but this time throwing the error ‘index (random number, usually 80-165) out of bound, array size 0’.

I have tried a lot of different tweaks:

  • Solutions I found to crashes in other topics
  • Start the game in an empty level
  • Went through all our blueprints/classes searching for big arrays, but found none that would ever reach a size of 165.
  • Cleaning intermediate/saved folders and rebuilding .sln project
  • Packaging DebugGame, Development, Shipping.
  • Fixing almost every warning I came across upon loading levels, playing in editor or during packaging.

An interesting note: In my “List of maps to include in a packaged build” I have 166 elements. But I can’t think of any possible issues related to this list, as all umap paths seem correct.

So far nothing seems to help, my guess is that there’s some engine/under the hood logic going on causing the issue.

Callstack:

        [2019.05.31-12.55.18:663][  0]LogInit: Display: Game Engine Initialized.
        [2019.05.31-12.55.18:672][  0]LogInit: Display: Starting Game.
        [2019.05.31-12.55.18:673][  0]LogNet: Browse: /Game/Maps/MenuLevel
        [2019.05.31-12.55.18:683][  0]LogLoad: LoadMap: /Game/Maps/MenuLevel
        [2019.05.31-12.55.56:082][  0]LogWindows: Error: === Critical error: ===
        [2019.05.31-12.55.56:082][  0]LogWindows: Error: 
        [2019.05.31-12.55.56:083][  0]LogWindows: Error: Assertion failed: (Index >= 0) & (Index < ArrayNum) [File:c:\ue422\engine\source\runtime\core\public\Containers/Array.h] [Line: 611] 
        [2019.05.31-12.55.56:083][  0]LogWindows: Error: Array index out of bounds: 165 from an array of size 0
        [2019.05.31-12.55.56:083][  0]LogWindows: Error: 
        [2019.05.31-12.55.56:083][  0]LogWindows: Error: 
        [2019.05.31-12.55.56:083][  0]LogWindows: Error: [Callstack] 0x00007ff9ca4da388 KERNELBASE.dll!UnknownFunction []
        [2019.05.31-12.55.56:083][  0]LogWindows: Error: [Callstack] 0x00007ff674716847 GameMM.exe!ReportAssert() [c:\ue422\engine\source\runtime\core\private\windows\windowsplatformcrashcontext.cpp:553]
        [2019.05.31-12.55.56:083][  0]LogWindows: Error: [Callstack] 0x00007ff674719a03 GameMM.exe!FWindowsErrorOutputDevice::Serialize() [c:\ue422\engine\source\runtime\core\private\windows\windowserroroutputdevice.cpp:79]
        [2019.05.31-12.55.56:083][  0]LogWindows: Error: [Callstack] 0x00007ff67454ab9a GameMM.exe!FOutputDevice::LogfImpl() [c:\ue422\engine\source\runtime\core\private\misc\outputdevice.cpp:71]
        [2019.05.31-12.55.56:083][  0]LogWindows: Error: [Callstack] 0x00007ff6744d8c39 GameMM.exe!FDebug::AssertFailed() [c:\ue422\engine\source\runtime\core\private\misc\assertionmacros.cpp:440]
        [2019.05.31-12.55.56:083][  0]LogWindows: Error: [Callstack] 0x00007ff6744d9469 GameMM.exe!FDebug::CheckVerifyFailedImpl() [c:\ue422\engine\source\runtime\core\private\misc\assertionmacros.cpp:418]
        [2019.05.31-12.55.56:083][  0]LogWindows: Error: [Callstack] 0x00007ff677facf38 GameMM.exe!DispatchCheckVerify<void,<lambda_023adc04eb97b0d12b89425341d4205f> >() [c:\ue422\engine\source\runtime\core\public\misc\assertionmacros.h:162]
        [2019.05.31-12.55.56:083][  0]LogWindows: Error: [Callstack] 0x00007ff6749da810 GameMM.exe!UObject::SetLinker() [c:\ue422\engine\source\runtime\coreuobject\private\uobject\uobjectlinker.cpp:106]
        [2019.05.31-12.55.56:083][  0]LogWindows: Error: [Callstack] 0x00007ff67492b376 GameMM.exe!UObject::BeginDestroy() [c:\ue422\engine\source\runtime\coreuobject\private\uobject\obj.cpp:783]
        [2019.05.31-12.55.56:083][  0]LogWindows: Error: [Callstack] 0x00007ff67492d6de GameMM.exe!UObject::ConditionalBeginDestroy() [c:\ue422\engine\source\runtime\coreuobject\private\uobject\obj.cpp:975]
        [2019.05.31-12.55.56:083][  0]LogWindows: Error: [Callstack] 0x00007ff674909579 GameMM.exe!UnhashUnreachableObjects() [c:\ue422\engine\source\runtime\coreuobject\private\uobject\garbagecollection.cpp:1638]
        [2019.05.31-12.55.56:083][  0]LogWindows: Error: [Callstack] 0x00007ff6748c0610 GameMM.exe!CollectGarbageInternal() [c:\ue422\engine\source\runtime\coreuobject\private\uobject\garbagecollection.cpp:1578]
        [2019.05.31-12.55.56:083][  0]LogWindows: Error: [Callstack] 0x00007ff6748bfcbe GameMM.exe!CollectGarbage() [c:\ue422\engine\source\runtime\coreuobject\private\uobject\garbagecollection.cpp:1666]
        [2019.05.31-12.55.56:083][  0]LogWindows: Error: [Callstack] 0x00007ff676e33ce8 GameMM.exe!UEngine::TrimMemory() [c:\ue422\engine\source\runtime\engine\private\unrealengine.cpp:12460]
        [2019.05.31-12.55.56:083][  0]LogWindows: Error: [Callstack] 0x00007ff676dfecfb GameMM.exe!UEngine::LoadMap() [c:\ue422\engine\source\runtime\engine\private\unrealengine.cpp:12096]
        [2019.05.31-12.55.56:083][  0]LogWindows: Error: [Callstack] 0x00007ff676dad807 GameMM.exe!UEngine::Browse() [c:\ue422\engine\source\runtime\engine\private\unrealengine.cpp:11643]
        [2019.05.31-12.55.56:084][  0]LogWindows: Error: [Callstack] 0x00007ff676669d7a GameMM.exe!UGameInstance::StartGameInstance() [c:\ue422\engine\source\runtime\engine\private\gameinstance.cpp:503]
        [2019.05.31-12.55.56:084][  0]LogWindows: Error: [Callstack] 0x00007ff673daa179 GameMM.exe!FEngineLoop::Init() [c:\ue422\engine\source\runtime\launch\private\launchengineloop.cpp:3306]
        [2019.05.31-12.55.56:084][  0]LogWindows: Error: [Callstack] 0x00007ff673dbb67e GameMM.exe!GuardedMain() [c:\ue422\engine\source\runtime\launch\private\launch.cpp:157]
        [2019.05.31-12.55.56:084][  0]LogWindows: Error: [Callstack] 0x00007ff673dbb7fa GameMM.exe!GuardedMainWrapper() [c:\ue422\engine\source\runtime\launch\private\windows\launchwindows.cpp:145]
        [2019.05.31-12.55.56:084][  0]LogWindows: Error: [Callstack] 0x00007ff673dc9ab3 GameMM.exe!WinMain() [c:\ue422\engine\source\runtime\launch\private\windows\launchwindows.cpp:275]
        [2019.05.31-12.55.56:084][  0]LogWindows: Error: [Callstack] 0x00007ff677e6bc92 GameMM.exe!__scrt_common_main_seh() [d:\agent\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
        [2019.05.31-12.55.56:084][  0]LogWindows: Error: [Callstack] 0x00007ff9cd894034 KERNEL32.DLL!UnknownFunction []
        [2019.05.31-12.55.56:084][  0]LogWindows: Error: [Callstack] 0x00007ff9cdd93691 ntdll.dll!UnknownFunction []

Was able to fix it by enabling Event Driven Loader, perhaps the issue was not fixed…

Hello Rashura!

I’m having this issue too with my project that I just upgraded to 4.22. Like, the exact same call stack and everything. The only difference is the number I see in the array is 1383 as opposed to 165, and I am only including 60 items in the “List of maps to include in a packaged build” list. Also, the brackets after the error on my end are empty, where as yours contain a path to a c++ source, so that’s a bit interesting.

I tried enabling the Event Driven Loader option, and it is allowing for the build to run, however the build is only loading a fraction of our start up assets (24 out of 519). It seems the EDL is still in an experimental phase as well and doesn’t have any real documentation behind it. Do you know of a source that better explains what setting this option actually does within the program?

The only other way I can get a build to work is to reset the Game Instance back to the Default Game Instance. The build will run, however it crashes as soon as it hits a portion of of code that requires info form our custom Game Instance, so that’s telling me that, in the very least, something is wrong with our custom Game Instance. Replacing it with a brand new BP isn’t doing the job either, so that’s also interesting to note…

Anyway, just wondering if anybody else is having this issue, or if you’ve found out why this was happening to begin with.

Unfortunately no. Did you try doing a completely clean build? (remove previous build or make sure “Full rebuild” is enabled) Does the project compile fine in VisualStudio?

Also, while packaging the game you will usually get a lot of warnings/soft errors in the log, maybe check if there are some clues in here. Could even be as silly as not setting your default game instance in the project settings or in the world settings of your levels.

Thanks for the reply. Everything compiles (no errors or warnings) and works beautifully in the Editor. I’ve tried pretty much everything short of starting a new project (it’s way too big to start over in a new project base). Rebuilding binaries, full rebuilds, new Game Instances, etc… The only thing that gets the build to work is setting the Event Driven Loader value, but then that breaks our asset loading.

One thing that was interesting to note, when I set the Event Driven Loader to true and added some logs to see what was happening, it was clear that the unreal file system wasn’t reading files correctly. If a folder actually had 8 assets in it, then the build would detect 16, but still only load 1. Though, in the editor, everything was working beautifully (found 8 and loaded 8). I checked the pak chunks and they all seem to be okay and unchanged for quite some time (it’s difficult and time consuming to confirm all 500+ assets).

So yeah… This bug is really interesting… We tried the 4.23 preview and things seem to be working just fine, so our team may just skip 4.22 and go straight to 4.23 once it’s dropped. There’s nothing critical about 4.22 for our project, and we’re tired of banging our heads against the wall.

Thanks again for the feedback.

There are a few things I noticed lately, one is that circular dependencies can still cause issues (class A references class B and vice versa) and the second is that if blueprints/assets have names or variables that are shared by the engine, it also may cause crashes/ blueprint compile errors. Also folders with a console postfix like _xboxone will get filtered out in a pc packaged build. Not sure if it will help you, but came to mind. Really read you compile/crash logs, most of the time i was able to track down the issue because of a warning gave me some hints.