Burst errors in beta 4.3.55

Hi. I recently updated to 4.3.52 and since then have been getting some burst errors and some RVO errors.
I have gotten the same issues in 4.3.54 and 4.3.55 as well.
I’m using Burst 1.7.2 and unity 2021.3.4f1

It seems to occur right when agents start to travel on a nodelink2. They still manage to find paths correctly and get to where they should even after getting the errors, but it seems to impact performance when it happens to several agents at about the same time. The RVO errors occur when multiple agents arrive at the same time and is possibly related to only being allowed to use the link one at a time and waiting near the start point while fighting over positioning.

  • 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.
    0x00007ffa45acbf6c (38ffbc17fa9afd68e7521c5da17fc8d) [unknown:0] Unity.Jobs.IJobExtensions.JobStruct`1<Pathfinding.RVO.RVOObstacleCache.TraceContoursJob>.Execute

  • 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.
    0x00007ffa33967acd (b8d0d068536fa62c1f08a00766d8412) [RVOAgentBurst.cs:1146] Pathfinding.RVO.Sampled.JobRVO1<Pathfinding.RVO.XZMovementPlane>::Pathfinding.RVO.Sampled.JobRVO1<Pathfinding.RVO.XZMovementPlane>.GenerateObstacleVOs
    0x00007ffa33962e2e (b8d0d068536fa62c1f08a00766d8412) [RVOAgentBurst.cs:1261] Pathfinding.RVO.Sampled.JobRVO1<Pathfinding.RVO.XZMovementPlane>::Pathfinding.RVO.Sampled.JobRVO1<Pathfinding.RVO.XZMovementPlane>.ExecuteORCA
    0x00007ffa3396159a (b8d0d068536fa62c1f08a00766d8412) [IJobParallelForBatched.cs:35] Pathfinding.Jobs.JobParallelForBatchedExtensions.ParallelForBatchJobStruct1<Pathfinding.RVO.Sampled.JobRVO1<Pathfinding.RVO.XZMovementPlane>>.Execute

  • IndexOutOfRangeException: Index was outside the bounds of the array.
    Pathfinding.Util.SlabAllocator`1[T].Free (System.Int32 allocatedIndex) (at Library/PackageCache/com.arongranberg.astar@4.3.55/Utilities/SlabAllocator.cs:180)
    Pathfinding.RVO.RVOObstacleCache.FreeUnusedObstacles (Pathfinding.RVO.SimulatorBurst+AgentData& agentData, Pathfinding.RVO.SimulatorBurst+ObstacleData& obstacleData, System.Int32 numAgents) (at Library/PackageCache/com.arongranberg.astar@4.3.55/Core/RVO/RVOObstacleCache.cs:56)
    Pathfinding.RVO.SimulatorBurst.UpdateInternal[T] () (at Library/PackageCache/com.arongranberg.astar@4.3.55/Core/RVO/RVOCoreSimulatorBurst.cs:1156)
    Pathfinding.RVO.SimulatorBurst.Update () (at Library/PackageCache/com.arongranberg.astar@4.3.55/Core/RVO/RVOCoreSimulatorBurst.cs:1110)
    Pathfinding.RVO.RVOSimulator.Update () (at Library/PackageCache/com.arongranberg.astar@4.3.55/RVO/RVOSimulator.cs:135)

  • Exception: Trying to free an already freed index
    Pathfinding.Util.SlabAllocator`1[T].Free (System.Int32 allocatedIndex) (at Library/PackageCache/com.arongranberg.astar@4.3.55/Utilities/SlabAllocator.cs:187)
    Pathfinding.RVO.RVOObstacleCache.FreeUnusedObstacles (Pathfinding.RVO.SimulatorBurst+AgentData& agentData, Pathfinding.RVO.SimulatorBurst+ObstacleData& obstacleData, System.Int32 numAgents) (at Library/PackageCache/com.arongranberg.astar@4.3.55/Core/RVO/RVOObstacleCache.cs:56)
    Pathfinding.RVO.SimulatorBurst.UpdateInternal[T] () (at Library/PackageCache/com.arongranberg.astar@4.3.55/Core/RVO/RVOCoreSimulatorBurst.cs:1156)
    Pathfinding.RVO.SimulatorBurst.Update () (at Library/PackageCache/com.arongranberg.astar@4.3.55/Core/RVO/RVOCoreSimulatorBurst.cs:1110)
    Pathfinding.RVO.RVOSimulator.Update () (at Library/PackageCache/com.arongranberg.astar@4.3.55/RVO/RVOSimulator.cs:135)

  • System.IndexOutOfRangeException:
    This Exception was thrown from a job compiled with Burst, which has limited exception support.
    0x00007ffa339679dd (b8d0d068536fa62c1f08a00766d8412) [RVOAgentBurst.cs:1146] Pathfinding.RVO.Sampled.JobRVO1<Pathfinding.RVO.XZMovementPlane>::Pathfinding.RVO.Sampled.JobRVO1<Pathfinding.RVO.XZMovementPlane>.GenerateObstacleVOs
    0x00007ffa33962e2e (b8d0d068536fa62c1f08a00766d8412) [RVOAgentBurst.cs:1261] Pathfinding.RVO.Sampled.JobRVO1<Pathfinding.RVO.XZMovementPlane>::Pathfinding.RVO.Sampled.JobRVO1<Pathfinding.RVO.XZMovementPlane>.ExecuteORCA
    0x00007ffa3396159a (b8d0d068536fa62c1f08a00766d8412) [IJobParallelForBatched.cs:35] Pathfinding.Jobs.JobParallelForBatchedExtensions.ParallelForBatchJobStruct1<Pathfinding.RVO.Sampled.JobRVO1<Pathfinding.RVO.XZMovementPlane>>.Execute

1 Like

Hi

I haven’t been able to replicate this, though I did find some somewhat unrelated bugs in 4.3.55. Do you think you could try in 4.3.56 and see if you can replicate it?

I just gave 4.3.56 a try. The errors now happen inconsistently rather than all the time so its seems to be a move in the right direction.

There is also another issue I’m seeing now though and I’m not sure if it was there in the previous versions or not. Possibly related, possibly not, but it shows up when I start the game in editor.

A Native Collection has not been disposed, resulting in a memory leak. Allocated from:
Unity.Collections.NativeList1:.ctor(AllocatorHandle) (at Library\PackageCache\com.unity.collections@1.4.0\Unity.Collections\NativeList.cs:106) Pathfinding.NavmeshCut:CalculateMeshContour() (at Library\PackageCache\com.arongranberg.astar@4.3.56\Navmesh\NavmeshCut.cs:373) Pathfinding.NavmeshCut:GetContourBurst(UnsafeList1*, UnsafeList`1*, Matrix4x4, Single) (at Library\PackageCache\com.arongranberg.astar@4.3.56\Navmesh\NavmeshCut.cs:517)

