Crash in GatherLateUpdatePrimitives on Networked Game

Hi,

I’ve recently come across an error concerning the FLateUpdateManager in UE 4.18.
In my game, I implemented the functionality to switch between a “normal” flying spectator and a VR pawn.
The pawn is switched on the server and then replicated to the client.
When I launch a game and connect with a second spectating player it all works fine.
The problem occurs when I switch to the VR pawn on the 2nd player.
The game of the 2nd player crahes in:

FLateUpdateManager::GatherLateUpdatePrimitives(USceneComponent* ParentComponent)

Line 75: check(Component != nullptr);

I have debugged into the code and the call to

ParentComponent->GetChildrenComponents(true, Components);

returns an array of all the child components, but it is filled with some nullptr values.
I believe this is due to the fact that the pawn gets created on the server and is then replicated to the client, but maybe not “fast” enough so that some components have a placeholder value (nullptr).

To work around the problem i set

bDisableLowLatencyUpdate = true;
on the UMotionControllerComponent.
But, for the camera there is no such command.
All I can think of is to override the
UCameraComponent::GetCameraView(float DeltaTime, FMinimalViewInfo& DesiredView)
method and to remove the call to the
XRCamera->SetupLateUpdate(ParentWorld, this);
which calls
voids FLateUpdateManager::Setup(const FTransform& ParentToWorld, USceneComponent* Component)

void FLateUpdateManager::GatherLateUpdatePrimitives(USceneComponent* ParentComponent)

check(Component != nullptr); → Crash

This seems to me like an awful and hacky workaround.

Is there some better way to assure that these calls don’t occur or only get called if the components are properly initialized?
Or wouldn’t it be better to assure that the method “void USceneComponent::GetChildrenComponents(bool bIncludeAllDescendants, TArray& Children)” does not contain any nullptr values or ignore any nullptr components in “FLateUpdateManager::GatherLateUpdatePrimitives”?

Thank you for your help!
Best regards,
ZABBA

Hey ZABBA,

I’m looking into this and I’ll get back to you once I have more information.

After further investigation, it appears that this has been fixed internally, and the fix will be available in a later version.

For now, you can make the fix yourself if you’re using source by changing the

check(Component != nullptr); --> Crash

in LateUpdateManager.cpp to a conditional:

if (Component != nullptr)
	{
		CacheSceneInfo(Component);
	}

This should resolve the issue.

Have a great day

Hey Sean,

thank you for the good and quick news.
Do you know, when this fix will be available in the released version of UE4?

A great day to you, too!

It’s likely that it’ll be available in 4.19, but if you still run into this after 4.19 releases, please feel free to reopen this thread.

Please update 4.18.3 quickly. This bug is too serious

Please update 4.18.3 quickly. This bug is too serious

Hey all,
dont know if this is related.
But we had a smal test build in 4.18.2 in a very simple vr multiplayer environment.
Worked locally, but i got the same nullptr errors as soon as the local network that was simulated over the country which added latency and bandwith limitations.

Seems like when things are not fully synchronised it just crashes… i changed the part suggested here in the lateupdatemanager. Will report if this has resolved our problems.

I was having the same issue when I was simply setting my custom camera component to replicate - when I don’t set it to replicate it seems to work.

I can’t figure out why my CameraComponent would suddenly have 2 additional nullptr descendant components on the clients in the first place though… but oh well