Alex Romosan writes:
> Alex Romosan writes:
>
> > i haven't been able to use flightgear for the past couple of days as
> > it crashes in FGAIPlane::Update(double) (actually it doesn't quite
> > crash, the sim just freezes and i have to kill it from the command
> > prompt). this is the gdb backtrace:
> >
> > 0x080d49fe in FGAIPlane::Update(double) (this=0xd4dee98,
> > dt=0.039636999999999999) at AIPlane.cxx:124
> > 124 while((track - _tgtTrack) > 180.0) track -= 360.0;
> > (gdb) where
> > #0 0x080d49fe in FGAIPlane::Update(double) (this=0xd4dee98,
> > dt=0.039636999999999999) at AIPlane.cxx:124
> > #1 0x080a9e1a in FGAIGAVFRTraffic::Update(double) (this=0xd4dee98,
> > dt=0.039636999999999999) at AIGAVFRTraffic.cxx:116
> > #2 0x0809df5c in FGAIMgr::update(double) (this=0x92efae8,
> > dt=0.039636999999999999) at AIMgr.cxx:307
> > #3 0x0805b82e in fgMainLoop () at globals.hxx:263
> > #4 0x4020c84a in glutMainLoop () from /usr/local/lib/libglut.so.3
> > #5 0x0805df18 in fgMainInit(int, char**) (argc=1, argv=0xbffff614)
> > at main.cxx:1706
> > #6 0x080588f9 in main (argc=223221810, argv=0xd4e1832) at bootstrap.cxx:139
> >
> > i haven't tried to understand the code yet, as i am hoping a more
> > knowledgeable person will figure out what's happening and fix it. thanks.
>
> i looked at the code in AIPlane.cxx:122
>
> if(_trackSet) {
> while((_tgtTrack - track) > 180.0) track += 360.0;
> while((track - _tgtTrack) > 180.0) track -= 360.0;
> double turn_time = 60.0;
> track += (360.0 / turn_time) * dt * (_tgtTrack > track ? 1.0 : -1.0);
> Bank(25.0 * (_tgtTrack > track ? 1.0 : -1.0));
>
> track is defined as a protected member but i can't figure out where
> it's set prior to this. it's not initialized in the constructor
> (should it be set to zero?), or from anywhere else. when the program
> crashes, track has some huge value. is it garbage? this code was added
> in the last revision, so i am sure this is what is causing the crash.
>
Oops, thanks for the catch, the machine I tested it on (Cygwin) must have been
initialising to zero, I was wondering why Flightgear was freezing on my Linux box on
the last update!!
I'll commit a fix tomorrow.
Cheers - Dave
_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel