Garbage Collection Fatal Error, on AsyncLoad during ServerTravel

I am looking for help tracing down a bug that only seems to be occurring in our modified project and not in ShooterGame.

During ServerTravel (seamless) we are running into an inconsistent crash (maybe 5%):

Going up the chain, the assets it is crashing on seem to be random. Including Standard Assets that do not have cyclic references. Some assets do which is suspicious but I am not seeing any kind of pattern in regards to the kind of assets other than they are blueprints.

!UStructProperty::ContainsObjectReference() [\engine\source\runtime\coreuobject\private\uobject\garbagecollection.cpp:1472]
!UArrayProperty::EmitReferenceInfo() [\engine\source\runtime\coreuobject\private\uobject\garbagecollection.cpp:1642]
!UStructProperty::EmitReferenceInfo() [\engine\source\runtime\coreuobject\private\uobject\garbagecollection.cpp:1733]
!UStructProperty::EmitReferenceInfo() [\engine\source\runtime\coreuobject\private\uobject\garbagecollection.cpp:1733]
!UClass::AssembleReferenceTokenStream() [\engine\source\runtime\coreuobject\private\uobject\garbagecollection.cpp:1819]
!UBlueprintGeneratedClass::PostLoad() [\engine\source\runtime\engine\private\blueprintgeneratedclass.cpp:114]
!UObject::ConditionalPostLoad() [\engine\source\runtime\coreuobject\private\uobject\obj.cpp:812]
!FAsyncPackage::PostLoadDeferredObjects() [\engine\source\runtime\coreuobject\private\serialization\asyncloading.cpp:2260]
!FAsyncLoadingThread::ProcessLoadedPackages() [\engine\source\runtime\coreuobject\private\serialization\asyncloading.cpp:807]
!FAsyncLoadingThread::TickAsyncLoading() [\engine\source\runtime\coreuobject\private\serialization\asyncloading.cpp:892]
!ProcessAsyncLoading() [\engine\source\runtime\coreuobject\private\serialization\asyncloading.cpp:2688]
!StaticTick() [\engine\source\runtime\coreuobject\private\uobject\uobjectglobals.cpp:428]
!UGameEngine::Tick() [\engine\source\runtime\engine\private\gameengine.cpp:1004]
!FEngineLoop::Tick() [\engine\source\runtime\launch\private\launchengineloop.cpp:2834]
!GuardedMain() [\engine\source\runtime\launch\private\launch.cpp:156]
!GuardedMainWrapper() [\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
!WinMain() [\engine\source\runtime\launch\private\windows\launchwindows.cpp:202]
!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:253]
kernel32
ntdll

Also crashed in “Preload” the crash above was in “Postload”. This test was in a packaged build. I have seen the crash in development and debug as well.

Access violation - code c0000005 (first/second chance not available)

Win64_Shipping!UStructProperty::ContainsObjectReference() [\engine\source\runtime\coreuobject\private\uobject\garbagecollection.cpp:1484]
Win64_Shipping!UStruct::Link() [\engine\source\runtime\coreuobject\private\uobject\class.cpp:687]
Win64_Shipping!UFunction::Link() [\engine\source\runtime\coreuobject\private\uobject\class.cpp:4377]
Win64_Shipping!UStruct::Serialize() [\engine\source\runtime\coreuobject\private\uobject\class.cpp:1295]
Win64_Shipping!UFunction::Serialize() [\engine\source\runtime\coreuobject\private\uobject\class.cpp:4295]
Win64_Shipping!FLinkerLoad::Preload() [\engine\source\runtime\coreuobject\private\uobject\linkerload.cpp:3410]
Win64_Shipping!FAsyncPackage::CreateExports() [\engine\source\runtime\coreuobject\private\serialization\asyncloading.cpp:1930]
Win64_Shipping!FAsyncPackage::Tick() [\engine\source\runtime\coreuobject\private\serialization\asyncloading.cpp:1399]
Win64_Shipping!FAsyncLoadingThread::ProcessAsyncLoading() [\engine\source\runtime\coreuobject\private\serialization\asyncloading.cpp:722]
Win64_Shipping!FAsyncLoadingThread::Run() [\engine\source\runtime\coreuobject\private\serialization\asyncloading.cpp:975]
Win64_Shipping!FRunnableThreadWin::Run() [\engine\source\runtime\core\private\windows\windowsrunnablethread.cpp:74]

https://github.com/EpicGames/UnrealEngine/commit/2fb69465

