Editor crashed when spawning instanced static meshes with mobility set to static

UE 4.8.1 Win 7 64 bit.

When spawning instanced static meshes in any significant amount the editor crashes unless the meshes are set to movable.

Included the dump below:


Fatal error!

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0xffffffff

PhysX3PROFILE_x64.dll {0x000007fecd2ac22b} + 0 bytes
PhysX3PROFILE_x64.dll {0x000007fecd29882f} + 0 bytes
PhysX3PROFILE_x64.dll {0x000007fecd298241} + 0 bytes
PhysX3PROFILE_x64.dll {0x000007fecd296a57} + 0 bytes
PhysX3PROFILE_x64.dll {0x000007fecd2962cc} + 0 bytes
PhysX3PROFILE_x64.dll {0x000007fecd2511ea} + 0 bytes
PhysX3PROFILE_x64.dll {0x000007fecd258c78} + 0 bytes
PhysX3PROFILE_x64.dll {0x000007fecd0f24d2} + 0 bytes
UE4Editor-Engine.dll!TGraphTask::ExecuteTask() {0x000007fed40758f3} + 0 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
UE4Editor-Core.dll!FTaskThread::ProcessTasks() {0x000007fed5e763de} + 0 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
UE4Editor-Core.dll!FTaskThread::ProcessTasksUntilQuit() {0x000007fed5e7660d} + 0 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
UE4Editor-Core.dll!FTaskThread::Run() {0x000007fed5e8560b} + 0 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
UE4Editor-Core.dll!FRunnableThreadWin::Run() {0x000007fed61365b8} + 0 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
UE4Editor-Core.dll!FRunnableThreadWin::GuardedRun() {0x000007fed612146d} + 8 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\sou
kernel32.dll {0x0000000076fb59cd} + 0 bytes
ntdll.dll {0x00000000771eb981} + 0 bytes
ntdll.dll {0x00000000771eb981} + 0 bytes

Crash in runnable thread TaskGraphThread 0

Hi Hyperloop,

I just tested this with 2000 instanced meshes but I couldn’t get your result. How are you spawning the meshes in (construction script,event graph, etc) and how many are spawning at once?

EDIT I think I found the repro condition :smiley:

If the “Add static Mesh component” node is set to NONE in the mesh then it will crash!

Double Edit Nope, still happens just not every time. Ah well hehe.

I have my level split up into chunks, and each chunk handles around 3-4k instances. I’m spreading out the spawning a chunk at a time, my logic waits for one chunk to complete and then moves to the next.

It seems to crash at different times each time but I definitely can get the first few chunks spawned in ok. There are probably upwards of 50k instances in the level by the time it crashes (in 2-3k chunks -no single instanced static mesh is spawned in numbers larger than 3k or so). They spawn in like a champ if set to movable so I don’t think my setup is doing anything inordinately taxing other than whatever is causing this crash.

I happened on this crash while troubleshooting a collision performance issue - I was curious if static movement might make collison on instances more performant. Curious to hear if that is a possibility - if not then I’ll put this on the back burner for now and investigate another approach.

As always, thank you for your help!

Here’s the bit of logic I loop through inside each chunk to generate the instances:

When a mesh is set to Static, the collision doesn’t have any effect on performance. It becomes more performant because in no longer has to calculate physics and the lighting is handled differently.

Good info to know, thank you. If you are still having trouble reproducing this I can see about sharing a project with you, though it is rather large.

From what you described it sounds like you are spawning the meshes in at run time. Run time objects must be set to Movable. If you would like them set to Static you will need to spawn them in before run time via the construction script.

Ahh… That would explain it! Thank you for the info.