Unity Freeze, when I use "constrainInsideGraph"

I’m using 4.3.56 Beta version. Editor freezes without printing any crash log (in editor.log file latest path search logged) when I change “constrainInsideGraph” bool to “True” in AIPath.

.
I attach RVOSimulator and Pathfinder script to same object.
pathfinder settings:

RVOSimulator settings:

enemy object has 4 script


Only AIPath’s “MaxSpeed” changed to 4 and “ConstrainInsideGraph” changed to TRUE.

In my scene there is 8 enemy object.

When one enemy collide with wall (which edited the graph when scanned) Unity freezes.
(I also mention that unity didn’t crash in “Example16_RVO 2D” scene)

I need to add some information that I forgot to mention.

I’m using unity version of 2021.3.5
Also, by wall I mean the three bricks in the middle of the map. Unity freezes when one of enemy touches one of those three walls.

Hi

Thank you for reporting this. Sadly, I cannot replicate it :confused:
Is it 100% reproducible?

I’ve been a little busy the last few days, so I haven’t been able to investigate the cause of the error. Now I can get some error report but editor freeze again.

Exception: Trying to free an already freed index
  at Pathfinding.Util.SlabAllocator`1[T].Free (System.Int32 allocatedIndex) [0x000da] in C:\Users\Akalii\Desktop\Unity Projects\Fresh_Outlandish\Library\PackageCache\com.arongranberg.astar@4.3.56\Utilities\SlabAllocator.cs:199 
  at Pathfinding.RVO.RVOObstacleCache.FreeUnusedObstacles (Pathfinding.RVO.SimulatorBurst+AgentData& agentData, Pathfinding.RVO.SimulatorBurst+ObstacleData& obstacleData, System.Int32 numAgents) [0x0007f] in C:\Users\Akalii\Desktop\Unity Projects\Fresh_Outlandish\Library\PackageCache\com.arongranberg.astar@4.3.56\Core\RVO\RVOObstacleCache.cs:56 
  at Pathfinding.RVO.SimulatorBurst.UpdateInternal[T] () [0x0008f] in C:\Users\Akalii\Desktop\Unity Projects\Fresh_Outlandish\Library\PackageCache\com.arongranberg.astar@4.3.56\Core\RVO\RVOCoreSimulatorBurst.cs:1156 
  at Pathfinding.RVO.SimulatorBurst.Update () [0x00019] in C:\Users\Akalii\Desktop\Unity Projects\Fresh_Outlandish\Library\PackageCache\com.arongranberg.astar@4.3.56\Core\RVO\RVOCoreSimulatorBurst.cs:1110 
  at Pathfinding.RVO.RVOSimulator.Update () [0x00055] in C:\Users\Akalii\Desktop\Unity Projects\Fresh_Outlandish\Library\PackageCache\com.arongranberg.astar@4.3.56\RVO\RVOSimulator.cs:135 

(Filename: Library/PackageCache/com.arongranberg.astar@4.3.56/Utilities/SlabAllocator.cs Line: 199)

Exception: Trying to free an already freed index
  at Pathfinding.Util.SlabAllocator`1[T].Free (System.Int32 allocatedIndex) [0x000da] in C:\Users\Akalii\Desktop\Unity Projects\Fresh_Outlandish\Library\PackageCache\com.arongranberg.astar@4.3.56\Utilities\SlabAllocator.cs:199 
  at Pathfinding.RVO.RVOObstacleCache.FreeUnusedObstacles (Pathfinding.RVO.SimulatorBurst+AgentData& agentData, Pathfinding.RVO.SimulatorBurst+ObstacleData& obstacleData, System.Int32 numAgents) [0x0007f] in C:\Users\Akalii\Desktop\Unity Projects\Fresh_Outlandish\Library\PackageCache\com.arongranberg.astar@4.3.56\Core\RVO\RVOObstacleCache.cs:56 
  at Pathfinding.RVO.SimulatorBurst.UpdateInternal[T] () [0x0008f] in C:\Users\Akalii\Desktop\Unity Projects\Fresh_Outlandish\Library\PackageCache\com.arongranberg.astar@4.3.56\Core\RVO\RVOCoreSimulatorBurst.cs:1156 
  at Pathfinding.RVO.SimulatorBurst.Update () [0x00019] in C:\Users\Akalii\Desktop\Unity Projects\Fresh_Outlandish\Library\PackageCache\com.arongranberg.astar@4.3.56\Core\RVO\RVOCoreSimulatorBurst.cs:1110 
  at Pathfinding.RVO.RVOSimulator.Update () [0x00055] in C:\Users\Akalii\Desktop\Unity Projects\Fresh_Outlandish\Library\PackageCache\com.arongranberg.astar@4.3.56\RVO\RVOSimulator.cs:135 