← this looks like a similar issue but we are on 4.13.1 and I did also test by bringing over the memory alignment change in 4.13.2 which did fix a crash we were getting but not this one.

Hey BW6ense,

Internally, we have two crashes with the same callstack but they do not provide any link to existing bugs. Because of this, it is exceptionally difficult for me reproduce what you are seeing.

Can you provide me any reference to the code you are using or a list of steps for me to see the same issue?

Thanks.

Hi!

I was able to create a reproduction case!

I created two new levels {level1, level2} and set the gamemode on each to be seamless.

important place a blueprint asset into the level, i used standard assets Blueprint_WallSconce (and it ends up being the object it crashes on)

In the level blueprint of each, On BeginPlay, I execute the command “ServerTravel level1/2” respectively. (I added a one second delay before calling, this probably has no effect, and no logic as to why i even bothered to do it).

Package to build (I used "Development)

Launch and attach VS Debugger and let it go until it crashes.

The VS Callstack:

 	!UStructProperty::ContainsObjectReference() Line 1472	C++
 	!UStructProperty::EmitReferenceInfo(UClass & OwnerClass, int BaseOffset) Line 1725	C++
 	!UClass::AssembleReferenceTokenStream(bool bForce) Line 1819	C++
 	!UClass::Serialize(FArchive & Ar) Line 3279	C++
 	!UBlueprintGeneratedClass::Serialize(FArchive & Ar) Line 1114	C++
 	!FLinkerLoad::Preload(UObject * Object) Line 3410	C++
>	!FAsyncPackage::CreateExports() Line 1930	C++
 	!FAsyncPackage::Tick(bool InbUseTimeLimit, bool InbUseFullTimeLimit, float & InOutTimeLimit) Line 1399	C++
 	!FAsyncLoadingThread::ProcessAsyncLoading(int & OutPackagesProcessed, bool bUseTimeLimit, bool bUseFullTimeLimit, float TimeLimit) Line 722	C++
 	!FAsyncLoadingThread::Run() Line 975	C++
 	!FRunnableThreadWin::Run() Line 74	C++
 	!FRunnableThreadWin::GuardedRun() Line 31	C++
 	[External Code]

Also. I got the crash quickly the first try, and now it’s gone for many minutes without crashing. I would suggest putting as many blueprint assets in as possible to maybe increase the chances of it crashing

When you say, “place a blueprint asset into the level”, what class is the Blueprint inheriting from?

Thanks.

Ok it did crash again after 45 minutes, this time it was BP_Sky_Sphere_C.
The parent class is Actor for these blueprints. I only mention that it should be a blueprint because using StaticMeshActors didn’t seem to crash it, but it might… I mean with the inconsistency with time to reproduce I wouldn’t rule it out.

Hey BW6ense,

Just wanted to let you know that I have tested on my end (for about 45 minutes) and didn’t have any crash.

I will test overnight and let you know tomorrow what happens.

Hey again,

So I ran the test for hours and didn’t get the crash.

Can you possibly get the crash reported to execute? I think you should be able to by not attaching the process in Visual Studio and by building your project with Crash Reporter.

You can do this by going to Settings → Packaging and make sure “Include Crash Reporter” is checked.

If you can get Crash Reporter to open, can you post your Epic and/or Machine ID?

Thanks.

Yes it happened just now. Thank you for continuing to look into this!!

MachineId:91E2BBA546C25A185BF6058B17364170
EpicAccountId:a8e1e5ee7d0b488896bc092405fda426

Hey BW6ense,

Thanks for the ID’s.

Sadly, I still cannot reproduce it on my end so the only option I have left is to ask you for the project you are using so I can test with that; as the differences in what I understand as the issue and what you are seeing can vary.

You can either attach a sample project to this thread (as long as its under 5MB) or use something like Google Drive or Dropbox and post a link.

If you cannot do this, there isn’t anymore I can do on my end and the issue doesn’t happen on my end.

thanks.

Hey BW6ense,

As stated, without a repro case we will need to look at the project you’re using.

If you’d like to do this, please PM me a link to the project through the forums at this link: https://forums.unrealengine.com/member.php?160394-Sean-Flint

Otherwise, we are unable to take any further action with this issue.

Have a great day

UStructProperty::ContainsObjectReference isn’t thread safe and it is being called from both the Game Thread and the FASyncLoading thread. This causes the static EncounteredStructProps array to be accessed and modifed concurrently by multiple threads.

I have a same problem in my project with 4.13.2. How to resolve it ,thx at all