If there is any other information I can get you that would help you find the problems feel free to let me know.

Hi

Can you replicate this in any of the example scenes?

Sure, I can give it a try. Might take me a bit though.

So I gave the recast2 example scene a try and didn’t encounter the issues at first so I started adjusting things until they showed up again. Took a bit but I did manage to trigger it. Tomorrow I’m going to try and trim out as much as possible until I have the bare minimum that will trigger it and I’ll try to get back to you.

1 Like

Ok. I trimmed out everything specific to my game and have a scene using only components from unity and this package. The errors seem to trigger consistently but also now for some reason a frame or two after them the editor locks up and I have to kill the process.

I’ve assembled a number of pictures and details to recreate it or I can try to send you a copy of the scene if there is an easy way to do that. Not sure if there are any rules about linking stuff so figured I would wait on that.

Pathfinding Issues
Here is what it looked like at the point where the errors occurred and the editor locked up.



The base is part of the floor from the recast 2 example scene.
Below is the pathfinding settings and rvo simulator settings
Only the floor is set to a layer that the pathfinder will automatically generate a graph for, the large cube and piece coming off it are both added with NavmeshAdd components.


Pathfinding Issues 8

The large cube has a navmesh cut on it to trim the area around the cube

A separate object has a NavmeshAdd and GraphUpdateScene along with the collider.

At the top of the large cube is a smaller piece sticking out from the top. It also has a navmeshAdd, graphUpdateScene, and a collider and it hangs out over the cut area but above the cut height. It is positioned just right to link in to the area added to the large cube.


A Link2 Component links from the ground to the top of the side piece.

There are then 9 agents with the AI destination setter from the example project (The target is on top of the large block). They also have a RVO Controller, Seeker, and RichAI.


Hi

If you could send me a repro, that’d be amazing!

Here you go. This is the file for the test scene I put together. Just change the extension back to .unity and put it in a test project.

I just tested it with a fresh project, only needs the latest beta and the samples to run and still triggers the issues. I hope it helps.

RecastTestScene.txt (91.4 KB)

I was wondering if I could get an update on this issue. Were you able to reproduce the problems using the test scene I sent?

Hi

Yes, I managed to reproduce it, but I haven’t quite figured out why it happens.

I think that you have multpiple NavmeshAdd component that cause multiple identical triangles to be added to the navmesh. And this is causing the script to fail.

1 Like

I have uploaded a workaround in version 4.3.56. Should get rid of the errors.

1 Like

Thanks for the help. It all seems to be working properly now!

1 Like