Transitioning from 4.20 -> 4.22: App builds but crashes on editor startup

Hi everyone-
I’m trying to upgrade our app from 4.20->4.22- the project is building, but when I try to load it up in the editor it crashes with these errors (and many more LinkerLoad errors further down stack) :

Anyone run into similar issues on upgrading and have any possible ideas for approaches to debugging/fixing?

I believe I have ran into an issue like this before. Stack overflow exception indicates execution entering an infinite loop. Seeing as it’s during package loading, my guess is that it’s caused by circular referencing between assets. Usually the engine can handle circular references, as for example blueprint classes reference each other all the time, but in our case we were using FObjectFinder in some of our C++ actor class constructors and noticed that that triggered an infinite loading loop, resulting in a stack overflow exception just like yours.

Are you using FObjectFinder in code?

Hi Zhi,

Thanks for the thoughtful response! It doesn’t look like we’re using FObjectFinder anywhere in the code… I’m starting to think it may be an issue with some materials and circular dependencies… I found this post last night Stack overflow causing packaged build to crash on startup (Windows). FClusterReferenceProcessor::AddObjectToCluster() -> FClusterReferenceProcessor::MergeCluster() - UE4 AnswerHub and did a test with a fresh project with default c++ code but all of our content, and saw exact same errors on upgrading that fresh project to 4.22…

I’m submitting version 1.3.0 for Unreal 4.21 and 4.22 with several math improvements to sound reflection, refraction and surface scattering calculations.
These improvements should add a much more realistic attenuation feel to sounds that aren’t completely occluded by obstacles.

I’m also adding a check to automatically disable Unreal’s built-in occlusion functions on SPB speakers because some users are mistakenly activating them causing two occlusion systems to run on same time (don’t do that).

Ah, it must be assets then!

I would suggest stepping through the call stack and try to find the name of the asset that is triggering the loading loop. You’re building the project from Visual Studio correct? When it crashes and you enter debug mode, try going to LoadPackageInternal() in the call stack and mouse-over InLongPackageNameOrFilename to inspect it’s value which should reveal one of the assets that causes the loop. Going to another LoadPackageInternal() in the callstack may reveal the other. Hopefully the package name value is inspectable, otherwise it may be optimized out. If you can’t inspect it, try rebuilding the editor in Debug Editor mode and try again. As a last resort, you can compile the engine from source and add PRAGMA_DISABLE_OPTIMIZATION above the LoadPackageInternal function in UObjectGlobals.cpp and PRAGMA_ENABLE_OPTIMIZATION below the function. Then rebuild, make the crash happen and you can inspect the asset names.

You can remove the default map, as well as the game mode and game instance definitions from project ini, it may help the editor a bit to figure things out easier. Basically allow it to boot to an empty new map without dependencies. While i was trying to upgrade a project from 4.20 to 4.22 i also hit very similar errors. Debugging made me believe enums defined in plugin code were related to the issue with blueprints using it. I have started disecting the project in order to avoid cross references as much as possible, and some pieces were successfully allowed the project to actually boot into editor without crash (but it was not the entire project only bits and pieces). It’s a slow and painstaking process doing it, and still ongoing in my case. I think they messed things up with the linker, since i keep seeing similar reports poping up for a while now regarding 420->422 migration.

Have you try migrate to 4.21 first?

We are having the same issue. No issues with 4.21 it’s specific to 4.22. The package loader is failing to handle circular references in Blueprint files (of any type, widgets, actors, Behavior trees, etc.) in large projects.

The following bug reports relating to this issue were backlogged because they could not reproduce it. {Edit - They have now been updated to fixed but it didn’t for us}

Same issue with 4.23 Preview 1 and Preview 2. Just to add that the circular references aren’t direct in our project (BP(1) will reference BP(2) which will reference BP(3) which has a reference to BP(1)), so there is no easy fix for this beside moving more of the code to C++.

Anyone else have ideas on what is causing this? We have a massive project that will require months to refactor all references to interfaces & events. Seems like the LinkerLoad just has some leak and eventually uses up all the memory, causing the overflow.

Thanks for any advice.

We have been dealing with this same crash since upgrading from 4.21 to 4.23. I just now tested on the 4.24 preview and it seems to be resolved for us!