# Deadlock after updating to UE 5.6 

**URL:** <https://forums.unrealengine.com/t/deadlock-after-updating-to-ue-5-6/2673154>\
**Category:** Platform & Builds\
**Tags:** unreal-engine, Epic-Pro-Support, question\
**Created:** [October 1, 2025, 8:18am UTC](https://forums.unrealengine.com/t/deadlock-after-updating-to-ue-5-6/2673154 "2025-10-01T08:18:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [October 1, 2025, 8:18am UTC](https://forums.unrealengine.com/t/deadlock-after-updating-to-ue-5-6/2673154/1 "2025-10-01T08:18:52Z")

</div>

The DeadLock came with the new UE 5.6.1 update and the reason are the UE changes in UObject\* StaticAllocateObject(…) function, there are three new input arguments

`int32 SerialNumber, FRemoteObjectId RemoteId, FGCReconstructionGuard* GCGuard` of which for interest for us is **FGCReconstructionGuard\* GCGuard**. The big change is on Line 3732 UObjectGlobals.cpp

```auto
if (ensureMsgf(IsInGameThread(), TEXT("GC lock can only be acquired on the game thread. If you hit this ensure then an object is being reconstructed on a worker thread which is not thread-safe")) && GCGuard)
{
	GCGuard->Lock();
}

```

This will lock **GCGuard** and might block all threads waiting on GCGuard, including RenderThread.

Before final destruction the UObject must released all resources, rendering resources are released on RenderThread.

**GameThread** wants to be sure that all resources are released before the final destruction of the object and for that reason it sets a Rendering Fence. Fence is just a very simple task which should run on RenderThread and will be executed after all object resources are released.

In this case before releasing resources RenderThread executes render tasks which are using textures, to access these textures Renderer/RenderTask has to **Pin** texture WeakPtr. When WeakPtr is Pinned it calls

```auto
TStrongObjectPtr<UObject> FWeakObjectPtr::Internal_Pin(bool bEvenIfGarbage) const
{
	FGCScopeGuard GCScopeGuard;
	FUObjectItem* const ObjectItem = Internal_GetObjectItem();
	return TStrongObjectPtr<UObject>(((ObjectItem != nullptr) && GUObjectArray.IsValid(ObjectItem, bEvenIfGarbage)) ? (UObject*)ObjectItem->GetObject() : nullptr);
}

```

The `FGCScopeGuard` constructor will call `FGCCSyncObject::Get().LockAsync();` which will stay in infinite waiting because FGCCSyncObject waits to be signaled from the GameThread, this waiting is blocking the task execution on the RenderThread. As result our Fence set from the GameThread will never be executed and with that GamThread will stay in infinite **While** loop

```auto
while (!Obj->IsReadyForFinishDestroy()) 
{
				// If we're not in the editor, and aren't doing something specifically destructive like reconstructing blueprints, this is fatal
				if (!bPrinted && !GIsEditor && FApp::IsGame() && !GIsReconstructingBlueprintInstances)
				{
					StallStart = FPlatformTime::Seconds();
					bPrinted = true;
				}
				FPlatformProcess::Sleep(0);
}

```

`Obj-&gt;IsReadyForFinishDestroy()` will never return **True** because the render fence task will never be executed on RenderThread

---

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [October 1, 2025, 8:18am UTC](https://forums.unrealengine.com/t/deadlock-after-updating-to-ue-5-6/2673154/2 "2025-10-01T08:18:56Z")

</div>

**Steps to Reproduce**  
Each time running the game in PIE

---

<div class="post-metadata">

**Author:** ![UE\_Seb.Tho](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ue_seb.tho/32/1104173_2.png) [@UE\_Seb.Tho](https://forums.unrealengine.com/u/UE_Seb.Tho)\
**Post date:** [October 8, 2025, 1:39pm UTC](https://forums.unrealengine.com/t/deadlock-after-updating-to-ue-5-6/2673154/3 "2025-10-08T13:39:10Z")

</div>

Hi,

apologies for the long wait, I’ve been swamped a bit and only just got to catch up.

In this case the wait might have been useful, since a colleague just submitted a change to that logic today, specifically restricting _StaticAllocateObject()_ to only lock _GCGuard_ in async loading scenarios.

I think this should also work for you, since in your case you’re spawning a BP actor by duplicating a template and no loading is involved.

The change should be available on Github soon as [3b35031d](https://github.com/EpicGames/UnrealEngine/commit/3b35031d5a082ccff1cfc1bf615b7e8a480cc58c). Right now it looks like it hasn’t been synced from our repo yet, but the change itself is trivial, just introducing an additional if around the lock:

```auto
// Take the GC lock if the object is still being async loaded to avoid any race condition, otherwise we don't care about the lock
if (Obj->HasAnyInternalFlags(EInternalObjectFlags_AsyncLoading))
{
	GCGuard->Lock();
}

```

Could you try this out and let us know if it solves the deadlock for you?

Thank you!

Best,

Sebastian

---

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [October 10, 2025, 7:02am UTC](https://forums.unrealengine.com/t/deadlock-after-updating-to-ue-5-6/2673154/4 "2025-10-10T07:02:39Z")

</div>

Hi [mention removed]​

Thanks for looking into this and for the offered solution.

I integrated that into our code base, seems like it works fine and solved the problem.

Regards

/Todor

---

<div class="post-metadata">

**Author:** ![UE\_Seb.Tho](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ue_seb.tho/32/1104173_2.png) [@UE\_Seb.Tho](https://forums.unrealengine.com/u/UE_Seb.Tho)\
**Post date:** [October 10, 2025, 1:46pm UTC](https://forums.unrealengine.com/t/deadlock-after-updating-to-ue-5-6/2673154/5 "2025-10-10T13:46:29Z")

</div>

Perfect, thanks for letting us know!

This submit just missed the 5.7 cutoff, so it will likely only be released with 5.8, so you might have to stick with the local fix for a bit.

Best,

Sebastian
