I had some spare time today and did some testing to reproduce the crash with a 
CVS buid a few days old.

1. removed .fgfsrc file and .fgfs directory to get a clean start

2. ran fgfs --native=file,out,20,fgfs.out

3. flew a (ugly) traffic pattern on ksfo 28R with full stop landing

4. ran 
fgfs --native=file,in,20,fgfs.out --fdm=externalfgfs 
--native=file,in,20,fgfs.out --fdm=external

5. got core dump

this is the backtrace from gdb:
#0  0x00002b43c7043372 in memcpy () from /lib64/libc.so.6
#1  0x00000000007ecf22 in std::vector<FGGroundCache::Triangle, 
std::allocator<FGGroundCache::Triangle> >::operator= (this=0x575b288, 
__x=<value optimized out>)
    at /usr/include/c++/4.2.1/bits/stl_algobase.h:283
#2  0x00000000007eb702 in FGNative::process (this=0xd362b40)
    at ../../src/FDM/groundcache.hxx:33
#3  0x000000000044527c in FGIO::update (this=<value optimized out>,
    delta_time_sec=0.0083333333333333332) at fg_io.cxx:328
#4  0x000000000040e265 in fgMainLoop () at main.cxx:497
#5  0x0000000000444ad2 in GLUTidle () at fg_os.cxx:135
#6  0x00002b43c498ee13 in glutMainLoop () from /usr/lib64/libglut.so.3
#7  0x0000000000410dda in fgMainInit (argc=3, argv=0x7fffe6785308)
    at main.cxx:1119
#8  0x000000000040d152 in main (argc=3, argv=0x7fffe6785308)
    at bootstrap.cxx:215

pretty much the same as the one posted by tpalinkas.
The dump occours in FGNative::process line 74, at
               *cur_fdm_state = buf;
buf and cur_fdm_state are FGInterface, that have a FGGroundCache member. The 
FGGroundCache object has a member std::vector<Triangle> and a member 
found_ground.
The crash occours, when the ground_cache.found_ground is true and the 
triangles vector has elements. It appears to me, that the vector contains 
memory pointers, that are saved to a file and they are invalid when being 
read lateron.

I am not sure if I understand the code correct, but is it a good idea to save 
the groundcache as part of the fdm state? And if so, it is probably better to 
save the content of the triangle vector than just the pointer?

Maybe somebody with a deeper insight in the GroundCache code can step in 
here...

I put my fgfs.out file here: http://www.t3r.de/fg/fgfs.out.bz2

Greetings, Torsten


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to