(Filename: Library/PackageCache/com.arongranberg.astar@4.3.56/Utilities/SlabAllocator.cs Line: 199)

Path Completed : Computation Time 0.00 ms Searched Nodes 7 Path Length 5
Path Number 262 (unique id)
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:Log (object)
AstarPath:LogPathResults (Pathfinding.Path) (at Library/PackageCache/com.arongranberg.astar@4.3.56/Core/AstarPath.cs:840)
AstarPath:<InitializePathProcessor>b__122_1 (Pathfinding.Path) (at Library/PackageCache/com.arongranberg.astar@4.3.56/Core/AstarPath.cs:1304)
Pathfinding.PathProcessor:CalculatePathsThreaded (Pathfinding.PathHandler) (at Library/PackageCache/com.arongranberg.astar@4.3.56/Core/Misc/PathProcessor.cs:514)
Pathfinding.PathProcessor/<>c__DisplayClass26_0:<.ctor>b__0 () (at Library/PackageCache/com.arongranberg.astar@4.3.56/Core/Misc/PathProcessor.cs:147)
System.Threading.ThreadHelper:ThreadStart_Context (object)
System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object)
System.Threading.ThreadHelper:ThreadStart ()

(Filename: Library/PackageCache/com.arongranberg.astar@4.3.56/Core/AstarPath.cs Line: 840)

