Hi there,

As many of you already know, FG often crashes at exit (See back trace below). 
Though the chance of crash varies per platform, it crashes more than 80% on my 
Mac with very annoying "Crash Reporter" dialog popping up. This bug must be 
eliminated before the official release.

As a result of several hours of research, I've found a possible cause that 
crashes fgfs at exit, which has something to do with the Sound Manager updates 
committed on Oct-24-2009 (See the cvs logs below for detail). I've been looking 
at the code and tracing up and down on gdb, but I've not yet found a root 
cause. 

So I want you guys to help me find the root cause. I'm not so sure if Erik's 
commits are directly related to the crash since fgfs crashes after SGSoundMgr 
is already deleted. Maybe the problem were there and his commits just pull out 
the crash. maybe his commit has something to do with it deep inside..... Maybe 
using SGPropertyNode * instead of SGPropertyNode_ptr (with explicit delete) 
will help you find the cause....


FYI,  I tried several FG/SG cvs checkouts and found that FG starts crashing on 
10/24.
(FG on 10/23 15:00 UTC doesn't crash at exit but 10/24 15:00 UTC does). 
I checked the commits between 10/23 15:00 and 10/24 15:00 and found 6 commits 
(4 Sound Manager commits, one JSBSim sync, and one more. 
So I applied each independent set of commits onto 10/23 source one by one, and 
the crash occurs only with Sound Manager commits. 
I also tried fg/sg as of a few days back and got the same crash dump.


Thanks for your help,

Tat

------------------ back trace on FG/SG 10/25 15:00 (one file in on 10/27 due to 
typo) -------------
[on Mac OS 10.5]

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x000001e4
0x93134c4f in szone_free ()
(gdb) bt
#0  0x93134c4f in szone_free ()
#1  0x9313438d in free ()
#2  0x9189202a in std::string::_Rep::_M_destroy ()
#3  0x918934ab in std::basic_string<char, std::char_traits<char>, 
std::allocator<char> >::~basic_string ()
#4  0x006e4c77 in SGPropertyNode::~SGPropertyNode (this=0x227905a0) at 
props.cxx:737
#5  0x00009516 in SGSharedPtr<SGPropertyNode>::put (this=0x22790604) at 
SGSharedPtr.hxx:107
#6  0x00009533 in SGSharedPtr<SGPropertyNode>::~SGSharedPtr (this=0x22790604) 
at SGSharedPtr.hxx:61
#7  0x00069f61 in __gnu_cxx::new_allocator<SGSharedPtr<SGPropertyNode> 
>::destroy (this=0xbfffee4f, __p=0x22790604) at ext/new_allocator.h:107
#8  0x00069f7e in std::_Destroy<SGSharedPtr<SGPropertyNode>*, 
std::allocator<SGSharedPtr<SGPropertyNode> > > (__first=0x22790604, 
__last=0x22790608, __all...@0xbfffee4f) at stl_construct.h:174
#9  0x00069fc6 in std::vector<SGSharedPtr<SGPropertyNode>, 
std::allocator<SGSharedPtr<SGPropertyNode> > >::~vector (this=0x227904f4) at 
stl_vector.h:273
#10 0x006e4c42 in SGPropertyNode::~SGPropertyNode (this=0x227904e0) at 
props.cxx:737
#11 0x00009516 in SGSharedPtr<SGPropertyNode>::put (this=0x24c7701c) at 
SGSharedPtr.hxx:107
#12 0x00009533 in SGSharedPtr<SGPropertyNode>::~SGSharedPtr (this=0x24c7701c) 
at SGSharedPtr.hxx:61
#13 0x00069f61 in __gnu_cxx::new_allocator<SGSharedPtr<SGPropertyNode> 
>::destroy (this=0xbfffef7f, __p=0x24c7701c) at ext/new_allocator.h:107
#14 0x00069f7e in std::_Destroy<SGSharedPtr<SGPropertyNode>*, 
std::allocator<SGSharedPtr<SGPropertyNode> > > (__first=0x24c7701c, 
__last=0x24c77130, __all...@0xbfffef7f) at stl_construct.h:174
#15 0x00069fc6 in std::vector<SGSharedPtr<SGPropertyNode>, 
std::allocator<SGSharedPtr<SGPropertyNode> > >::~vector (this=0x22779484) at 
stl_vector.h:273
#16 0x006e4c42 in SGPropertyNode::~SGPropertyNode (this=0x22779470) at 
props.cxx:737
#17 0x00009516 in SGSharedPtr<SGPropertyNode>::put (this=0x2513b3a0) at 
SGSharedPtr.hxx:107
#18 0x00009533 in SGSharedPtr<SGPropertyNode>::~SGSharedPtr (this=0x2513b3a0) 
at SGSharedPtr.hxx:61
#19 0x00069f61 in __gnu_cxx::new_allocator<SGSharedPtr<SGPropertyNode> 
>::destroy (this=0xbffff0af, __p=0x2513b3a0) at ext/new_allocator.h:107
#20 0x00069f7e in std::_Destroy<SGSharedPtr<SGPropertyNode>*, 
std::allocator<SGSharedPtr<SGPropertyNode> > > (__first=0x2513b3a0, 
__last=0x2513b404, __all...@0xbffff0af) at stl_construct.h:174
#21 0x00069fc6 in std::vector<SGSharedPtr<SGPropertyNode>, 
std::allocator<SGSharedPtr<SGPropertyNode> > >::~vector (this=0x22779424) at 
stl_vector.h:273
#22 0x006e4c42 in SGPropertyNode::~SGPropertyNode (this=0x22779410) at 
props.cxx:737
#23 0x00009516 in SGSharedPtr<SGPropertyNode>::put (this=0x1b34328) at 
SGSharedPtr.hxx:107
#24 0x00009533 in SGSharedPtr<SGPropertyNode>::~SGSharedPtr (this=0x1b34328) at 
SGSharedPtr.hxx:61
#25 0x0003c6c4 in FGGlobals::~FGGlobals (this=0x1b34320) at globals.cxx:166
#26 0x00002ce8 in fgExitCleanup () at bootstrap.cxx:305
#27 0x93156dc7 in __cxa_finalize ()
#28 0x93156cb0 in exit ()
#29 0x0005069f in fgExit (status=Could not find the frame base for 
"fgExit(int)".
) at util.cxx:117
#30 0x000689c5 in fgOSMainLoop () at fg_os_osgviewer.cxx:177
#31 0x00003be3 in fgMainInit (argc=1, argv=0xbffff490) at main.cxx:897
#32 0x00002e15 in main (argc=1, argv=0xbffff490) at bootstrap.cxx:229


[on Ububtu-9.0.4 on Mac :-) ]
#0  0xb6a3a0d8 in ?? () from /lib/tls/i686/cmov/libc.so.6
#1  0xb6a3a5b6 in free () from /lib/tls/i686/cmov/libc.so.6
#2  0xb6bf5231 in operator delete () from /usr/lib/libstdc++.so.6
#3  0x0862a84c in ~SGPropertyNode (this=0x113249f8) at props.cxx:737
#4  0x0862a810 in ~SGPropertyNode (this=0x11309368)
    at ../../simgear/structure/SGSharedPtr.hxx:107
