Dangling pointer on FD3D12SyncPoint::DebugName when flushing landscape layers

Our project has reproduced this lifetime bug with custom tooling that calls `ALandscape::ForceLayersFullUpdate()`. This results in a call to `FLandscapeEditLayerReadback::FlushAllReadbackTasks()` and intermittent crash on the rendering thread with the attached callstack. Using `-stompmalloc` makes reproduction consistent. Our studio has made this change to mitigate the issue: https://github.com/EpicGames/UnrealEngine/pull/14443\.

[Attachment Removed]

Steps to Reproduce
Our project has reproduced this lifetime bug with custom tooling that calls `ALandscape::ForceLayersFullUpdate()`. This results in a call to `FLandscapeEditLayerReadback::FlushAllReadbackTasks()` and intermittent crash on the rendering thread with the attached callstack. Using `-stompmalloc` makes reproduction consistent. Our studio has made this change to mitigate the issue: https://github.com/EpicGames/UnrealEngine/pull/14443\.

[Attachment Removed]

Hi Jack,

Thanks for reporting this. Your fix will work, but I think there’s an opportunity to avoid the FString construction by making a larger change where we replace the debug name TCHAR* on FD3D12SyncPoint with an FName instead. My colleague who worked on this recently is current out of office, but I’ve forwarded this to them to take a look when they’re back.

Cheers,

Luke

[Attachment Removed]

Hi Jack, In CL 51784715 in UE5 Main, I have the FD3D12SyncPoint using FName instead of raw pointer as Luke suggested.

That should cover your lifetime issue, please let me if you have more problem about this.

Thanks.,

Daniele

[Attachment Removed]

Thanks Luke! Looking forward to having an upstream fix we can integrate.

[Attachment Removed]