FlightGear - Attacking a Freeze

back

I was recently asked a simple question -

I am also a fan of flightgear. I use my Laptop (DELL Precision M70) to run the program. My graphic card is NVIDIA Quadro FX Go1400 and windows XP environment.
I use MSVC6 to compile and link flightgear. Your techncial masterial on how to compile and link flightgear with MSVC6 is very helpful. I got no error just some warnings when I got the executable. But when I lanch the executable (fgfs --log-level=bulk), Flightgear freezes when the following messages shown on the screen.
Adding subsystem input
Adding subsystem replay
logging priority is bulk
Enabled all logging classes: terrain|astro|flight|input|gl|view|cockpit|general|math|event|aircraft|autopilot|io|clippe|network|instrumentation|systems.

Do you have any idea why?
thanks

Not much to go on, but it gave me a chance to consider how I would attack such a problem ... Here is my answer, in the hope it will help, and help others who run into something similar ... It gives most of the long list of console outputs when FlightGear is run, but the important point is keeping control ... putting in debug traps, and tracing through sections of the code ...

Friday, 21 October 2005.

Hi Xia Fang,

Unfortunately not really ... some pointer and questions ...

>> launch the executable (fgfs --log-level=bulk)

(a) you should never need bulk log level - debug is
sufficient. That is --log-level=debug

(b) you say fgfs, but the executable built by MSVC6
is normally FlightGear.exe, in the Debug or Release
folder. Which exe are you using, debug or release?

(c) you should add --fg-root=path-to-your-scenery-data,
unless you have set FG_ROOT in the environment.

After carefully running FG, step by step, in the
debugger, I eventually reached your CONSOLE messages ...

Following is the LONG list of outputs, when
I run FlightGear, with log level debug, as mentioned,
the first set of messages I see are -

Logging priority is debug
Processing command line arguments
Finished command line arguments
Initializing splash screen
GDI Generic
Max texture size = 1024
Depth buffer bits = 32
PresetInit LFPO
Loading Airport Database ...
Data file version = 715

At this point there is a LONG pause while it
loads the apt.dat.gz file ... If you use bulk,
it would output EVERY LINE from this file,
thousands of lines in fact ...
and takes a lot more time ... eventually the
console messages continue -

End of file reached
[FINISHED LOADING]
Loading Navaid Databases
opening file: C:/FG0981/FlightGear/data/Navaids/carrier_nav.dat
C:/FG0981/FlightGear/data/Navaids/TACAN_freq.dat
Standardising rwy number from B to 0B
Fixes

Then this is followed by -

Attempting to set starting position for LFPO:28R
Failed to find runway 28R at airport LFPO
Attempting to set starting position from airport code LFPO heading 270
runway = 2.38033, 48.7234 length = 3309.52 heading = 74.37
Position for LFPO is (2.40193, 48.7274) new heading is 254.37
Searching for airport code = LFPO
Position for LFPO is (2.36599, 48.729)
Initializing Time
Current greenwich mean time = Fri Oct 21 10:03:27 2005
Current local time = Fri Oct 21 12:03:27 2005
Reading timezone info from: C:/FG0981/FlightGear/data/Timezone/zone.tab
Using zonename = C:/FG0981/FlightGear/data/Timezone/Europe/Paris
Updating time
Current Unix calendar time = 1129889007 warp = 0
Current GMT = 10/21/2005 10:3:27
Current Unix calendar time = 1129889007 warp = 0
Current GMT = 10/21/2005 10:3:27
Current Julian Date = 2.45366e+006
First time, doing precise gst
gst => 156.054
COURSE: GMT = 9/21/105 10:03:27
March 21 noon (GMT) = 1111402800
Time since 3/21/105 GMT = 213.961
days = 213 hours = 10.0575 lon = 0 lst = 12.2575
COURSE: GMT = 9/21/105 10:03:27
March 21 noon (GMT) = 1111402800
Time since 3/21/105 GMT = 213.961
days = 213 hours = 10.0575 lon = 0 lst = 12.2575
Current lon=0.00 Sidereal Time = 12.0544
gst => 156.054
Current LOCAL Sidereal Time = 12.0544 (12.0544) (diff = -0.203116)
General Initialization
======= ==============
FG_ROOT = "C:\FG0981\FlightGear\data"

But this is because I am using --airport=LFPO. Your
set of messages would be different ... Then -

Initializing basic built-in commands:
followed by a long list of commands, ending with
savexml
Initializing scenery subsystem
Loading stars from C:/FG0981/FlightGear/data/Astro/stars
Loaded 850 stars
initializing cloud layers
texture =
texture =
texture =
texture =
texture =
texture =
Error: RenderTexture requires the following unsupported OpenGL extensions:
WGL_ARB_extensions_stringbbcache:Initialize failed, RTT not available for 3D clouds
stars = 202B6168
stars = 202BC538

What I am doing here, is that I have a debug trap in
fgIdleFunction()
and tracing, using F10, through the various idle_state
blocks of code ...