#5  0x0862a810 in ~SGPropertyNode (this=0x11307540)
    at ../../simgear/structure/SGSharedPtr.hxx:107
#6  0x080972b9 in ~FGGlobals (this=0x89129b8)
    at /usr/local/include/simgear/structure/SGSharedPtr.hxx:107
#7  0x0806cce7 in fgExitCleanup () at bootstrap.cxx:305
#8  0xb69f7bb9 in exit () from /lib/tls/i686/cmov/libc.so.6
#9  0x080aaa0c in fgExit (status=0) at util.cxx:117
#10 0x080bb3f1 in fgOSMainLoop () at fg_os_osgviewer.cxx:177
#11 0x0806e655 in fgMainInit (argc=1, argv=0xbfec4bb4) at main.cxx:897
#12 0x0806c63f in main (argc=1, argv=0xbfec4bb4) at bootstrap.cxx:229


------------------ CVS commit logs --------------

[FlightGear]
Log:
  Don't make the SoundManager a memebr of the subsystem manager; It needs to be 
initialized very early and destroyed as late as possible. That doesn't work as 
a subsystem me
ber onless some sort of priority scheme gets implemented. Get rid of auto_ptr 
which doesn work for the samples either.
Modified files:
  ATCDCL/AIPlane.cxx on date: 2009/10/24 08:31:37  author: ehofman as revision 
1.10
  ATCDCL/ATC.cxx on date: 2009/10/24 08:31:37  author: ehofman as revision 1.7
  ATCDCL/ATCVoice.cxx on date: 2009/10/24 08:31:37  author: ehofman as revision 
1.7
  ATCDCL/ATCVoice.hxx on date: 2009/10/24 08:31:37  author: ehofman as revision 
1.7
  Environment/fgclouds.cxx on date: 2009/10/24 08:31:38  author: ehofman as 
revision 1.32
  Instrumentation/adf.cxx on date: 2009/10/24 08:31:39  author: ehofman as 
revision 1.23
  Instrumentation/kr_87.cxx on date: 2009/10/24 08:31:39  author: ehofman as 
