System.IndexOutOfRangeException

Hi, sometimes I encounter errors while using version 5.0.2. These errors occur when one of my agents gets stuck against a wall due to a faulty wandering algorithm (opsive behavior task), and the task is aborted by another event, such as the player coming into sight.

System.IndexOutOfRangeException: Invalid allocation -2
This Exception was thrown from a job compiled with Burst, which has limited exception support.
0x00007fff4d813cee (1a0fd5bfef67df1501a87861af5f5d7) burst_Abort_Trampoline
0x00007fff4d7e0a6a (1a0fd5bfef67df1501a87861af5f5d7) Pathfinding.Util.SlabAllocator1<int>.GetSpan (at C:/Unity/Dungeon of Sacrifices/Library/PackageCache/com.unity.burst@1.8.12/.Runtime/Library/PackageCache/com.arongranberg.astar@5.0.2/Core/Collections/SlabAllocator.cs:99) 0x00007fff4d7d6561 (1a0fd5bfef67df1501a87861af5f5d7) Pathfinding.NavmeshEdges.NavmeshEdgeData.GetHierarchicalNodesInRangeRec (at C:/Unity/Dungeon of Sacrifices/Library/PackageCache/com.unity.burst@1.8.12/.Runtime/Library/PackageCache/com.arongranberg.astar@5.0.2/Core/Misc/NavmeshEdges.cs:296) 0x00007fff4d80c56e (1a0fd5bfef67df1501a87861af5f5d7) Pathfinding.RVO.JobRVO1<Pathfinding.RVO.XYMovementPlane>.GenerateObstacleVOs (at C:/Unity/Dungeon of Sacrifices/Library/PackageCache/com.unity.burst@1.8.12/.Runtime/Library/PackageCache/com.arongranberg.astar@5.0.2/Core/RVO/RVOAgentBurst.cs:756)
0x00007fff4d80829b (1a0fd5bfef67df1501a87861af5f5d7) Pathfinding.RVO.JobRVO1<Pathfinding.RVO.XYMovementPlane>.ExecuteORCA (at C:/Unity/Dungeon of Sacrifices/Library/PackageCache/com.unity.burst@1.8.12/.Runtime/Library/PackageCache/com.arongranberg.astar@5.0.2/Core/RVO/RVOAgentBurst.cs:1193) 0x00007fff4d806ab6 (1a0fd5bfef67df1501a87861af5f5d7) Pathfinding.Jobs.JobParallelForBatchedExtensions.ParallelForBatchJobStruct1<Pathfinding.RVO.JobRVO1<Pathfinding.RVO.XYMovementPlane>>.Execute(ref Pathfinding.RVO.JobRVO1<Pathfinding.RVO.XYMovementPlane> jobData, System.IntPtr additionalPtr, System.IntPtr bufferRangePatchData, ref Unity.Jobs.LowLevel.Unsafe.JobRanges ranges, int jobIndex) → void_366f5f75f0320845b09a740097d7a3cf from AstarPathfindingProject, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null (at C:/Unity/Dungeon of Sacrifices/Library/PackageCache/com.unity.burst@1.8.12/.Runtime/Library/PackageCache/com.arongranberg.astar@5.0.2/Utilities/IJobParallelForBatched.cs:42)
0x00007fff4d8062ed (1a0fd5bfef67df1501a87861af5f5d7) 9b3ed56cac782ae62fc5e12a2c13c1b1
0x00007ff748591292 (Unity) ExecuteJob
0x00007ff748591604 (Unity) ExecuteJobCopyData
0x00007ff74859233f (Unity) ForwardJobForEachToManaged
0x00007ff74858e71d (Unity) ujob_execute_job
0x00007ff74858d92d (Unity) lane_guts
0x00007ff748590514 (Unity) worker_thread_routine
0x00007ff7487bd876 (Unity) Thread::RunThreadWrapper
0x00007fffa645257d (KERNEL32) BaseThreadInitThunk
0x00007fffa7d8aa58 (ntdll) RtlUserThreadStart

Hi

I believe this is due to a race condition which I already have a fix for. This fix will be included in the next release (5.0.4).

2 Likes