User reported encountering a deadlock between GameThread and AsyncLoadingThread and provided two callstacks.
I've been running into a deadlock intermittently with a custom blueprint console command that causes a freeze.
The command involves spawning objects and getting data from TSoftObjectPtrs to some DataAssets. This involves a LoadSynchronous() on the TSoftObjectPtr.
The deadlock seems to occur from the GameThread acquiring the lock for FUObjectArray->ObjObjectsCritical, and then getting to FAsyncLoadingThread::FlushLoading(int) where it begins to wait. Meanwhile, the FAsyncLoadingThread attempts to lock ObjObjectsCritical with FUObjectArray::LockInternalArray, therefore getting stuck where FAsyncLoadingThread is waiting to lock ObjObjectsCritical while the GameThread is waiting for FAsyncLoadingThread to finish.
==============
GameThread:
FAsyncLoadingThread::FlushLoading(int) AsyncLoading.cpp:7502
FlushAsyncLoading(int) AsyncPackageLoader.cpp:280
LoadPackageInternal(UPackage *,const FPackagePath &,unsigned int,FLinkerLoad *,FArchive *,const FLinkerInstancingContext *,const FPackagePath *) UObjectGlobals.cpp:1508
[Inlined] LoadPackage(UPackage *,const FPackagePath &,unsigned int,FArchive *,const FLinkerInstancingContext *,const FPackagePath *) UObjectGlobals.cpp:1855
LoadPackage(UPackage *,const wchar_t *,unsigned int,FArchive *,const FLinkerInstancingContext *) UObjectGlobals.cpp:1836
ResolveName(UObject *&,FString &,bool,bool,unsigned int,const FLinkerInstancingContext *) UObjectGlobals.cpp:1111
StaticLoadObjectInternal(UClass *,UObject *,const wchar_t *,const wchar_t *,unsigned int,UPackageMap *,bool,const FLinkerInstancingContext *) UObjectGlobals.cpp:1194
StaticLoadObject(UClass *,UObject *,const wchar_t *,const wchar_t *,unsigned int,UPackageMap *,bool,const FLinkerInstancingContext *) UObjectGlobals.cpp:1273
FSoftObjectPath::TryLoad(FUObjectSerializeContext *) SoftObjectPath.cpp:536
FSoftObjectPtr::LoadSynchronous() SoftObjectPtr.h:54
[Inlined] TSoftObjectPtr<USomeDataAsset>::LoadSynchronous() SoftObjectPtr.h:308
=========
AsyncLoadingThread:
[Inlined] Windows::EnterCriticalSection(Windows::CRITICAL_SECTION *) MinimalWindowsApi.h:229
[Inlined] FWindowsCriticalSection::Lock() WindowsCriticalSection.h:44
[Inlined] FUObjectArray::LockInternalArray() UObjectArray.h:939
FUObjectArray::AllocateUObjectIndex(UObjectBase *,bool) UObjectArray.cpp:197
UObjectBase::AddObject(FName,EInternalObjectFlags) UObjectBase.cpp:212
[Inlined] UObjectBase::
(UClass *,EObjectFlags,EInternalObjectFlags,UObject *,FName) UObjectBase.cpp:129
StaticAllocateObject(const UClass *,UObject *,FName,EObjectFlags,EInternalObjectFlags,bool,bool *,UPackage *) UObjectGlobals.cpp:3305
StaticConstructObject_Internal(const FStaticConstructObjectParameters &) UObjectGlobals.cpp:4199
[Inlined] NewObject(UObject *,FName,EObjectFlags,UObject *,bool,FObjectInstancingGraph *) UObjectGlobals.h:1656
CreatePackage(const wchar_t *) UObjectGlobals.cpp:957
FAsyncPackage::CreateLinker() AsyncLoading.cpp:6137
FAsyncPackage::Event_CreateLinker() AsyncLoading.cpp:1835
<lambda_1acefc6c20c91e5667d506c40e7d1de2>::operator()(FAsyncLoadEventArgs &) AsyncLoading.cpp:1805
[Inlined] UE::Core::Private::Function::TFunctionRefBase<UE::Core::Private::Function::TFunctionStorage<0>,void __cdecl(FAsyncLoadEventArgs &)>::operator()(FAsyncLoadEventArgs &) Function.h:602
[Inlined] FAsyncLoadEventQueue::PopAndExecute(FAsyncLoadEventArgs &) AsyncLoadingThread.h:107
FAsyncLoadingThread::ProcessAsyncLoading(int &,bool,bool,float,FFlushRequest &) AsyncLoading.cpp:4393
FAsyncLoadingThread::TickAsyncThread(bool,bool,float,bool &,FFlushRequest &) AsyncLoading.cpp:5297
FAsyncLoadingThread::Run() AsyncLoading.cpp:5222
FRunnableThreadWin::Run() WindowsRunnableThread.cpp:146
FRunnableThreadWin::GuardedRun() WindowsRunnableThread.cpp:79
I am not able to find world outliner how to enable it?
How can i modify the param name in EQS node
How to achieve HLSL Multiple Render Target in Material blueprints?
What method is used to fill polygonal regions when drawing spline mesh at run time?
Undefined sysmbol: typeinfo for AActor when cross-compile linux dedicated server on windows
Teleporter in the Creative Hub is Locked and cannot be accessed
Why does the REMOVE method of map container remove elements have memory leaks?
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-177022 in the post.
0 |
Component | UE - Foundation - Core - UObject |
---|---|
Affects Versions | 5.1 |
Target Fix | 5.3 |
Created | Feb 14, 2023 |
---|---|
Resolved | May 8, 2023 |
Updated | Aug 9, 2023 |