Description

It crashed when unspawning an AI which will destroy its entity. Inside DestroyEntities "IsProcessing" is true, but when it breaks into the debugger, "ProcessingScopeCount" is 0 (so IsProcessing should return false). In MassAgentComponent it checks "IsProcessing" and if it's true it will defer the job. It didn't defer the job in this case, but the checkf still failed.

My only explanation is that some small task managed to run on some other thread between all of these checks meaning that this flow isn't 100% thread safe. Am I missing some piece of logic that would make this thread-safe? I couldn't find any suspicious task in "parallel threads", but ProcessingScopeCount is 0 so it should have completed again.

 

My theory:

  1. MassAgentComponent checks process == false
  2. MassAgentComponent calls "DestroyEntities"
  3. Some other job starts processing, sets ProcessingScopeCount to 1
  4. MassSpawnerSubsystem::DestroyEntities checks for processing, fails, starts breaking into debugger
  5. Other job completes, sets ProcessingScopeCount to 0
  6. Break into debugger completes, ProcessingScopeCount is seen as 0
Steps to Reproduce

No concrete steps. Only happened once from report.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-318908 in the post.

0
Login to Vote

Unresolved
ComponentUE - AI - Mass
Affects Versions5.6.1
CreatedSep 7, 2025
UpdatedSep 8, 2025
View Jira Issue