Render thread crash on map travel

Hello,

We are having an occasional crash on the render thread when traveling between maps. We have only seen it in builds but it is present in all types of build (debugging, development, release). Thank you in advance for your help. Here is a typical call stack:

GameProject_Win64_DebugGame!TStaticMeshDrawList >::FElementHandle::Remove() [z:\ue4.14\engine\engine\source\runtime\renderer\private\staticmeshdrawlist.inl:27]
GameProject_Win64_DebugGame!FStaticMesh::RemoveFromDrawLists() [z:\ue4.14\engine\engine\source\runtime\renderer\private\scenecore.cpp:388]
GameProject_Win64_DebugGame!FStaticMesh::~FStaticMesh() [z:\ue4.14\engine\engine\source\runtime\renderer\private\scenecore.cpp:415]
GameProject_Win64_DebugGame!FPrimitiveSceneInfo::RemoveStaticMeshes() [z:\ue4.14\engine\engine\source\runtime\renderer\private\primitivesceneinfo.cpp:286]
GameProject_Win64_DebugGame!FPrimitiveSceneInfo::RemoveFromScene() [z:\ue4.14\engine\engine\source\runtime\renderer\private\primitivesceneinfo.cpp:319]
GameProject_Win64_DebugGame!FScene::RemovePrimitiveSceneInfo_RenderThread() [z:\ue4.14\engine\engine\source\runtime\renderer\private\rendererscene.cpp:918]
GameProject_Win64_DebugGame!`FScene::RemovePrimitive'::`5'::EURCMacro_FRemovePrimitiveCommand::DoTask() [z:\ue4.14\engine\engine\source\runtime\renderer\private\rendererscene.cpp:938]
GameProject_Win64_DebugGame!TGraphTask<`FScene::RemovePrimitive'::`5'::EURCMacro_FRemovePrimitiveCommand>::ExecuteTask() [z:\ue4.14\engine\engine\source\runtime\core\public\async\taskgraphinterfaces.h:868]
GameProject_Win64_DebugGame!FNamedTaskThread::ProcessTasksNamedThread() [z:\ue4.14\engine\engine\source\runtime\core\private\async\taskgraph.cpp:932]
GameProject_Win64_DebugGame!FNamedTaskThread::ProcessTasksUntilQuit() [z:\ue4.14\engine\engine\source\runtime\core\private\async\taskgraph.cpp:679]
GameProject_Win64_DebugGame!RenderingThreadMain() [z:\ue4.14\engine\engine\source\runtime\rendercore\private\renderingthread.cpp:320]
GameProject_Win64_DebugGame!FRenderingThread::Run() [z:\ue4.14\engine\engine\source\runtime\rendercore\private\renderingthread.cpp:454]
GameProject_Win64_DebugGame!FRunnableThreadWin::Run() [z:\ue4.14\engine\engine\source\runtime\core\private\windows\windowsrunnablethread.cpp:74]

This may also help, although PrimitiveSceneInfo is not nullptr in every crash we have

I believe that I have seen this get as far as line 388 of SceneCore.cpp before crashing at the check:
check(DrawListLinks.Num() == OriginalNumLinks - 1);
Where both operands (DrawListLinks.Num() and OriginalNumLinks) are equal and therefore the check fails

Here is what is happening on the game thread:

Hey MaahngHoSi-

Looking at the callstack, it seems some static mesh is being destroyed before being removed from the draw list. This is causing the crash since the mesh no longer exists to be removed from the list. Are you able to reproduce this crash in a new project? To help me test the crash locally, can you explain how your map travel is setup?

Hey MaahngHoSi-

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will follow up.

Cheers

Hey, did you ever figure this out? I’m getting something similar on map travel as well.

Hey Snipeye-

Without additional information we are unable to test the crash on travel. If you’re able to reproduce the crash in a new project, please provide the setup steps or a small sample project showing the issue.

Hey Snipeye, In our case we were mistakenly removing elements at index -1 from a TArray owned by a custom child class of AGameState during our override of the AGameMode::Logout( AController* Exiting ) function which I assume must have been either directly or indirectly eating into rendering memory. Good luck finding the issue on your end! :slight_smile: