[Freeciv-Dev] (PR#11824) Crashing bug
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=11824 >
> [use_less - Thu Jan 13 09:07:38 2005]:
>
> Well, this bug is a lot more complicated than it looks. :)
>
> Basically, the function ai_manage_explorer() is going into an infinite
> recursive loop, which eventually crashes the server. This is caused by
> the fact that the unit exploring tries to get to its exploration
> destination, but its goto fails without using all its moves. This
> causes the function to try to explore again, but it runs into the same
> situation again, and loops around.
Interesting...
So each time the explorer moves, each time it gets stuck and the
move-points don't decrease?
What sort of situation is it? I guess there are two railroads both
blocked by enemies?
> I talked about it with Jason on IRC and he suggested this patch, and
> also to ask Greg about it. Greg?
This patch will cut off too many legitimate cases.
I would go for comparing the move-points instead. This will also cut
off some legitimate cases (tried to move on a railroad but it's blocked
-- worth a retry, unless the other path will also be blocked) which can
be alleviated by controlling depth of the recursion.
so the condition I would go for is
if (our move points didn't decrease in the last 10 recursive calls) {
return;
}
|
|