On Sun, 2008-10-19 at 12:27 +0100, James Turner wrote: > On 18 Oct 2008, at 22:30, Alasdair Campbell wrote: > > > I wonder if anyone can confirm the following strange behaviour or give > > me me a hint as to where to start looking? If I start up either the > > CitatationX or the Bravo at EGPF (my local airport), on selecting > > Autostart, fgfs gives me a segfault. Any other airport, everything > > works > > perfectly. I am using a fresh checkout of today's Simgear, FG source > > and > > data. You don't need the UK scenery to demonstrate this fault. > > > > dominatrix:~>fgfs --aircraft=CitationX --airport=EGPF > > FGMultiplayMgr - No receiver port, Multiplayermode disabled > > Electrical System ... ok > > Flight Director ...Check > > Primus 1000 systems ... check > > Segmentation fault > > Yep, I'm getting this as well at EGPF, with either Citation. It's > something to do with my FGPositioned changes, and *seems* to be > related to the KLN89b / DCLGPS code - except as far as I can tell, > neither Citation uses the KLN89b - in fact, the only aircraft that > does is one of the c172 variants. > > I sort of assume it must happen at other airports, but since I often > fly locally around that area, EGPF is always where i get it. Oh, it > also crashes if you arrive at EGPF from outside - I did a flight > around the western isles and down over Loch Lomond, and as I was > manoeuvring to intercept the localiser of one of the runways, got the > exact same crash. So it's something pretty weird. > > If it really is *only* EGPF that has this issue, that's even more > weird, of course. Anyway, I am pretty sure this is my fault, I will > dig into it tonight. > > James > James, Having patched the code to correct the lat/long problem, I have debugged src/Instrumentation/mkviii.cxx, which is causing the crash, by putting some debug couts in there. Here is my output:
dominatrix:~>fgfs FGMultiplayMgr - No receiver port, Multiplayermode disabled Electrical System ... ok Flight Director ...Check Primus 1000 systems ... check ***********ALI in MK_VIII::TCFHandler::update_runway(), looking for airport close to lat 55.872 lon -4.42762 ***********ALI in MK_VIII::TCFHandler::update_runway(), closest airport is EGPF Glasgow ***********ALI in MK_VIII::TCFHandler::update_runway(), calling select_runway(airport, _runway) with _runway pointer = 0 ****ALI in select_runway, called with _runway pointer = 0 ****ALI in select_runway, Looking at the 4 runways at EGPF ****ALI in select_runway, Looking at runway heading 46.34 diff is 141.747 ****ALI in select_runway, setting _runway pointer to 0xb954280 ****ALI in select_runway, Looking at runway heading 226.34 diff is 38.2533 ****ALI in select_runway, setting _runway pointer to 0xb954340 ****ALI in select_runway, Looking at runway heading 91.15 diff is 179.993 ****ALI in select_runway, Looking at runway heading 271.15 diff is 0.00694406 ****ALI in select_runway, setting _runway pointer to 0xb954460 ****ALI in select_runway, final _runway pointer is 0xb954460 ...returning ***********ALI in MK_VIII::TCFHandler::update_runway(), returned from select_runway(airport, _runway) with _runway pointer = 0 Segmentation fault dominatrix:~> As we can see, the address of _runway is set up within select_runway(airport, _runway), but is no longer valid (NULL) when control is returned to the caller. Hence the crash at the following line, 4545 runway.center.latitude = _runway->latitude(); I don't know how to fix this. Alasdair > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Flightgear-devel mailing list > Flightgear-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/flightgear-devel ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel