PCG crash when resolving Soft Reference path during Garbage Collection

Hi,

We’re having a low repro crash in UPCGLandscapeData::InitializeTargetMetadata(…) and FPCGGraphTask::LoadCookedData(…) when trying to resolve a TSoftObjectPtr path during Garbage Collection.

I noticed the issue in FPCGGraphTask::LoadCookedData(…) was already fixed in CL# 48392753, but the one in UPCGLandscapeData::InitializeTargetMetadata(…) hasn’t.

On our end we had to add a FGCScopeGuard, something like:

      // use a GC scope, otherwise we can have a crash later in Landscape.Get()
      FGCScopeGuard Guard;
 
      for (TSoftObjectPtr<ALandscapeProxy> Landscape : Landscapes)
      {
        const TArray<FName> Layers = LandscapeCache->GetLayerNames(Landscape.Get());
 
        for (const FName& Layer : Layers)
        {
          MetadataDomain->FindOrCreateAttribute<float>(Layer, 0.0f, /*bAllowInterpolation=*/true);
        }
      }

Have you seen this problem on your end ?

Thanks in advance,

Alvaro

Hi Alvaro,

Sorry for the late reply, this one flew under my radar.

We haven’t seen this one but if that code is running out of the gamethread then you are correct that it is an issue.

I’m going to look into it further and will try and fit this in a 5.7 hotfix release

Cheers,

Patrick