revision 1.13
  Instrumentation/marker_beacon.cxx on date: 2009/10/24 08:31:39  author: 
ehofman as revision 1.22
  Instrumentation/mk_viii.cxx on date: 2009/10/24 08:31:39  author: ehofman as 
revision 1.22
  Instrumentation/navradio.cxx on date: 2009/10/24 08:31:39  author: ehofman as 
revision 1.57
  Main/fg_commands.cxx on date: 2009/10/24 08:31:39  author: ehofman as 
revision 1.117
  Main/fg_init.cxx on date: 2009/10/24 08:31:40  author: ehofman as revision 
1.239
  Main/fg_props.cxx on date: 2009/10/24 08:31:40  author: ehofman as revision 
1.41
  Main/globals.cxx on date: 2009/10/24 08:31:41  author: ehofman as revision 
1.70
  Main/globals.hxx on date: 2009/10/24 08:31:41  author: ehofman as revision 
1.62
  Main/main.cxx on date: 2009/10/24 08:31:41  author: ehofman as revision 1.301
  Main/viewmgr.cxx on date: 2009/10/24 08:31:42  author: ehofman as revision 
1.34
  Model/acmodel.cxx on date: 2009/10/24 08:31:42  author: ehofman as revision 
1.32
  Sound/beacon.cxx on date: 2009/10/24 08:31:42  author: ehofman as revision 
1.18
  Sound/morse.cxx on date: 2009/10/24 08:31:43  author: ehofman as revision 1.19

------------------------------------
Log:
  Use shared pointers for any reference to SGSoundSample
Modified files:
  ATCDCL/AIPlane.cxx on date: 2009/10/24 12:57:50  author: ehofman as revision 
1.11
  ATCDCL/AIPlane.hxx on date: 2009/10/24 12:57:50  author: ehofman as revision 
1.6
  ATCDCL/ATC.hxx on date: 2009/10/24 12:57:50  author: ehofman as revision 1.9
  ATCDCL/ATCVoice.cxx on date: 2009/10/24 12:57:50  author: ehofman as revision 
1.8
  ATCDCL/ATCVoice.hxx on date: 2009/10/24 12:57:50  author: ehofman as revision 
1.8
  Instrumentation/adf.hxx on date: 2009/10/24 12:57:51  author: ehofman as 
revision 1.11
  Instrumentation/kr_87.hxx on date: 2009/10/24 12:57:51  author: ehofman as 
revision 1.9
  Instrumentation/marker_beacon.hxx on date: 2009/10/24 12:57:51  author: 
ehofman as revision 1.8
  Instrumentation/mk_viii.cxx on date: 2009/10/24 12:57:51  author: ehofman as 
revision 1.23
  Instrumentation/mk_viii.hxx on date: 2009/10/24 12:57:51  author: ehofman as 
revision 1.18
  Instrumentation/navradio.hxx on date: 2009/10/24 12:57:51  author: ehofman as 
revision 1.33
  Model/acmodel.hxx on date: 2009/10/24 12:57:51  author: ehofman as revision 
1.18
  Sound/sample_queue.hxx on date: 2009/10/24 12:57:51  author: ehofman as 
revision 1.2

[SimGear]
Log:
  Use shared pointers for any reference to SGSoundSample, fix the constructor 
of SGSoundSample where data is supplied by the calling program.
Modified files:
  simgear/sound/sample_group.cxx on date: 2009/10/24 12:57:11  author: ehofman 
as revision 1.17
  simgear/sound/sample_group.hxx on date: 2009/10/24 12:57:11  author: ehofman 
as revision 1.13
  simgear/sound/sample_openal.cxx on date: 2009/10/24 12:57:11  author: ehofman 
as revision 1.51
  simgear/sound/soundmgr_openal.cxx on date: 2009/10/24 12:57:11  author: 
ehofman as revision 1.56

------------------------------------
Log:
  get rid of aut_ptr, it only works with objects that can destroyed with delete 
(and not even delete[]) which is too limited. take drastic actions to find the 
sound-not-play
ing-bug: set all positions and orientations to default all the time.
Modified files:
  simgear/sound/sample_group.cxx on date: 2009/10/24 08:18:09  author: ehofman 
as revision 1.16
  simgear/sound/sample_openal.cxx on date: 2009/10/24 08:18:10  author: ehofman 
as revision 1.50
  simgear/sound/sample_openal.hxx on date: 2009/10/24 08:18:10  author: ehofman 
as revision 1.34
  simgear/sound/soundmgr_openal.cxx on date: 2009/10/24 08:18:10  author: 
ehofman as revision 1.55


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to