Series of Path failed warning leads to crash

Hi, I’ve been using A* path for some years now and I’ve recently discovered that the reason some of my users were crashing was seemingly due to Pathfinding.
People are using a VERY wide array of computer specs and some are very good and got crashes, some other the contrary etc…
Basically, activating multithreading in the A*pathfinding object is definitely a game changer and nobody got crashes as soon as I started to do that. But of course it’s less optimized so I’m still obliged to activate it so I put it to automatic low load.

So people now are crashing less often, but still.
And it really seems to happen because of a series of path failed. I get that sometimes my characters can get stuck or else because I did my recast graph not perfectly or else (or that I need to put the character on old because he waits for an elevator and can’t find it until it arrives, for example), but simple warnings leading to a crash is a way bigger issue.

Player.txt (595.6 KB)

(i’ve been using Unity 2017,2018,2019, LWRP and many versions of A* Pathfinding project, I’m on latest pro 4.2.8 currently…)

Any help ?
Thanks :slight_smile:


Sorry for the late answer. I have been traveling and have not been able to answer support requests for some time.

Hmmm… That looks like a bug in Unity as it seems to crash inside a Debug.Log call.
Does your program register to Application.logMessageReceivedThreaded by any chance?

Also. For released application I recommend to turn off path logging (A* inspector -> Settings -> Path Log Mode = None) since logging can be quite slow if you are doing a lot of path requests.

Hi aron,
That’s interesting. I tried to reduce the occasions on which I receive a path failed warnings, and simply that seems to have reduced the frequency of crashes for the most affected users.

(I mean, generally people can get some dozens of pathFailed on a play through and not crashing at all, we’re not talking about hundred of debug lines here).

My program doesn’t register to the logMessageReceivedThreaded. Could it have been a reason for a crash origin or something that might help?

I’ll try turning off path logging, maybe the crashes will vanish. Frankly, I wouldn’t be that surprised.

1 Like

Ok. If you were doing that your code might possibly do something that wasn’t thread safe and thus crashing unity. But this doesn’t seem to be the cause.