* Melchior FRANZ -- Thursday 13 April 2006 17:06:
> Can we *please* finally fix the notorious crashes in tower.cxx?

And, yes, I really meant "we". But as it looks, I'm pretty much on my
own (apart from Olaf who did a lot of the hard work already).

Now the cause for the segfault is proven. I've added some debug
messages, and found that not only aircraft are at the same time in
several state lists, such as:

 - depList circuitList trafficList
 - rwyList vacatedList
 - holdList vacatedList trafficList     (quite frequent combination!)
 - circuitList vacatedList trafficList
 - holdList rwyList vacatedList trafficList
 - appList trafficList

where each of the lines is one list combination for one aircraft
during a one-hour test. But it's just an ugly bug, and wouldn't cause
a crash. But this beats them all:

 - circuitList holdList vacatedList trafficList trafficList

trafficList twice? That's a crash-condition! FGTower::RemovePlane()
removes an aircraft once from each list (which is a design bug already)
and then deletes the associated TowerPlaneRec! And when the code processes
the other trafficList entry for that same aircraft, the pointer points
to invalid memory. Everything can happen now. Quite often it's a crash.

If nobody is willing to fix it properly, then I'll commit a crude
workaround for this crash condition today at 2400. It won't fix
the broken list shuffling, but only sweep the dirt deeper under the
rug. I'm afraid the code can really only be fixed by its author.

m.


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to