After upgrading from 4.16 to 4.17.1 Instanced Static Mesh introduced great dose of unstability. Previously I was able to add /remove instances even every frame without any trouble. With 4.17 engine crashes after few seconds. I’ve logged two different traces of crash, so it may be related to multi-threading. When I stop updating instances, crashes dissapear. Game is run in VR, crashes both on Oculus and Vive.
Case 1:
Hypetrain-Win64-DebugGame.exe!FStaticMeshInstanceBuffer::UpdateInstanceData(class UInstancedStaticMeshComponent *,class TArray<class TRefCountPtr<class HHitProxy>,class FDefaultAllocator> const &,int,int) C++
Hypetrain-Win64-DebugGame.exe!FPerInstanceRenderData::UpdateInstanceData(class UInstancedStaticMeshComponent *,int,int,bool) C++
Hypetrain-Win64-DebugGame.exe!UInstancedStaticMeshComponent::UpdateInstanceTransform(int,struct FTransform const &,bool,bool,bool) C++
Hypetrain-Win64-DebugGame.exe!UInstancedStaticMeshComponent::OnUpdateTransform(enum EUpdateTransformFlags,enum ETeleportType) C++
Hypetrain-Win64-DebugGame.exe!USceneComponent::PropagateTransformUpdate(bool,enum EUpdateTransformFlags,enum ETeleportType) C++
Hypetrain-Win64-DebugGame.exe!USceneComponent::UpdateComponentToWorldWithParent(class USceneComponent *,class FName,enum EUpdateTransformFlags,struct FQuat const &,enum ETeleportType) C++
Hypetrain-Win64-DebugGame.exe!USceneComponent::UpdateComponentToWorld(EUpdateTransformFlags UpdateTransformFlags, ETeleportType Teleport) Line 837 C++
[External Code]
Hypetrain-Win64-DebugGame.exe!USceneComponent::UpdateComponentToWorld(EUpdateTransformFlags UpdateTransformFlags, ETeleportType Teleport) Line 837 C++
[External Code]
Hypetrain-Win64-DebugGame.exe!USceneComponent::UpdateComponentToWorld(EUpdateTransformFlags UpdateTransformFlags, ETeleportType Teleport) Line 837 C++
[External Code]
Case 2:
Hypetrain-Win64-DebugGame.exe!FMallocBinned2::Private::FreeBundles(class FMallocBinned2 &,struct FMallocBinned2::FBundleNode *,unsigned int,unsigned int) C++
Hypetrain-Win64-DebugGame.exe!FMallocBinned2::FreeExternal(void *) C++
Hypetrain-Win64-DebugGame.exe!FMallocBinned2::ReallocExternal(void *,unsigned __int64,unsigned int) C++
Hypetrain-Win64-DebugGame.exe!FMallocBinned2::Realloc(void *,unsigned __int64,unsigned int) C++
Hypetrain-Win64-DebugGame.exe!FMallocPoisonProxy::Realloc(void *,unsigned __int64,unsigned int) C++
Hypetrain-Win64-DebugGame.exe!FMemory::Realloc(void *,unsigned __int64,unsigned int) C++
Hypetrain-Win64-DebugGame.exe!TArray<struct FInstanceStream<class FFloat16>,class TAlignedHeapAllocator<0> >::ResizeTo(int) C++
Hypetrain-Win64-DebugGame.exe!FD3D11DynamicRHI::RHICreateVertexBuffer(unsigned int,unsigned int,struct FRHIResourceCreateInfo &) C++
Hypetrain-Win64-DebugGame.exe!FDynamicRHI::CreateVertexBuffer_RenderThread(class FRHICommandListImmediate &,unsigned int,unsigned int,struct FRHIResourceCreateInfo &) C++
Hypetrain-Win64-DebugGame.exe!FStaticMeshInstanceBuffer::InitRHI(void) C++
Hypetrain-Win64-DebugGame.exe!FRenderResource::InitResource(void) C++
Hypetrain-Win64-DebugGame.exe!TGraphTask<class `BeginInitResource(class FRenderResource *)'::`2'::EURCMacro_InitCommand>::ExecuteTask(class TArray<class FBaseGraphTask *,class FDefaultAllocator> &,enum ENamedThreads::Type) C++
Hypetrain-Win64-DebugGame.exe!FNamedTaskThread::ProcessTasksNamedThread(int,bool) C++
Hypetrain-Win64-DebugGame.exe!FNamedTaskThread::ProcessTasksUntilQuit(int) C++
Hypetrain-Win64-DebugGame.exe!RenderingThreadMain(class FEvent *) C++
Hypetrain-Win64-DebugGame.exe!FRenderingThread::Run(void) C++
Hypetrain-Win64-DebugGame.exe!FRunnableThreadWin::Run(void) C++
Hypetrain-Win64-DebugGame.exe!FRunnableThreadWin::GuardedRun(void) C++
kernel32.dll!00007ff851df2774() Unknown
ntdll.dll!00007ff8546b0d51() Unknown