Re: [Flightgear-devel] segfault in recent CVS due to minimal sound configuration file

2008-01-12 Thread Tim Moore
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Tiago Gusmão wrote:

| Hi
|
| The code was assuming there would be a fx node. The attached patch
| fixed it in my tests (and corrects a i++ to ++i in a for loop)
|
| Cheers,
| Tiago

Committed with some reformatting. Thanks!

Tim
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFHiJfReDhWHdXrDRURAl5fAKCpibTDXZ5DK+AtkUhiFE9eaC7YvACdEgrv
uh9Q1ssEtxNM30R8q0WXG0k=
=EklS
-END PGP SIGNATURE-

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


[Flightgear-devel] segfault in recent CVS due to minimal sound configuration file

2008-01-11 Thread Josh Babcock
tower:ch53e$ gdb fgfs --aircraft=ch53e --timeofday=noon 
   GNU gdb 6.7.1-debian
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type show copying
and show warranty for details.
This GDB was configured as i486-linux-gnu...
Using host libthread_db library /lib/libthread_db.so.1.
Starting program: /usr/local/bin/fgfs --aircraft=ch53e --timeofday=noon
[Thread debugging using libthread_db enabled]
[New Thread 0xb69136e0 (LWP 32353)]
osgDB ac3d reader: could not find texture Untitled
[New Thread 0xb09f8b90 (LWP 32382)]
[New Thread 0xb01f8b90 (LWP 32383)]
Httpd server started on port 5100

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb69136e0 (LWP 32353)]
FGFX::init (this=0xdd52200) at fg_fx.cxx:95
95 for (i = 0; i  node-nChildren(); i++) {
(gdb) bt
#0  FGFX::init (this=0xdd52200) at fg_fx.cxx:95
#1  0x086ff8ef in SGSubsystemGroup::init (this=0x8852c9c)
 at subsystem_mgr.cxx:124
#2  0x08084e8c in fgInitSubsystems () at fg_init.cxx:1823
#3  0x08067683 in fgIdleFunction () at main.cxx:920
#4  0x080b69dd in FGManipulator::handle (this=0x8852698, [EMAIL PROTECTED],
 [EMAIL PROTECTED]) at FGManipulator.cxx:148
#5  0xb7715dda in osgViewer::Viewer::eventTraversal ()
from /usr/local/lib/libosgViewer.so.26
#6  0xb7719c63 in osgViewer::ViewerBase::frame ()
from /usr/local/lib/libosgViewer.so.26
#7  0x080be8ce in fgOSMainLoop () at fg_os_sdl.cxx:248
#8  0x08063b55 in fgMainInit (argc=3, argv=0xbfbd7184) at main.cxx:1077
#9  0x080628d4 in main (argc=247672440, argv=0xecb4798)
 at bootstrap.cxx:220
(gdb)


I made this happen by putting this:
sound
pathAircraft/ch53e/Sound/ch53e-sound.xml/path
/sound
in ch53e-set.xml
ch53e-sound.xml looks like this:
?xml version=1.0?

PropertyList
/PropertyList

Reverting the change to ch53e-set.xmlch53e-set.xml makes the segfault go 
away. I don't think it should be that easy to make the xml reader choke :)

Last compiled (and updated) 1/9.

Josh

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] segfault in recent CVS due to minimal sound configuration file

2008-01-11 Thread Tiago Gusmão

Josh Babcock wrote:
tower:ch53e$ gdb fgfs --aircraft=ch53e --timeofday=noon 
   GNU gdb 6.7.1-debian

Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
http://gnu.org/licenses/gpl.html

This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type show copying
and show warranty for details.
This GDB was configured as i486-linux-gnu...
Using host libthread_db library /lib/libthread_db.so.1.
Starting program: /usr/local/bin/fgfs --aircraft=ch53e --timeofday=noon
[Thread debugging using libthread_db enabled]
[New Thread 0xb69136e0 (LWP 32353)]
osgDB ac3d reader: could not find texture Untitled
[New Thread 0xb09f8b90 (LWP 32382)]
[New Thread 0xb01f8b90 (LWP 32383)]
Httpd server started on port 5100

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb69136e0 (LWP 32353)]
FGFX::init (this=0xdd52200) at fg_fx.cxx:95
95 for (i = 0; i  node-nChildren(); i++) {
(gdb) bt
#0  FGFX::init (this=0xdd52200) at fg_fx.cxx:95
#1  0x086ff8ef in SGSubsystemGroup::init (this=0x8852c9c)
 at subsystem_mgr.cxx:124
#2  0x08084e8c in fgInitSubsystems () at fg_init.cxx:1823
#3  0x08067683 in fgIdleFunction () at main.cxx:920
#4  0x080b69dd in FGManipulator::handle (this=0x8852698, [EMAIL PROTECTED],
 [EMAIL PROTECTED]) at FGManipulator.cxx:148
#5  0xb7715dda in osgViewer::Viewer::eventTraversal ()
from /usr/local/lib/libosgViewer.so.26
#6  0xb7719c63 in osgViewer::ViewerBase::frame ()
from /usr/local/lib/libosgViewer.so.26
#7  0x080be8ce in fgOSMainLoop () at fg_os_sdl.cxx:248
#8  0x08063b55 in fgMainInit (argc=3, argv=0xbfbd7184) at main.cxx:1077
#9  0x080628d4 in main (argc=247672440, argv=0xecb4798)
 at bootstrap.cxx:220
(gdb)


I made this happen by putting this:
sound
pathAircraft/ch53e/Sound/ch53e-sound.xml/path
/sound
in ch53e-set.xml
ch53e-sound.xml looks like this:
?xml version=1.0?

PropertyList
/PropertyList

Reverting the change to ch53e-set.xmlch53e-set.xml makes the segfault go 
away. I don't think it should be that easy to make the xml reader choke :)


Last compiled (and updated) 1/9.

Josh




Hi

The code was assuming there would be a fx node. The attached patch 
fixed it in my tests (and corrects a i++ to ++i in a for loop)


Cheers,
Tiago
Index: fg_fx.cxx
===
RCS file: /var/cvs/FlightGear-0.9/source/src/Sound/fg_fx.cxx,v
retrieving revision 1.24
diff -u -p -r1.24 fg_fx.cxx
--- fg_fx.cxx   20 Apr 2007 18:32:43 -  1.24
+++ fg_fx.cxx   12 Jan 2008 02:58:12 -
@@ -92,17 +92,20 @@ FGFX::init()
}
 
node = root.getNode(fx);
-   for (i = 0; i  node-nChildren(); i++) {
-  SGXmlSound *sound = new SGXmlSound();
-
-  try {
- sound-init(globals-get_props(), node-getChild(i),
- globals-get_soundmgr(), globals-get_fg_root());
-
- _sound.push_back(sound);
-  } catch ( sg_io_exception e ) {
- SG_LOG(SG_GENERAL, SG_ALERT, e.getFormattedMessage());
- delete sound;
+   if(node)
+   {
+for (i = 0; i  node-nChildren(); ++i) {
+SGXmlSound *sound = new SGXmlSound();
+  
+try {
+  sound-init(globals-get_props(), node-getChild(i),
+  globals-get_soundmgr(), globals-get_fg_root());
+  
+  _sound.push_back(sound);
+} catch ( sg_io_exception e ) {
+  SG_LOG(SG_GENERAL, SG_ALERT, e.getFormattedMessage());
+  delete sound;
+}
   }
}
 }
-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel