Job/Burst exception 5.2.0/5.2.2

This error started with 5.2.0, i’m using grid graph and 5.2.2 of A*.
It happens at random.

System.IndexOutOfRangeException: Invalid allocation -2
This Exception was thrown from a job compiled with Burst, which has limited exception support.
0x00007ffb2a10c91e (Unity) burst_abort
0x00007ffb27c5965e (ffcc55a5d2e6d721bad390e67bfdb09) burst_Abort_Trampoline
0x00007ffb27b852aa (ffcc55a5d2e6d721bad390e67bfdb09) Pathfinding.Collections.SlabAllocator1<int>.GetSpan (at C:/Unity/Dungeon of Sacrifices/Library/PackageCache/com.unity.burst@616862665d8c/.Runtime/Packages/com.arongranberg.astar/Core/Collections/SlabAllocator.cs:118) 0x00007ffb27b89761 (ffcc55a5d2e6d721bad390e67bfdb09) Pathfinding.NavmeshEdges.NavmeshBorderData.GetHierarchicalNodesInRangeRec (at C:/Unity/Dungeon of Sacrifices/Library/PackageCache/com.unity.burst@616862665d8c/.Runtime/Packages/com.arongranberg.astar/Core/Misc/NavmeshEdges.cs:305) 0x00007ffb27c4b3be (ffcc55a5d2e6d721bad390e67bfdb09) Pathfinding.RVO.JobRVO1<Pathfinding.RVO.XYMovementPlane>.GenerateObstacleVOs (at C:/Unity/Dungeon of Sacrifices/Library/PackageCache/com.unity.burst@616862665d8c/.Runtime/Packages/com.arongranberg.astar/Core/RVO/RVOAgentBurst.cs:757)
0x00007ffb27c46e95 (ffcc55a5d2e6d721bad390e67bfdb09) Pathfinding.RVO.JobRVO1<Pathfinding.RVO.XYMovementPlane>.ExecuteORCA (at C:/Unity/Dungeon of Sacrifices/Library/PackageCache/com.unity.burst@616862665d8c/.Runtime/Packages/com.arongranberg.astar/Core/RVO/RVOAgentBurst.cs:1194) 0x00007ffb27c456e6 (ffcc55a5d2e6d721bad390e67bfdb09) 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_07769c0b0fc68aa9ff91cfb52ac11f70 from AstarPathfindingProject, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null (at C:/Unity/Dungeon of Sacrifices/Library/PackageCache/com.unity.burst@616862665d8c/.Runtime/Packages/com.arongranberg.astar/Utilities/IJobParallelForBatched.cs:42)
0x00007ffb27c4457d (ffcc55a5d2e6d721bad390e67bfdb09) 9b3ed56cac782ae62fc5e12a2c13c1b1
0x00007ffb2a108ff5 (Unity) ExecuteJob
0x00007ffb2a10931e (Unity) ExecuteJobCopyData
0x00007ffb2a106546 (Unity) ujob_execute_job
0x00007ffb2a1056ff (Unity) lane_guts
0x00007ffb2a108344 (Unity) worker_thread_routine
0x00007ffb2a2fe9cd (Unity) Thread::RunThreadWrapper
0x00007ffb9a5c257d (KERNEL32) BaseThreadInitThunk
0x00007ffb9bd4af28 (ntdll) RtlUserThreadStart

Hi there just a quick troubleshooting question; there were a lot of changes recently, and 5.2.2 explicitly needs to be re-installed with the old versions fully removed. Give that a try? And if you have already/did before upgrading, let us know and I’ll see what can be found on this :+1:

Yes, removed and reinstalled. I was one of guys that reported the 5.2 installation problem.

Hi

Does this happen only in standalone games, or also in the editor?
Do you have any somewhat reliable way of replicating the issue?

In the editor, I typically get around 15-30 errors at once, but there don’t seem to be any visible issues in the game—it appears to be working fine. The errors are thrown by the NPCs, but I haven’t been able to find the root cause. I even made a pointless video…

Seems that happen on death of NPC/objects, tomorrow i’ll try to find the smoking gun

Hi

It’s most likely happening when dynamic obstacles are being moved/added/removed.
If you can reliably replicate it, I would be very interested in a test project so that I can replicate it too.

Investigating the problem: it occurs when I destroy objects (like vases, for example) and call UpdateGraphs to update the area under the object as walkable again.

var guo = new GraphUpdateObject(bounds);
AstarPath.active.UpdateGraphs(guo, 1);

If, after calling UpdateGraphs, I kill some NPCs, the error might happen.

If I don’t call UpdateGraphs (I comment it out), I can destroy as many enemies as I want without errors. Does this help? Because creating an example is not easy.

PS: using follower entity in 2d and gridgraph

Found the issue! Some time ago, I tried using Dynamic Obstacles and enabled “Use Navmesh as Obstacles” in the RVO Simulator.

I’m no longer using Dynamic Obstacles, but that setting was still active. It seems that in version 5.2, this flag is causing the bug, even though I don’t have any Dynamic Obstacles anymore.

Without that flag Is all ok

I have same error too.
It happens when my character tries to build structures.
I haven’t used any Dynamic Obstacles but it shows same error.
I’m using 5.2.3

In rvo simulator try to uncheck “Use Navmesh as Obstacles”

Thank you for reply.
I really hope it works.
The error seems to occur irregularly and sometimes during gameplay after building the game.
It seems to happen especially during the first playthrough.

Hi

Which movement script do you use? The Follower Entity movement script, or some other component that uses the RVOController?

Follower Entity with Raycast Graph.
I think it works by unchecking “Use Navmesh as Obstacles”.
But it makes the monsters jitter when they are close together.

Hi

If you have a way to replicate the error, I would very much appreciate a test project that shows the issue. :slight_smile:
I have not been able to replicate this in my own project.

I tested with 5.2.4 and it still happens.
It occurs irregularly.
So I turned off Use Navemesh as Obstacles again. :frowning:
I will try to record video.

Thanks.
A video will likely be of little help, I’m afraid. But a test project where it can be replicated would be amazing.