Currently working on a project that involves building a lot of structures from hierarchical instanced static mesh components. We want these buildings to be destructible, so I’ve attached a component to the player character that, on tick, does an OverlapMultiByObjectType, gathers all the HISMCs in a radius around them, and replaces them with destructible mesh components.
After a certain number of conversions, the engine crashes. The number of conversions required varies based on settings (see below callstack for details).
The engine is crashing with this callstack:
MachineId:2A2D385F4FB910D788020B9754E0EE1F EpicAccountId:72c1df1e45e54b6eb8d495162d6ae7d2 Access violation - code c0000005 (first/second chance not available) "" APEX_DestructiblePROFILE_x64 APEX_DestructiblePROFILE_x64 APEX_DestructiblePROFILE_x64 APEXFrameworkPROFILE_x64 UE4Editor_Engine!TGraphTask<FPhysXTask>::ExecuteTask() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\core\public\async\taskgraphinterfaces.h:779] UE4Editor_Core!FTaskThread::ProcessTasks() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\core\private\async\taskgraph.cpp:539] UE4Editor_Core!FTaskThread::ProcessTasksUntilQuit() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\core\private\async\taskgraph.cpp:340] UE4Editor_Core!FTaskThread::Run() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\core\private\async\taskgraph.cpp:690] UE4Editor_Core!FRunnableThreadWin::Run() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\core\private\windows\windowsrunnablethread.cpp:74]
I’m having serious trouble tracking this one down, and it’s getting very frustrating. I have discovered two things:
Disabling “Form Extended Structures” on the destructible mesh significantly reduces the frequency of crashes (with it enabled, it crashes within the first 5-10 HISMC conversions. With it disabled, it can take from 13000 - 20000 conversions to do it). Note that having “Form Extended Structures” enabled also significantly reduces the project’s performance/FPS, so perhaps physics processing time has a connection.
Enabling the async scene slightly reduces crash frequency (instead of 5-10 conversions, about 150 - 200).
Commenting out the destructible mesh spawning code, but leaving the HISMC removal code in, causes the crash to stop occuring. The other way around, however, does not. So it’s connected to the destructible mesh spawning, not the HISMC removal.
I could really use some help on this. I can’t have a crash like this lingering around in my project, and it’s starting to feel impossible to debug on my own. Spent about 8-10 hours on it so far, fiddling with everything I could think of.
Thanks in advance!