Description

This buffer overrun is probably caused by the ExportParticleDataToBlueprint module does not respecting the GPUAllocation Fixed Size setting in the module.

In fact, out-of-range export data is not correct.

 Following workaround works.

const uint32 ReadbackInstanceCount = FMath::Min(*reinterpret_cast<uint32*>(Buffers[0].Key), MaxInstances);

 

Steps to Reproduce
  1. Open attached repro project [Link Removed] on ue4.26
  2. Start PIE (If it doesn't come up, restart PIE several times)
  3. Engine crash (see call stack below)

 

[Link Removed]

Callstack
UE4Editor-Niagara.dll!FNDIExportProxy::PostStage::__l9::<lambda>(TArrayView<TTuple<void *,unsigned int> const ,int> Buffers) Line 184
UE4Editor-Niagara.dll!Invoke(FNDIExportProxy::PostStage::__l9::void <lambda>(TArrayView<TTuple<void *,unsigned int> const ,int>) &) Line 51
UE4Editor-Niagara.dll!UE4Function_Private::TFunctionRefCaller<void <lambda>(TArrayView<TTuple<void *,unsigned int> const ,int>),void __cdecl(TArrayView<TTuple<void *,unsigned int> const ,int>)>::Call(void * Obj, TArrayView<TTuple<void *,unsigned int> const ,int> & <Params_0>) Line 549
UE4Editor-Niagara.dll!UE4Function_Private::TFunctionRefBase<UE4Function_Private::TFunctionStorage<0>,void __cdecl(TArrayView<TTuple<void *,unsigned int> const ,int>)>::operator()(TArrayView<TTuple<void *,unsigned int> const ,int>) Line 676
UE4Editor-Niagara.dll!FNiagaraGpuReadbackManager::TickInternal(bool bAssumeGpuIdle) Line 46
UE4Editor-Niagara.dll!FNiagaraGpuReadbackManager::Tick() Line 20
UE4Editor-Niagara.dll!NiagaraEmitterInstanceBatcher::PreInitViews(FRHICommandListImmediate & RHICmdList, bool bAllowGPUParticleUpdate) Line 1319
UE4Editor-Engine.dll!FFXSystemSet::PreInitViews(FRHICommandListImmediate & RHICmdList, bool bAllowGPUParticleUpdate) Line 120
UE4Editor-Renderer.dll!FSceneRenderer::PreVisibilityFrameSetup(FRHICommandListImmediate & RHICmdList) Line 3053
UE4Editor-Renderer.dll!FDeferredShadingSceneRenderer::PreVisibilityFrameSetup(FRHICommandListImmediate &) Line 4271
UE4Editor-Renderer.dll!FDeferredShadingSceneRenderer::InitViews(FRHICommandListImmediate & RHICmdList, FExclusiveDepthStencil::Type BasePassDepthStencilAccess, FILCUpdatePrimTaskData & ILCTaskData) Line 4287
UE4Editor-Renderer.dll!FDeferredShadingSceneRenderer::Render(FRHICommandListImmediate & RHICmdList) Line 1414
UE4Editor-Renderer.dll!RenderViewFamily_RenderThread(FRHICommandListImmediate & RHICmdList, FSceneRenderer * SceneRenderer) Line 3619
UE4Editor-Renderer.dll!FRendererModule::BeginRenderingViewFamily::__l35::<lambda>(FRHICommandListImmediate & RHICmdList) Line 3889
UE4Editor-Renderer.dll!TEnqueueUniqueRenderCommandType<`FRendererModule::BeginRenderingViewFamily'::`35'::FDrawSceneCommandName,void <lambda>(FRHICommandListImmediate &)>::DoTask(ENamedThreads::Type CurrentThread, const TRefCountPtr<FGraphEvent> & MyCompletionGraphEvent) Line 183
UE4Editor-Renderer.dll!TGraphTask<TEnqueueUniqueRenderCommandType<`FRendererModule::BeginRenderingViewFamily'::`35'::FDrawSceneCommandName,void <lambda>(FRHICommandListImmediate &)>>::ExecuteTask(TArray<FBaseGraphTask *,TSizedDefaultAllocator<32>> & NewTasks, ENamedThreads::Type CurrentThread) Line 886
UE4Editor-Core.dll!FBaseGraphTask::Execute(TArray<FBaseGraphTask *,TSizedDefaultAllocator<32>> & CurrentThread, ENamedThreads::Type) Line 524
UE4Editor-Core.dll!FNamedTaskThread::ProcessTasksNamedThread(int QueueIndex, bool bAllowStall) Line 709
UE4Editor-Core.dll!FNamedTaskThread::ProcessTasksUntilQuit(int QueueIndex) Line 601
UE4Editor-RenderCore.dll!RenderingThreadMain(FEvent * TaskGraphBoundSyncEvent) Line 373
UE4Editor-RenderCore.dll!FRenderingThread::Run() Line 528
UE4Editor-Core.dll!FRunnableThreadWin::Run() Line 86
UE4Editor-Core.dll!FRunnableThreadWin::GuardedRun() Line 27
kernel32.dll!00007ffdec3c7034()	Unknown	
ntdll.dll!00007ffdeda22651()	Unknown	

Have Comments or More Details?

There's no existing public thread on this issue, so head over to AnswerHub just mention UE-121372 in the post.

1
Login to Vote

Fixed
ComponentRendering - Niagara
Affects Versions4.26
Target Fix4.27.1
Fix Commit17271704
CreatedAug 10, 2021
ResolvedAug 23, 2021
UpdatedSep 9, 2021