Description

This is caused by the loss of data in the ULScapeHeightfieldCollisionComponent::CollisionHeightData.
The CollisionHeightData is not marked as BULKDATA_PayloadInSeperateFile and is processed with a kind of lazy loading. (The data is temporary stored in AttachedAr pointer)
However, if GC runs between deserialization and actual use, AttachedAr will be lost with deletion of UPackage(LinkerLoad).

The following workaround can solve the error by loading data into CollisionHeightData in deserialization.

void ULandscapeHeightfieldCollisionComponent::Serialize(FArchive& Ar)
{
...
#if WITH_EDITORONLY_DATA
			// For PIE, we won't need the source height data if we already have a shared reference to the heightfield
			if (!(Ar.GetPortFlags() & PPF_DuplicateForPIE) || !HeightfieldGuid.IsValid() || GSharedMeshRefs.FindRef(HeightfieldGuid) == nullptr)
			{
				CollisionHeightData.Serialize(Ar, this);
				DominantLayerData.Serialize(Ar, this);
				CollisionHeightData.Lock(LOCK_READ_ONLY);	// workaround
				CollisionHeightData.Unlock();	// workaround


				if (Ar.CustomVer(FFortniteMainBranchObjectVersion::GUID) >= FFortniteMainBranchObjectVersion::LandscapePhysicalMaterialRenderData)
				{
					PhysicalMaterialRenderData.Serialize(Ar, this);
				}
			}
#endif//WITH_EDITORONLY_DATA
		}
	}
}

 

 

Steps to Reproduce
  1. download attached project and extract [Link Removed]
  2. Add the following settings to the DefaultEditor.ini to run periodic GC. (This has already been applied to the repro project.)
    [CookSettings]
    PackagesPerGC=1
    
  3. cook the project with following command line
    [your engine path] D:\dev\ue500projects\MyProject5\MyProject5.uproject -run=Cook  -TargetPlatform=Windows -unversioned -map=8kmap
    

Result:

Crash occurs. We can see an error log before crash

LogSerialization: Error: Attempted to load bulk data without an attached archive. Most likely the bulk data was loaded twice on console, which is not supported
Callstack
UnrealEditor-Landscape.dll!ULandscapeInfo::UpdateAddCollision()
UnrealEditor-Landscape.dll!ULandscapeInfo::UpdateAllAddCollisions()
UnrealEditor-Landscape.dll!ULandscapeInfo::RegisterActor()
UnrealEditor-Landscape.dll!ALandscapeProxy::CreateLandscapeInfo()
UnrealEditor-Landscape.dll!ALandscapeProxy::PostRegisterAllComponents()
UnrealEditor-Landscape.dll!ALandscapeStreamingProxy::PostRegisterAllComponents()
UnrealEditor-Engine.dll!AActor::IncrementalRegisterComponents()
UnrealEditor-Engine.dll!ULevel::IncrementalRegisterComponents()
UnrealEditor-Engine.dll!ULevel::IncrementalUpdateComponents()
UnrealEditor-Engine.dll!ULevel::UpdateLevelComponents()
UnrealEditor-Engine.dll!UWorld::UpdateWorldComponents()
UnrealEditor-UnrealEd.dll!UEditorEngine::InitializePhysicsSceneForSaveIfNecessary()
UnrealEditor-UnrealEd.dll!UEditorEngine::Save()
UnrealEditor-UnrealEd.dll!UCookOnTheFlyServer::SaveCookedPackage()
UnrealEditor-UnrealEd.dll!UCookOnTheFlyServer::PumpSaves()
UnrealEditor-UnrealEd.dll!UCookOnTheFlyServer::TickCookOnTheSide()
UnrealEditor-UnrealEd.dll!UCookCommandlet::CookByTheBook()
UnrealEditor-UnrealEd.dll!UCookCommandlet::Main()
UnrealEditor-Cmd.exe!FEngineLoop::PreInitPostStartupScreen()
UnrealEditor-Cmd.exe!GuardedMain()
UnrealEditor-Cmd.exe!GuardedMainWrapper()
UnrealEditor-Cmd.exe!LaunchWindowsStartup()
UnrealEditor-Cmd.exe!WinMain()
UnrealEditor-CoreUObject.dll!FUntypedBulkData::LockReadOnly()
UnrealEditor-Landscape.dll!ULandscapeHeightfieldCollisionComponent::CookCollisionData(const FName & Format, bool bUseDefMaterial, bool bCheckDDC, TArray<unsigned char,TSizedDefaultAllocator<32>> & OutCookedData, TArray<UPhysicalMaterial *,TSizedDefaultAllocator<32>> & InOutMaterials)
UnrealEditor-Landscape.dll!ULandscapeHeightfieldCollisionComponent::CreateCollisionObject()
UnrealEditor-Landscape.dll!ULandscapeHeightfieldCollisionComponent::OnCreatePhysicsState()
UnrealEditor-Engine.dll!UActorComponent::CreatePhysicsState(bool bAllowDeferral)
UnrealEditor-Engine.dll!UActorComponent::RegisterComponentWithWorld(UWorld * InWorld, FRegisterComponentContext * Context)
UnrealEditor-Engine.dll!AActor::IncrementalRegisterComponents(int NumComponentsToRegister, FRegisterComponentContext * Context)
UnrealEditor-Engine.dll!ULevel::IncrementalRegisterComponents(bool bPreRegisterComponents, int NumComponentsToUpdate, FRegisterComponentContext * Context)
UnrealEditor-Engine.dll!ULevel::IncrementalUpdateComponents(int NumComponentsToUpdate, bool bRerunConstructionScripts, FRegisterComponentContext * Context)
UnrealEditor-Engine.dll!UWorld::UpdateWorldComponents(bool bRerunConstructionScripts, bool bCurrentLevelOnly, FRegisterComponentContext * Context)
UnrealEditor-UnrealEd.dll!UEditorEngine::InitializePhysicsSceneForSaveIfNecessary(UWorld * World, bool & bOutForceInitialized)
UnrealEditor-UnrealEd.dll!UEditorEngine::Save(UPackage * InOuter, UObject * InAsset, const wchar_t * Filename, const FSavePackageArgs & InSaveArgs)
UnrealEditor-UnrealEd.dll!UCookOnTheFlyServer::SaveCookedPackage(UE::Cook::FSaveCookedPackageContext & Context)
UnrealEditor-UnrealEd.dll!UCookOnTheFlyServer::PumpSaves(UE::Cook::FTickStackData & StackData, unsigned int DesiredQueueLength, int & OutNumPushed, bool & bOutBusy)
[Inline Frame] UnrealEditor-UnrealEd.dll!IsEngineExitRequested()
UnrealEditor-UnrealEd.dll!UCookOnTheFlyServer::TickCookOnTheSide(const float TimeSlice, unsigned int & CookedPackageCount, ECookTickFlags TickFlags)
UnrealEditor-UnrealEd.dll!UCookCommandlet::CookByTheBook(const TArray<ITargetPlatform *,TSizedDefaultAllocator<32>> & Platforms)
UnrealEditor-UnrealEd.dll!UCookCommandlet::Main(const FString & CmdLineParams)
UnrealEditor.exe!FEngineLoop::PreInitPostStartupScreen(const wchar_t * CmdLine)
[Inline Frame] UnrealEditor.exe!FEngineLoop::PreInit(const wchar_t *)
[Inline Frame] UnrealEditor.exe!EnginePreInit(const wchar_t *)
UnrealEditor.exe!GuardedMain(const wchar_t * CmdLine)
UnrealEditor.exe!LaunchWindowsStartup(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow, const wchar_t * CmdLine)
UnrealEditor.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * pCmdLine, int nCmdShow)
[Inline Frame] UnrealEditor.exe!invoke_main()
UnrealEditor.exe!__scrt_common_main_seh()
kernel32.dll!00007ffc87dc7034()
ntdll.dll!00007ffc88602651()