System.ArgumentException: An item with the same key has already been added
This Exception was thrown from a job compiled with Burst, which has limited exception support.
0x00007ffa87f9e27e (88342ffae15aba964b3fee4e3777f35) [unknown:0] Unity.Jobs.IJobExtensions.JobStruct`1<Pathfinding.RVO.RVOObstacleCache.TraceContoursJob>.Execute 
0x00007ffa87f9cca1 (88342ffae15aba964b3fee4e3777f35) cf3eb5f02b57c471bee28d35a03418bb
0x00007ff616b26d10 (Unity) ExecuteJob
0x00007ff616b27d9f (Unity) ForwardJobToManaged
0x00007ff616b28cf6 (Unity) ScheduleManagedJob
0x00007ff61609891a (Unity) JobsUtility_CUSTOM_Schedule_Injected
0x000002023fc983e5 (Mono JIT Code) (wrapper managed-to-native) Unity.Jobs.LowLevel.Unsafe.JobsUtility:Schedule_Injected (Unity.Jobs.LowLevel.Unsafe.JobsUtility/JobScheduleParameters&,Unity.Jobs.JobHandle&)
0x000002023fc98303 (Mono JIT Code) Unity.Jobs.LowLevel.Unsafe.JobsUtility:Schedule (Unity.Jobs.LowLevel.Unsafe.JobsUtility/JobScheduleParameters&)
0x000002023fec60b3 (Mono JIT Code) Unity.Jobs.IJobExtensions:Run<Pathfinding.RVO.RVOObstacleCache/TraceContoursJob> (Pathfinding.RVO.RVOObstacleCache/TraceContoursJob)
0x000002023fec1d4b (Mono JIT Code) [RVOObstacleCache.cs:255] Pathfinding.RVO.RVOObstacleCache:GetObstaclesAround (Pathfinding.GraphNode,int,Pathfinding.Util.SimpleMovementPlane,Pathfinding.RVO.SimulatorBurst/ObstacleData&) 
0x000002023febdeb3 (Mono JIT Code) [RVOCoreSimulatorBurst.cs:546] Pathfinding.RVO.SimulatorBurst/Agent:SetObstacleQuery (Pathfinding.GraphNode,int,Pathfinding.Util.SimpleMovementPlane) 
0x000002023febd5ea (Mono JIT Code) [AIPath.cs:479] Pathfinding.AIPath:ClampToNavmesh (UnityEngine.Vector3,bool&) 
0x000002023febaf95 (Mono JIT Code) [AIBase.cs:794] Pathfinding.AIBase:FinalizePosition (UnityEngine.Vector3) 
0x000002023feb9af3 (Mono JIT Code) [AIBase.cs:753] Pathfinding.AIBase:FinalizeMovement (UnityEngine.Vector3,UnityEngine.Quaternion) 
0x000002023fdcce58 (Mono JIT Code) [AIBase.cs:499] Pathfinding.AIBase:OnUpdate (single) 
0x000002023fdca9f4 (Mono JIT Code) [AIBase.cs:475] Pathfinding.AIBase:OnUpdate (Pathfinding.AIBase[],int,Pathfinding.Util.BatchedEvents/Event) 
0x000002023fdc9d9c (Mono JIT Code) [BatchedEvents.cs:150] Pathfinding.Util.BatchedEvents/<>c__DisplayClass14_0`1<T_REF>:<Add>b__0 (object[],int,Pathfinding.Util.BatchedEvents/Event) 
0x000002023fd403a4 (Mono JIT Code) [BatchedEvents.cs:172] Pathfinding.Util.BatchedEvents:DoEvent (Pathfinding.Util.BatchedEvents/Event) 
0x000002023fdc9cd3 (Mono JIT Code) [BatchedEvents.cs:185] Pathfinding.Util.BatchedEvents:Update () 
0x000002037c6671c8 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
0x00007ffa8b8ae4b4 (mono-2.0-bdwgc) [mini-runtime.c:3445] mono_jit_runtime_invoke 
0x00007ffa8b7ee764 (mono-2.0-bdwgc) [object.c:3066] do_runtime_invoke 
0x00007ffa8b7ee8fc (mono-2.0-bdwgc) [object.c:3113] mono_runtime_invoke 
0x00007ff616eb58c4 (Unity) scripting_method_invoke
0x00007ff616eb04e4 (Unity) ScriptingInvocation::Invoke
0x00007ff616e7e154 (Unity) MonoBehaviour::CallMethodIfAvailable
0x00007ff616e7e25c (Unity) MonoBehaviour::CallUpdateMethod
0x00007ff616975638 (Unity) BaseBehaviourManager::CommonUpdate<BehaviourManager>
0x00007ff61697cc1a (Unity) BehaviourManager::Update
0x00007ff616b8d7ad (Unity) `InitPlayerLoopCallbacks'::`2'::UpdateScriptRunBehaviourUpdateRegistrator::Forward
0x00007ff616b743cc (Unity) ExecutePlayerLoop
0x00007ff616b744a3 (Unity) ExecutePlayerLoop
0x00007ff616b7a0e9 (Unity) PlayerLoop
0x00007ff617ac1778 (Unity) PlayerLoopController::UpdateScene
0x00007ff617abf95f (Unity) Application::TickTimer
0x00007ff617f0b00a (Unity) MainMessageLoop
0x00007ff617f0f8bb (Unity) WinMain
0x00007ff6192428be (Unity) __scrt_common_main_seh
0x00007ffaeec57034 (KERNEL32) BaseThreadInitThunk
0x00007ffaf0442651 (ntdll) RtlUserThreadStart
System.Exception: Trying to get a span for an unallocated index
This Exception was thrown from a job compiled with Burst, which has limited exception support.
0x00007ffa87f01d04 (324e4a9a65cffdd424bfac1b0c3bdea) [RVOAgentBurst.cs:832] Pathfinding.RVO.Sampled.JobRVO`1<Pathfinding.RVO.XZMovementPlane>::Pathfinding.RVO.Sampled.JobRVO`1<Pathfinding.RVO.XZMovementPlane>.GenerateObstacleVOs 
0x00007ffa87efd04e (324e4a9a65cffdd424bfac1b0c3bdea) [RVOAgentBurst.cs:1261] Pathfinding.RVO.Sampled.JobRVO`1<Pathfinding.RVO.XZMovementPlane>::Pathfinding.RVO.Sampled.JobRVO`1<Pathfinding.RVO.XZMovementPlane>.ExecuteORCA 
0x00007ffa87efb79a (324e4a9a65cffdd424bfac1b0c3bdea) [IJobParallelForBatched.cs:35] Pathfinding.Jobs.JobParallelForBatchedExtensions.ParallelForBatchJobStruct`1<Pathfinding.RVO.Sampled.JobRVO`1<Pathfinding.RVO.XZMovementPlane>>.Execute 
0x00007ffa87efb171 (324e4a9a65cffdd424bfac1b0c3bdea) 906909cd62835d28eb9a35bbf6591c6e
0x00007ff616b26d10 (Unity) ExecuteJob
0x00007ff616b26fc5 (Unity) ExecuteJobCopyData
0x00007ff616b27c1f (Unity) ForwardJobForEachToManaged
0x00007ff616b231ec (Unity) JobQueue::Exec
0x00007ff616b234aa (Unity) JobQueue::ExecuteJobFromHighPriorityStack
0x00007ff616b23a39 (Unity) JobQueue::ProcessJobs
0x00007ff616b25a9f (Unity) JobQueue::WorkLoop
0x00007ff616d1df97 (Unity) Thread::RunThreadWrapper
0x00007ffaeec57034 (KERNEL32) BaseThreadInitThunk
0x00007ffaf0442651 (ntdll) RtlUserThreadStart
System.Exception: Trying to get a span for an unallocated index
This Exception was thrown from a job compiled with Burst, which has limited exception support.
0x00007ffa87f01d04 (324e4a9a65cffdd424bfac1b0c3bdea) [RVOAgentBurst.cs:832] Pathfinding.RVO.Sampled.JobRVO`1<Pathfinding.RVO.XZMovementPlane>::Pathfinding.RVO.Sampled.JobRVO`1<Pathfinding.RVO.XZMovementPlane>.GenerateObstacleVOs 
0x00007ffa87efd04e (324e4a9a65cffdd424bfac1b0c3bdea) [RVOAgentBurst.cs:1261] Pathfinding.RVO.Sampled.JobRVO`1<Pathfinding.RVO.XZMovementPlane>::Pathfinding.RVO.Sampled.JobRVO`1<Pathfinding.RVO.XZMovementPlane>.ExecuteORCA 
0x00007ffa87efb79a (324e4a9a65cffdd424bfac1b0c3bdea) [IJobParallelForBatched.cs:35] Pathfinding.Jobs.JobParallelForBatchedExtensions.ParallelForBatchJobStruct`1<Pathfinding.RVO.Sampled.JobRVO`1<Pathfinding.RVO.XZMovementPlane>>.Execute 
0x00007ffa87efb171 (324e4a9a65cffdd424bfac1b0c3bdea) 906909cd62835d28eb9a35bbf6591c6e
0x00007ff616b26d10 (Unity) ExecuteJob
0x00007ff616b26fc5 (Unity) ExecuteJobCopyData
0x00007ff616b27c1f (Unity) ForwardJobForEachToManaged
0x00007ff616b231ec (Unity) JobQueue::Exec
0x00007ff616b234aa (Unity) JobQueue::ExecuteJobFromHighPriorityStack
0x00007ff616b23a39 (Unity) JobQueue::ProcessJobs
0x00007ff616b25a9f (Unity) JobQueue::WorkLoop
0x00007ff616d1df97 (Unity) Thread::RunThreadWrapper
0x00007ffaeec57034 (KERNEL32) BaseThreadInitThunk
0x00007ffaf0442651 (ntdll) RtlUserThreadStart

this link is the complete log file : https://drive.google.com/file/d/1Sg1WBzwOTPcFCSAUDb4V6bHkiJIGLmRi/view?usp=sharing

That’s odd. You are using a grid graph, right?
Would it be possible for you to share an example scene in which it can be reproduced?
I have not been able to reproduce it locally.