#1706: Path-finding race conditions
---------------------------+------------------------------------------------
Reporter: Per | Owner:
Type: bug | Status: new
Priority: minor | Milestone: 3.0
Component: Engine: other | Version: svn/trunk
Keywords: path-finding | Operating_system: All/Non-Specific
Blockedby: | Blocking:
---------------------------+------------------------------------------------
There are some race conditions in the threaded path-finding code.
The first is when we close down a game, the map may be cleared before the
path-finding thread is closed down. This can be solved simply by closing
down the path-finding before tearing down the map, since we join the
thread there.
The second is a bit harder to fix. In the fpathBaseBlockingTile() function
the psTile->psObject pointer is dereferenced, and this is called very
frequently from the path-finding thread. If this object is reaped while
the path-finding thread is busy looking at it, very bad things can happen.
The solution is probably to cache all the data needed instead of
dereferencing a pointer to get at this info.
Both bugs are more theoretical constructs than seen in actual crash
reports at this point, but the design here needs to be fixed and huge
warning signs put up in fpath.c to avoid this kind of thing in the future.
--
Ticket URL: <http://developer.wz2100.net/ticket/1706>
Warzone 2100 Trac <http://developer.wz2100.net/>
The Warzone 2100 Project
_______________________________________________
Warzone-dev mailing list
[email protected]
https://mail.gna.org/listinfo/warzone-dev