A* Pathfinding Project

A* Pathfinding project crashing game in build



We’ve been using this pathfinding solution for quite a while now and it has always worked well. Now however I’ve run into an issue with A* pathfinding crashing the project in build. As we’ve also been in contact with unity about the crashes, as we’ve had some problems with unity bugs, they helped us dig up some more about the error. It seems to have to do with a memcpy happening on the pathing thread. We haven’t been able to generate a crash dump from it. But we’ve been able to get a call stack. Anyone know wha this could be, and how to solve it?

The version of Unity being used, 2018.4.3f1.
Version of A* pathfinding project: 4.2.5

Crash Callstack:

UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
AstarPath:LogPathResults(Path) (at Assets\AstarPathfindingProject\Core\AstarPath.cs:835)
AstarPath:<InitializePathProcessor>b__122_1(Path) (at Assets\AstarPathfindingProject\Core\AstarPath.cs:1297)
Pathfinding.PathProcessor:CalculatePathsThreaded(PathHandler) (at Assets\AstarPathfindingProject\Core\Misc\PathProcessor.cs:386)
Pathfinding.<>c__DisplayClass24_0:<.ctor>b__0() (at Assets\AstarPathfindingProject\Core\Misc\PathProcessor.cs:110)
System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)
System.Threading.ExecutionContext:Run(ExecutionContext, ContextCallback, Object, Boolean)
System.Threading.ExecutionContext:Run(ExecutionContext, ContextCallback, Object)



How did you come to the conclusion that it was due to a memcpy?


That conclusion was reached by the Unity engineer working on my support ticket. I’ve submitted an image of what he said, the log at the bottom of the image is just the one i pasted in the previous post. image


The crash seems to specifically trigger when there are a lot of paths that can’t be reached. In our game, the units default to simply walking straight towards their destination, the bird route, without pathfinding if a path couldnt be found. But when it happens over and over again, the crash happens with that stack trace. But the more i look into it, I understand why you’re sounding hesitant that the pathing is to blame here. As the stack trace quite clearly points to a unity debug.log.


Have gotten more information from Unity about the crash. Hopefully this answer from Unity makes more sense to you than the previous call stack i posted.