aerospace-toolbox

Issue 44: Wrong data crashes fg

Reported by Sylvestre Ledru, Apr 27, 2010

fgrun.sh: line 6:  1267 Exception en point flottant   fgfs 
--geometry=400x300 --native-fdm=socket,out,120,,5500,udp 
--native-ctrls=socket,out,120,,5501,udp 
--native-ctrls=socket,in,120,,5502,udp

when I tried:
u = [23;11;23;45]
y=flightGearUpdate(u,u)

Comment 1 by James Goppert, Apr 27, 2010

Should be fixed now, forgot to commit my local tree.

Comment 2 by Sylvestre Ledru, Apr 27, 2010

Maybe my values are wrong but this crashes fg

--> u = [23;11;23;45];
-->y=flightGearUpdate(u)       
 37.613585N (deg) -122.357351E (deg) AGL (m)=    1.4
vNED (m/s)=  0  -0   0phi(deg)=  0   theta(deg)=  0   psi(deg)= 292
phidot(deg/s)=  0   thetadot(deg/s)=  0   psidot(deg/s)= -0
elevator (deg)=   0 left aileron (deg)=  
45678163317988213012614348800 right aileron (deg)=  
45678163317988213012614348800 rudder (deg)=   0 rpm = 5510306
Abody (m/s^2) =     0.0722    -0.0156    -9.8224



fgrun.sh: line 6: 28130 Erreur de segmentation  fgfs 
--geometry=400x300 --native-fdm=socket,out,120,,5500,udp 
--native-ctrls=socket,out,120,,5501,udp 
--native-ctrls=socket,in,120,,5502,udp

Comment 3 by James Goppert, Apr 27, 2010

All of the control inputs should be mapped from -1 to 1, except 
throttle which is 0-1, let me know if that fixes it. The left/right 
aileron etc are of because I haven't flipped the network byte order 
on those, will also fix that.

Comment 4 by James Goppert, Apr 27, 2010

-->flightGearUpdate([0;0;0;0])
 ans  =
 
  - 0.0000188  
    0.0133695  
    5.1981936  
    0.0007783  
  - 0.0069151  
  - 0.0037854  
  - 2.1355368  
    0.6564802  
    1.2582375  
    0.8030441  
  - 1.4967599  
    0.0047045  
    1.7206736  
    0.0115999  
    0.0277382  
    3.1256442  
    0.0412529  
  - 32.152756

Comment 5 by Sylvestre Ledru, Apr 27, 2010

Sorry but this fails:
u = [0.5;0.5;0.5;0.5];
y=flightGearUpdate(u)

FYI, fgrun.sh produces a lot of:
Error writing data.
in the terminal

Comment 6 by James Goppert, Apr 27, 2010

The error writing data is because we are using udp and reading once, 
so that is to be expected. It will go away when put into xcos and 
run faster than 120 Hz. Are you using flight gear from debian lenny, 
v1.0.0-3 ?

Comment 7 by Sylvestre Ledru, Apr 27, 2010

I run Debian testing/unstable

$ dpkg -l|grep -E '(fligh|simgear)'
ii  flightgear                                 1.9.1-1.1             
     Flight Gear Flight Simulator
ii  simgear-dev                                1.9.1-2               
     Simulator Construction Gear -- development files
ii  simgear1.9.1                               1.9.1-2               
     Simulator Construction Gear -- shared libraries

Comment 8 by James Goppert, Apr 27, 2010

Ok, I've got a debian squeeze box at the lab I'll try to debug and 
make sure it runs on that version as well. They might have changed 
the packet structure a bit. I could just add a flag to handle this 
if that is the case.

Comment 9 by James Goppert, Apr 27, 2010

I just checked the cvs for flightgear. They don't show any changes 
in the net_fdm.hxx or net_ctrls.hxx files. So that is good, but I'm 
not sure what the error is now. I'll see if I can find it later 
today using gdb on squeeze.

Comment 10 by Sylvestre Ledru, Apr 28, 2010

There is the backtrace:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb28f9b70 (LWP 1373)]
0xb797acc6 in ?? () from /usr/lib/libopenal.so.1
(gdb) bt
#0  0xb797acc6 in ?? () from /usr/lib/libopenal.so.1
#1  0xb7985eba in ?? () from /usr/lib/libopenal.so.1
#2  0xb7995d40 in ?? () from /usr/lib/libopenal.so.1
#3  0xb59e17b0 in ?? () from /usr/lib/libpulse.so.0
#4  0xb5992ede in pa_pdispatch_run () from 
/usr/lib/libpulsecommon-0.9.21.so
#5  0xb59c51c9 in ?? () from /usr/lib/libpulse.so.0
#6  0xb5997fbb in ?? () from /usr/lib/libpulsecommon-0.9.21.so
#7  0xb5983029 in ?? () from /usr/lib/libpulsecommon-0.9.21.so
#8  0xb59d47f6 in pa_mainloop_dispatch () from 
/usr/lib/libpulse.so.0
#9  0xb59d4bb1 in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#10 0xb59d4c74 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#11 0xb59e6493 in ?? () from /usr/lib/libpulse.so.0
#12 0xb59a7442 in ?? () from /usr/lib/libpulsecommon-0.9.21.so
#13 0xb7d05585 in start_thread (arg=0xb28f9b70) at 
pthread_create.c:300
#14 0xb710b29e in clone () at 
../sysdeps/unix/sysv/linux/i386/clone.S:130


Pulse stuff is audio related.
I tried to disable the sound with:
--disable-sound
but it stills fails

Comment 11 by Sylvestre Ledru, Apr 28, 2010

(and I don't have sound issues on my system)

Comment 12 by Sylvestre Ledru, Apr 29, 2010

OK, I installed the package from Debian stable and it is working.
It is funny. Well done ;)

Comment 13 by James Goppert, Apr 29, 2010

Unfortunate that it doesn't work for squeeze. I'll try to track down 
the bug and possibly post something upstream.
Status: Accepted

Created: 8 years 5 months ago by Sylvestre Ledru

Updated: 8 years 5 months ago

Status: Accepted

Followed by: 1 person

Labels:
Type:Defect
Priority:Medium