In UCookOnTheFlyServer::BeginPackageCacheForCookedPlatformData(), there is a pointer to int32 called CurrentAsyncCache that is used as an index. It's value is dereferenced before it is checked, but it is not dereferenced when it is modified.
Not sure what the correct behavior is supposed to be, but looks like a potential mistake.
bool UCookOnTheFlyServer::BeginPackageCacheForCookedPlatformData(UPackage* Package, const TArray<const ITargetPlatform*>& TargetPlatforms, FCookerTimer& Timer) const { COOK_STAT(FScopedDurationTimer DurationTimer(DetailedCookStats::TickCookOnTheSideBeginPackageCacheForCookedPlatformDataTimeSec)); #if DEBUG_COOKONTHEFLY UE_LOG(LogCook, Display, TEXT("Caching objects for package %s"), *Package->GetFName().ToString()); #endif MakePackageFullyLoaded(Package); FReentryData& CurrentReentryData = GetReentryData(Package); if (CurrentReentryData.bIsValid == false) return true; if (CurrentReentryData.bBeginCacheFinished) return true; for (; CurrentReentryData.BeginCacheCount < CurrentReentryData.CachedObjectsInOuter.Num(); ++CurrentReentryData.BeginCacheCount) { UObject* Obj = CurrentReentryData.CachedObjectsInOuter[CurrentReentryData.BeginCacheCount]; for (const ITargetPlatform* TargetPlatform : TargetPlatforms) { const FName ClassFName = Obj->GetClass()->GetFName(); int32* CurrentAsyncCache = CurrentAsyncCacheForType.Find(ClassFName); if ( CurrentAsyncCache != nullptr ) { if ( *CurrentAsyncCache <= 0 ) { return false; } int32* Value = CurrentReentryData.BeginCacheCallCount.Find(ClassFName); if ( !Value ) { CurrentReentryData.BeginCacheCallCount.Add(ClassFName,1); } else { *Value += 1; } CurrentAsyncCache -= 1; } if (Obj->IsA(UMaterialInterface::StaticClass())) { if (GShaderCompilingManager->GetNumRemainingJobs() > MaxConcurrentShaderJobs) { #if DEBUG_COOKONTHEFLY UE_LOG(LogCook, Display, TEXT("Delaying shader compilation of material %s"), *Obj->GetFullName()); #endif return false; } } Obj->BeginCacheForCookedPlatformData(TargetPlatform); } if (Timer.IsTimeUp()) { #if DEBUG_COOKONTHEFLY UE_LOG(LogCook, Display, TEXT("Object %s took too long to cache"), *Obj->GetFullName()); #endif return false; } } CurrentReentryData.bBeginCacheFinished = true; return true; }
Unclear, but confirmed typo with DanL.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-53332 in the post.
0 |
Component | UE - Foundation - Core - Cooker |
---|---|
Affects Versions | 4.18.2, 4.19 |
Target Fix | 4.19 |
Created | Dec 12, 2017 |
---|---|
Resolved | Dec 13, 2017 |
Updated | Apr 27, 2018 |