The next action, shown in the console is -

Initialize Subsystems
========== ==========
Adding subsystem interpolator
Adding subsystem properties
Reading materials from C:/FG0981/FlightGear/data/materials.xml
Skipping bad material entry params
C:/FG0981/FlightGear/data/Textures/Runway/grass_rwy.rgb
Loading material grass_rwy
... followed by a long list of file loads ...
... ending with -
Loading material Road
C:/FG0981/FlightGear/data/Textures/Terrain/gravel.rgb
Loading material Railroad

The next messages are -

Initializing Tile Manager subsystem.
Initializing the tile cache.
max cache size = 100
current cache size = 0
done with init()
FGTileMgr::update()
State == Start || Inited
Initializing Aircraft structure
Adding subsystem xml-autopilot
Adding subsystem route-manager
Adding subsystem logger
Adding subsystem gui

You can see I am approaching where you say FG
stalled ... Next is a very long list, which
scrolled well off the console, but it ends
with -

Updating Sun position
Gst = 0.0715291
t.cur_time = 1129932147
Sun Geodetic lat = -0.188581
sun angle relative to current location = 137.731
and
Updating time
Current Unix calendar time = 1129895619 warp = 5400
Current GMT = 10/21/2005 11:53:39
Current Unix calendar time = 1129895619 warp = 5400
Current GMT = 10/21/2005 11:53:39
Current Julian Date = 2.45366e+006
COURSE: GMT = 9/21/105 11:53:39
March 21 noon (GMT) = 1111402800
Time since 3/21/105 GMT = 214.037
days = 214 hours = 11.8942 lon = 0 lst = 14.1608
COURSE: GMT = 9/21/105 11:53:39
March 21 noon (GMT) = 1111402800
Time since 3/21/105 GMT = 214.037
days = 214 hours = 11.8942 lon = -2.40193 lst = 14.321
Current lon=0.00 Sidereal Time = 13.9577
gst => 157.896
Current LOCAL Sidereal Time = 14.1178 (14.0562) (diff = -0.203116)
After fgInitTimeOffset(): warp = 5400

This is followed by -
Adding subsystem environment
Adding subsystem lighting
Initializing OpenAL sound manager
Audio initialization failed!

You can see I am presently still having a problem
getting audio (sound) to function ... then onto -

Adding subsystem fx
ATC Display
ATC Manager
WARNING - INVALID type found in C:/FG0981/FlightGear/data/ATC/default.atis
WARNING - INVALID type found in C:/FG0981/FlightGear/data/ATC/default.tower
WARNING - INVALID type found in C:/FG0981/FlightGear/data/ATC/default.ground
WARNING - INVALID type found in C:/FG0981/FlightGear/data/ATC/default.approach
From file sounds sample = C:/FG0981/FlightGear/data/ATC/default.wav
Opened word data file ATC/default.vce OK...
ATC Transmissions
Current Unix calendar time = 1129890445 warp = 0
Current GMT = 10/21/2005 10:27:25
ATC Dialog System

Then onto the AI manager -
AI Manager
Searching for airport code = KEMT
Position for KEMT is (-118.033, 34.0869)
Finding position for airport: LFPO
Searching for airport code = LFPO
Position for LFPO is (2.36599, 48.729)
... this is REPEATED, some 7 more times? ...

This will be different for you, if you are
using the default KSFO airport ... then it
continues -

AI Model Manager
Adding subsystem ai_model
Adding subsystem submodel_mgr
Adding subsystem Traffic Manager
Reading instruments from C:/FG0981/FlightGear/data/Aircraft/Generic/generic-inst
rumentation.xml
instrument name: adf
instrument name: adf
instrument name: airspeed-indicator
instrument name: altimeter
instrument name: attitude-indicator
instrument name: clock
instrument name: dme
instrument name: encoder
instrument name: marker-beacon
Initializing Interpolator for C:/FG0981/FlightGear/data/Navaids/range.term
Initializing Interpolator for C:/FG0981/FlightGear/data/Navaids/range.low
Initializing Interpolator for C:/FG0981/FlightGear/data/Navaids/range.high
instrument name: heading-indicator
instrument name: KT-70
instrument name: magnetic-compass
instrument name: nav-radio
Initializing Interpolator for C:/FG0981/FlightGear/data/Navaids/range.term
Initializing Interpolator for C:/FG0981/FlightGear/data/Navaids/range.low
Initializing Interpolator for C:/FG0981/FlightGear/data/Navaids/range.high
instrument name: nav-radio
Initializing Interpolator for C:/FG0981/FlightGear/data/Navaids/range.term
Initializing Interpolator for C:/FG0981/FlightGear/data/Navaids/range.low
Initializing Interpolator for C:/FG0981/FlightGear/data/Navaids/range.high
instrument name: slip-skid-ball
instrument name: transponder
instrument name: turn-indicator
instrument name: vertical-speed-indicator
instrument name: gps
instrument name: wxradar
instrument name: tacan
Adding subsystem instrumentation