UnrealEditor-Landscape.dll!ULandscapeInfo::UpdateAddCollision()
UnrealEditor-Landscape.dll!ULandscapeInfo::UpdateAllAddCollisions()
UnrealEditor-Landscape.dll!ULandscapeInfo::RegisterActor()
UnrealEditor-Landscape.dll!ALandscapeProxy::CreateLandscapeInfo()
UnrealEditor-Landscape.dll!ALandscapeProxy::PostRegisterAllComponents()
UnrealEditor-Landscape.dll!ALandscapeStreamingProxy::PostRegisterAllComponents()
UnrealEditor-Engine.dll!AActor::IncrementalRegisterComponents()
UnrealEditor-Engine.dll!ULevel::IncrementalRegisterComponents()
UnrealEditor-Engine.dll!ULevel::IncrementalUpdateComponents()
UnrealEditor-Engine.dll!ULevel::UpdateLevelComponents()
UnrealEditor-Engine.dll!UWorld::UpdateWorldComponents()
UnrealEditor-UnrealEd.dll!UEditorEngine::InitializePhysicsSceneForSaveIfNecessary()
UnrealEditor-UnrealEd.dll!UEditorEngine::Save()
UnrealEditor-UnrealEd.dll!UCookOnTheFlyServer::SaveCookedPackage()
UnrealEditor-UnrealEd.dll!UCookOnTheFlyServer::PumpSaves()
UnrealEditor-UnrealEd.dll!UCookOnTheFlyServer::TickCookOnTheSide()
UnrealEditor-UnrealEd.dll!UCookCommandlet::CookByTheBook()
UnrealEditor-UnrealEd.dll!UCookCommandlet::Main()
UnrealEditor-Cmd.exe!FEngineLoop::PreInitPostStartupScreen()
UnrealEditor-Cmd.exe!GuardedMain()
UnrealEditor-Cmd.exe!GuardedMainWrapper()
UnrealEditor-Cmd.exe!LaunchWindowsStartup()
UnrealEditor-Cmd.exe!WinMain()

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-157537 in the post.

1
Login to Vote

Fixed
ComponentUE - LD & Modeling - Terrain - Landscape
Affects Versions5.0
Target Fix5.1
Fix Commit20902718
Main Commit20902718
CreatedJun 24, 2022
ResolvedJul 5, 2022
UpdatedJul 11, 2022