UE4Editor_Engine!TGraphTask::ExecuteTask()

Hi I have been getting this crash on and off what seemed to be randomly for the past couple months. The other day I accidentally figured out a way to repo the crash 100% percent of the time.

Access violation - code c0000005 (first/second chance not available)

""

PhysX3PROFILE_x64
PhysX3PROFILE_x64
PhysX3PROFILE_x64
PhysX3PROFILE_x64
UE4Editor_Engine!TGraphTask<FPhysXTask>::ExecuteTask() [c:\ue4\ue4_4.10\unrealengine\engine\source\runtime\core\public\async\taskgraphinterfaces.h:779]
UE4Editor_Core!FTaskThread::ProcessTasks() [c:\ue4\ue4_4.10\unrealengine\engine\source\runtime\core\private\async\taskgraph.cpp:539]
UE4Editor_Core!FTaskThread::ProcessTasksUntilQuit() [c:\ue4\ue4_4.10\unrealengine\engine\source\runtime\core\private\async\taskgraph.cpp:340]
UE4Editor_Core!FTaskThread::Run() [c:\ue4\ue4_4.10\unrealengine\engine\source\runtime\core\private\async\taskgraph.cpp:690]
UE4Editor_Core!FRunnableThreadWin::Run() [c:\ue4\ue4_4.10\unrealengine\engine\source\runtime\core\private\windows\windowsrunnablethread.cpp:74]

Basically what I am doing in game to cause the crash is I have instanced static meshes that are being destroyed and then recreated. I attached the dmp file below. Code I am calling that appears to be causing the crash is

ClearInstances();

for( const FTransform& Transform : ReplicatedTransforms )			
{
	AddInstanceWorldSpace( Transform );
}

This is being called on a custom component extending UInstancedStaticMeshComponent. I am clearing all instances on the component and then recreating them based off the ReplicatedTransform array all in the same frame. This works 99.9% of the time, but sometimes causes this crash.

Any help looking into fixing this issue would be appreciated. If any more info is needed let me know.

Log

DMP file

This look like PhysX crash on diffrent thread, can you check logs? they may have more info, they are in Saved/Logs in project directory. It seems to be some lot of PhysiX related crashes, this might be driver issues. Since it PhysiX related say what CPU and GPU you have

Thanks for looking into it . I have attached the log file to to top post. If you need anything else just let me know.

The crash indeed happened in PhysX3PROFILE_x64.dll it might be either UE4 or PhysX fault

This is UE-22078, it’s in 4.10 but it’s fixed in 4.11. This commit fixed the bug:
https://github.com/EpicGames/UnrealEngine/commit/e09f279825be41f28d10f94e329e3d6de6efb9c2

Just updated to 4.11 to test it out and you are right. As far as I can tell its is now fixed. Thank you very very much posting this. This bug has been bothering me for a while now. Awesome to finally have it fixed. And thank you for also taking the time to look into this. I really appreciate it guys!