Then the next F10, fgCockpitInit(...) gives me an output -

Adding subsystem instrumentation
Reading systems from C:/FG0981/FlightGear/data/Aircraft/Generic/generic-systems.xml
Adding subsystem systems
Initializing cockpit subsystem
Initializing current aircraft HUD
Read properties for Default Aircraft Hud
Reading Hud instruments
Reading Instrument hudladder from C:/FG0981/FlightGear/data/Huds/Instruments/Default/hudladder.xml
Done reading instrument Pitch Ladder
Reading Instrument hudcard from C:/FG0981/FlightGear/data/Huds/Instruments/Default/hudcard.xml
Done reading instrument Gyrocompass
Done reading instrument AMSL
Done reading instrument RadioAltimeter
Done reading instrument KIAS
Done reading instrument Gauge1
Done reading instrument Gauge2
Done reading instrument Gauge3
Done reading instrument Gauge4
Done reading instrument Gauge5
Reading Instrument instrlabel from C:/FG0981/FlightGear/data/Huds/Instruments/Default/instrlabel.xml
Done reading instrument latitude
Done reading instrument longitude
Reading Instrument fgTBI from C:/FG0981/FlightGear/data/Huds/Instruments/Default/fgtbi.xml
Done reading instrument fgTBI_Instrument
Reading Instrument Gload from C:/FG0981/FlightGear/data/Huds/Instruments/Default/gload.xml
Done reading instrument G Load
Code 1 Status 0

Again, yours would perhaps be different. I am using
--aircraft=UFO
--FDM=UFO
The next is another very long list, which scrolled off, but
it ended with -

Read layer Compass Float (magic)
No type supplied for layer face assuming "texture"
Read texture texture
Read layer face
Done reading instrument Magnetic Compass
Done reading panel instruments

You can see I am keeping tight control, only allowing
FG to initialise a step at a time ... then I begin
to reach where you say FG froze -

Loaded new panel from Aircraft/Generic/Panels/generic-vfr-panel.xml
Attempt to set archive flag for non-existant property /controls/seat/eject/cmd_selector_valve
Adding subsystem input
Adding subsystem replay
Logging priority is debug
Enabled all logging classes: terrain|astro|flight|input|gl|view|cockpit|general|
math|event|aircraft|autopilot|io|clipper|network|instrumentation|systems

The very next line I get is -

Attempt to set archive flag for non-existant property /instrumentation/kt-70[0]/inputs/rotation-deg

This is followed by another long list, which scrolled off, but
ends with -

Reading binding property-assign
Binding key 364
Reading all bindings
Reading binding property-adjust

This comes from the code -
void FGInput::init () {
_init_keyboard();
_init_joystick();
_init_mouse();

It seems like you got stuck before, or around -
_init_keyboard() ...

If you run FG under MSVC6 debugger, you should
be able to step through like I have, and find the
exact problem ... Sometimes it take many tries to
get to the location, setting many breakpoints
along the way ...

The idea is to find a breakpoint before it freezes,
and one after, that it never reaches. Then really
dig into what is happening ... what is going wrong
... sometimes tracing line by line, F11 ... through
miles, and miles of code ...

From main.cxx, you seem to be in the function -
if( !fgInitSubsystems()) {
The specific area of code you seem to be in is -
////////////////////////////////////////////////////////////////////
// Bind and initialize subsystems.
////////////////////////////////////////////////////////////////////

globals->get_subsystem_mgr()->bind();
globals->get_subsystem_mgr()->init();

#ifdef FG_MPLAYER_AS
////////////////////////////////////////////////////////////////////
// Initialize multiplayer subsystem
////////////////////////////////////////////////////////////////////

globals->set_multiplayer_tx_mgr(new FGMultiplayTxMgr);
globals->get_multiplayer_tx_mgr()->init();

globals->set_multiplayer_rx_mgr(new FGMultiplayRxMgr);
globals->get_multiplayer_rx_mgr()->init();
#endif

////////////////////////////////////////////////////////////////////////
// Initialize the Nasal interpreter.
// Do this last, so that the loaded scripts see initialized state
////////////////////////////////////////////////////////////////////////
FGNasalSys* nasal = new FGNasalSys();
globals->add_subsystem("nasal", nasal);
nasal->init();

////////////////////////////////////////////////////////////////////
// At this point we could try and parse the waypoint options
///////////////////////////////////////////////////////////////////
parseWaypoints();

Can only hope this helps ... debugging is a long,
very tedious, and frustrating process ...

Of course, MSVC6 is now quite old, as far as compilers
go ... I have not tried it on FG for quite a while
now, but with lots of care, it should work ...

Hope you get it running ...

Regards,

Geoff.

PS: Another thing to do is to download Fredrick
B. 69MB binary, with scenery, fgrun, and a windows
installer -
 http://flightgear.org/Downloads/binary.shtml  
Try this ... if it runs ok, this will
give you the courage to find what is wrong with
your own WIN32 build ...

back