FShadowSceneRenderer::AddDirectionalLightShadow crash

Hello folks

We have updated to 5.6.0 coming from 5.5.4.

We are experimenting a random crash because the DirectionalLights array is empty in FShadowSceneRenderer::AddDirectionalLightShadow.

We think that the crash is caused by a race condition when a CreateDynamicShadows task is executed right after removing the directional light from the shadow scene.

We haven’t found a deterministic way to reproduce the crash.

We are checking if the DirectionalLights array is empty as workaround and it seems to work but we would like to apply a proper fix.

Is there any advice you can give us to narrow the issue?

Thanks in advance for your time

Sergi

Hello,

This crash is likely the same crash we have a fix for in 5.6.1

CL#43147120 Fixed crash in ShadowSceneRenderer caused by a race with the task updating the ShadowScene.

I’ve flagged the issue so it should be visible publicly soon here Unreal Engine Issues and Bug Tracker (UE\-294069)

Thanks [mention removed]​ for the quick response.

I will integrate it asap.