Summary
Crash Details
The application crashes with an access violation when trying to read from an invalid UniformBuffer pointer:
Unhandled exception thrown: read access violation.
InBuffer was 0xFFFFFFFFFFFFFFBF.
The crash occurs at this line:
uint32 UniformBufferHash = InUniformBuffer->GetLayout().GetHash();
Please select what you are reporting on:
Creative
What Type of Bug are you experiencing?
Other
Steps to Reproduce
The crash occurs in packaged builds (both Development and Shipping configurations) and is more frequent when teleporting between different locations in the game.
Expected Result
Not crash.
Observed Result
Call Stack
The crash happens in the ValidateBoundUniformBuffer function when binding shader parameters:
[Inline Frame] MyGame.exe!ValidateBoundUniformBuffer(FD3D12UniformBuffer * InUniformBuffer, FRHIShader * InShaderRHI, unsigned int InBufferIndex) Line 54
MyGame.exe!BindUniformBuffer(FD3D12CommandContext & Context, FRHIShader * Shader, EShaderFrequency ShaderFrequency, unsigned int BufferIndex, FD3D12UniformBuffer * InBuffer) Line 67
MyGame.exe!SetShaderParametersOnContext(FD3D12CommandContext & Context, FRHIShader * Shader, EShaderFrequency ShaderFrequency, TArrayView<unsigned char const ,int> InParametersData, TArrayView<FRHIShaderParameter const ,int> InParameters, TArrayView<FRHIShaderParameterResource const ,int> InResourceParameters, TArrayView<FRHIShaderParameterResource const ,int> InBindlessParameters) Line 1101
MyGame.exe!FD3D12CommandContext::RHISetShaderParameters(FRHIComputeShader * Shader, TArrayView<unsigned char const ,int> InParametersData, TArrayView<FRHIShaderParameter const ,int> InParameters, TArrayView<FRHIShaderParameterResource const ,int> InResourceParameters, TArrayView<FRHIShaderParameterResource const ,int> InBindlessParameters) Line 1148
MyGame.exe!FRHICommandSetShaderParameters::Execute(FRHICommandListBase & CmdList) Line 124
[Inline Frame] MyGame.exe!FCpuProfilerTrace::FEventScope::{ctor}(unsigned int &) Line 171
MyGame.exe!FRHICommand<FRHICommandSetShaderParameters,FRHICommandSetShaderParametersString1640>::ExecuteAndDestruct(FRHICommandListBase & CmdList) Line 1473
MyGame.exe!FRHICommandListBase::Execute() Line 426
MyGame.exe!FRHICommandListExecutor::FTranslateState::Translate(FRHICommandListBase * CmdList) Line 906
Debugging Findings
Through debugging, I’ve discovered:
1.The InBuffer parameter in BindUniformBuffer is 0xdddddddddddddddd (uninitialized memory marker)
2.When examining InResourceParameters in the debugger:
- InResourceParameters[0].Resource is a valid pointer (0x000001af6d0348a0)
- But its ResourceType is RRT_None and bCommitted is 0
- The OwnerName shows as Illegal name (block index out of range)
1.The issue appears to be that FD3D12CommandContext::RetrieveObject(Parameter.Resource, GpuIndex) is returning an invalid pointer
2.The crash is more likely to occur during level transitions or when teleporting between different areas, suggesting it might be related to resource loading/unloading or memory management during these transitions.
3.The issue only manifests in packaged builds (both Development and Shipping), not in the editor.
Platform(s)
Windows 11