Support Forum

Astar crash in editor and builds

Unity v2021.3.9f1 - BIRP
astar v4.2.17
Windows 10 pro 64bit

Just starting to get crashes in both the editor and builds.
The crashes immediately shutdown both, there is no crash window.
The player log does capture an exception, which looks like it starts here:

It goes on to repeat the FlipEdgeEvent and FlipScanEdgeEvent entries about a million times.

Path Completed : Computation Time 0.00 ms Searched Nodes 6 Path Length 2
Path Number 1264 (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 D:/__UnityProjects/SOI_2020.3.8f1_LTS_v2021/SOI_2020.3.8f1_LTS_v2021/Assets/AstarPathfindingProject/Core/AstarPath.cs:837)
AstarPath:<InitializePathProcessor>b__122_1 (Pathfinding.Path) (at D:/__UnityProjects/SOI_2020.3.8f1_LTS_v2021/SOI_2020.3.8f1_LTS_v2021/Assets/AstarPathfindingProject/Core/AstarPath.cs:1301)
Pathfinding.PathProcessor:CalculatePathsThreaded (Pathfinding.PathHandler) (at D:/__UnityProjects/SOI_2020.3.8f1_LTS_v2021/SOI_2020.3.8f1_LTS_v2021/Assets/AstarPathfindingProject/Core/Misc/PathProcessor.cs:379)
Pathfinding.PathProcessor/<>c__DisplayClass24_0:<.ctor>b__0 () (at D:/__UnityProjects/SOI_2020.3.8f1_LTS_v2021/SOI_2020.3.8f1_LTS_v2021/Assets/AstarPathfindingProject/Core/Misc/PathProcessor.cs:110)
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: D:/__UnityProjects/SOI_2020.3.8f1_LTS_v2021/SOI_2020.3.8f1_LTS_v2021/Assets/AstarPathfindingProject/Core/AstarPath.cs Line: 837)

PointOnEdgeException, perturbating vertices slightly.
This is usually fine. It happens sometimes because of rounding errors. Cutting will be retried a few more times.
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:LogWarning (object)
Pathfinding.Util.TileHandler:CutPoly (Pathfinding.Int3[],int[],Pathfinding.Int3[],Pathfinding.Util.GraphTransform,Pathfinding.IntRect,Pathfinding.Util.TileHandler/CutMode,int) (at D:/__UnityProjects/SOI_2020.3.8f1_LTS_v2021/SOI_2020.3.8f1_LTS_v2021/Assets/AstarPathfindingProject/Generators/Utilities/TileHandler.cs:680)
Pathfinding.Util.TileHandler/<>c__DisplayClass41_0:<LoadTile>b__0 (Pathfinding.IWorkItemContext,bool) (at D:/__UnityProjects/SOI_2020.3.8f1_LTS_v2021/SOI_2020.3.8f1_LTS_v2021/Assets/AstarPathfindingProject/Generators/Utilities/TileHandler.cs:1154)
Pathfinding.WorkItemProcessor:ProcessWorkItems (bool) (at D:/__UnityProjects/SOI_2020.3.8f1_LTS_v2021/SOI_2020.3.8f1_LTS_v2021/Assets/AstarPathfindingProject/Core/Misc/WorkItemProcessor.cs:300)
AstarPath:PerformBlockingActions (bool) (at D:/__UnityProjects/SOI_2020.3.8f1_LTS_v2021/SOI_2020.3.8f1_LTS_v2021/Assets/AstarPathfindingProject/Core/AstarPath.cs:881)
AstarPath:Update () (at D:/__UnityProjects/SOI_2020.3.8f1_LTS_v2021/SOI_2020.3.8f1_LTS_v2021/Assets/AstarPathfindingProject/Core/AstarPath.cs:864)

(Filename: D:/__UnityProjects/SOI_2020.3.8f1_LTS_v2021/SOI_2020.3.8f1_LTS_v2021/Assets/AstarPathfindingProject/Generators/Utilities/TileHandler.cs Line: 680)

StackOverflowException: The requested operation caused a stack overflow.
  at Pathfinding.Poly2Tri.FixedArray3`1[T].IndexOf (T value) [0x00007] in <07aca9e84ffe412bbfb50d0962eb64f2>:0 
  at Pathfinding.Poly2Tri.DelaunayTriangle.IndexOf (Pathfinding.Poly2Tri.TriangulationPoint p) [0x00000] in <07aca9e84ffe412bbfb50d0962eb64f2>:0 
  at Pathfinding.Poly2Tri.DelaunayTriangle.PointCWFrom (Pathfinding.Poly2Tri.TriangulationPoint point) [0x00000] in <07aca9e84ffe412bbfb50d0962eb64f2>:0 
  at Pathfinding.Poly2Tri.DelaunayTriangle.OppositePoint (Pathfinding.Poly2Tri.DelaunayTriangle t, Pathfinding.Poly2Tri.TriangulationPoint p) [0x00000] in <07aca9e84ffe412bbfb50d0962eb64f2>:0 
  at Pathfinding.Poly2Tri.DTSweep.FlipScanEdgeEvent (Pathfinding.Poly2Tri.DTSweepContext tcx, Pathfinding.Poly2Tri.TriangulationPoint ep, Pathfinding.Poly2Tri.TriangulationPoint eq, Pathfinding.Poly2Tri.DelaunayTriangle flipTriangle, Pathfinding.Poly2Tri.DelaunayTriangle t, Pathfinding.Poly2Tri.TriangulationPoint p) [0x0000a] in <07aca9e84ffe412bbfb50d0962eb64f2>:0 
  at Pathfinding.Poly2Tri.DTSweep.FlipEdgeEvent (Pathfinding.Poly2Tri.DTSweepContext tcx, Pathfinding.Poly2Tri.TriangulationPoint ep, Pathfinding.Poly2Tri.TriangulationPoint eq, Pathfinding.Poly2Tri.DelaunayTriangle t, Pathfinding.Poly2Tri.TriangulationPoint p) [0x00115] in <07aca9e84ffe412bbfb50d0962eb64f2>:0 
  at Pathfinding.Poly2Tri.DTSweep.FlipScanEdgeEvent (Pathfinding.Poly2Tri.DTSweepContext tcx, Pathfinding.Poly2Tri.TriangulationPoint ep, Pathfinding.Poly2Tri.TriangulationPoint eq, Pathfinding.Poly2Tri.DelaunayTriangle flipTriangle, Pathfinding.Poly2Tri.DelaunayTriangle t, Pathfinding.Poly2Tri.TriangulationPoint p) [0x00066] in <07aca9e84ffe412bbfb50d0962eb64f2>:0 

Hi

This is a bug in a third party library I’m using. Sadly, I don’t have a great solution at the moment, but this is usually caused by navmesh cuts that are either setup incorrectly, or have overlapping vertices/edges. Do you think that might be the case for your scene?

Yes kind of like the navmeshcut demo scene where you drop tons of individual blocks, I have scenarios where I have a bunch of logs that can end up in a pile and each log has navmeshcut. For now I’ve turned navmeshcut off which isn’t ideal.

Is there no way to at least catch the error? I’d rather have navmeshcut fail on the offending object and just not get cut than have a known game closing crash left in.

Speaking of the demo does the error never happen there? It seems to be the same scenario.