QNX port of Bird 1.4.5, corrupt linked lists?
Thu Dec 11 01:46:41 EST 2014 Hello. I am working on porting bird 1.4.5 to QNX SP1 (QNX OS service pack 1). QNX is actually close to BSD and there have been very few changes to the code. I have bird built but I get a core dump on initialization. I was hoping that someone could give me some specific ideas on exactly where to look while debugging. I have many years of writing and debugging Linux and Solaris drivers and networking code, but I am not yet familiar with the bird internal data structures. I tried building with and without pthreads. I get a core dump both ways, in different spots, both when calling WALK_LIST() with a list. // with pthreads #0 0x00111460 in if_notify_change (c=1, i=0x187050) at ../../nest/iface.c:218 218 WALK_LIST(p, active_proto_list) // without pthreads if_start_update () at ../../nest/iface.c:338 338 WALK_LIST(i, iface_list) I also turned off the '#define POISON' in lib/slab.c, and on a different run did a bzero() instead of a memset(POISON). Neither changed the results. Attached find my bird.conf Any hints would be appreciated. PS Something else weird. I get an error when bird starts up and parses bird.conf. 'protocol device' rejects 'interface "en0";', even though en0 is the correct name of my ethernet interface, and ifconfig shows it exists and is up with an ipaddr. protocol device { interface "en0"; } % ifconfig lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33192 inet 127.0.0.1 netmask 0xff000000 wip0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500 address: 01 en0: flags=80008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,SHIM> mtu 1500 address: 00:80:0f:9e:08:74 media: Ethernet 100baseTX full-duplex status: active inet 192.168.1.1 netmask 0xffffff00 broadcast 192.168.1.255 Thanks, Ed Pendzik ependzik@harris.com //------------------------------------------------------------ btop="/fs" confopts="\ --sysconfdir=$btop \ --localstatedir=$btop \ --prefix=$btop \ CC=$HOME/qccbird \ CFLAGS=-V4.4.2,gcc_ntoarmle \ --disable-pthreads \ --build=i686-pc-linux-gnu \ --host=arm-unknown-nto-qnx6.5.0 \ --with-sysconfig=qnx \ --with-protocols=ospf,pipe,static,bfd,rip \ --enable-debug \ --disable-client \ " ./configure $confopts //------------------------------------------------------------ // WITH PTHREADS (--enable-pthreads) // console output 117.localhost_root 2014-12-11 06:10:06 <TRACE> direct1: Initializing 2014-12-11 06:10:06 <TRACE> kernel1: Initializing 2014-12-11 06:10:06 <TRACE> device1: Initializing 2014-12-11 06:10:06 <TRACE> ospf1: Initializing 2014-12-11 06:10:06 <TRACE> device1: Starting 2014-12-11 06:10:06 <TRACE> device1: Scanning interfaces @@@ if_notify_change: this is debug() @@@ if_notify_change: this is DBG() Interface change notification (1) for lo0 IF1: lo0 UP LINK-UP MA LOOP IGN MTU=33192 127.0.0.1, net 127.0.0.0/8 bc 0.0.0.0 -> 0.0.0.0 DOWN unlinking old /fs/coredumps/bird.core dumping to /fs/coredumps/bird.core thread 1.flags is 0x1 thread 1 is was SIGNALLED thread 1.why is 0x1 ldd mapinfos: Thread 1's SP is at 0xff7d4 Adjusting 24576 bytes @ 0xfa000->0x100000 to 4096 bytes @ 0xff000->0x100000 thread 1 is current thread! blanking 24576 bytes of stack memory at 0xff000 max=0x6000, min = 0x5000 (0xff000->0x100000) dumping 483328 bytes of memory at 0x100000 dumping 8192 bytes of memory at 0x176000 dumping 4096 bytes of memory at 0x178000 dumping 135168 bytes of memory at 0x179000 dumping 471040 bytes of memory at 0x1000000 dumping 16384 bytes of memory at 0x1073000 dumping 4096 bytes of memory at 0x1077000 dumping 172032 bytes of memory at 0x78000000 dumping 24576 bytes of memory at 0x7802a000 ntoarm-gdb bird bird.core GNU gdb 6.8 qnx-nto (rev. 506) Copyright (C) 2008 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 "--host=i686-pc-linux-gnu --target=arm-unknown-nto-qnx6.5.0"... Reading symbols from /home2/opt/qnx650sp1/target/qnx6/armle/lib/libsocket.so.3...done. Loaded symbols for /home2/opt/qnx650sp1/target/qnx6/armle/lib/libsocket.so.3 Reading symbols from /home2/opt/qnx650sp1/target/qnx6/armle/lib/libc.so.3...done. Loaded symbols for /home2/opt/qnx650sp1/target/qnx6/armle/lib/libc.so.3 Program terminated with signal 10, Bus error. [New pid 1708126 tid 1] #0 0x00111460 in if_notify_change (c=1, i=0x187050) at ../../nest/iface.c:218 218 WALK_LIST(p, active_proto_list) (gdb) whete Undefined command: "whete". Try "help". (gdb) where #0 0x00111460 in if_notify_change (c=1, i=0x187050) at ../../nest/iface.c:218 #1 0x00111624 in if_change_flags (i=0x187050, flags=1073742306) at ../../nest/iface.c:254 #2 0x00111988 in if_end_partial_update (i=0x187050) at ../../nest/iface.c:350 #3 0x00111a34 in if_end_update () at ../../nest/iface.c:368 #4 0x0015a184 in kif_do_scan (p=0x18a528) at krt-sock.c:894 #5 0x0015ab0c in kif_scan (t=0x1860d0) at krt.c:98 #6 0x0015af64 in kif_start (P=0x18a528) at krt.c:191 #7 0x0010e22c in proto_rethink_goal (p=0x18a528) at ../../nest/proto.c:632 #8 0x0010dff0 in protos_commit (new=0x18f9a8, old=0x0, force_reconfig=0, type=1) at ../../nest/proto.c:580 #9 0x00151df0 in config_do_commit (c=0x18f9a8, type=1) at conf.c:255 #10 0x00152030 in config_commit (c=0x18f9a8, type=1, timeout=0) at conf.c:348 #11 0x0015f788 in main (argc=2, argv=0xff944) at main.c:822 (gdb) //------------------------------------------------------------ // WITHOUT PTHREADS (--disable-pthreads) // console output 128.localhost_root 2014-12-11 06:15:41 <TRACE> direct1: Initializing 2014-12-11 06:15:41 <TRACE> kernel1: Initializing 2014-12-11 06:15:41 <TRACE> device1: Initializing 2014-12-11 06:15:41 <TRACE> ospf1: Initializing 2014-12-11 06:15:41 <TRACE> device1: Starting 2014-12-11 06:15:41 <TRACE> device1: Scanning interfaces dumping to /fs/coredumps/bird.core thread 1.flags is 0x1 thread 1 is was SIGNALLED thread 1.why is 0x1 ldd mapinfos: Thread 1's SP is at 0xff828 Adjusting 24576 bytes @ 0xfa000->0x100000 to 4096 bytes @ 0xff000->0x100000 thread 1 is current thread! blanking 24576 bytes of stack memory at 0xff000 max=0x6000, min = 0x5000 (0xff000->0x100000) dumping 483328 bytes of memory at 0x100000 dumping 8192 bytes of memory at 0x176000 dumping 4096 bytes of memory at 0x178000 dumping 98304 bytes of memory at 0x179000 dumping 471040 bytes of memory at 0x1000000 dumping 16384 bytes of memory at 0x1073000 dumping 4096 bytes of memory at 0x1077000 dumping 172032 bytes of memory at 0x78000000 dumping 24576 bytes of memory at 0x7802a000 ntoarm-gdb bird bird.core GNU gdb 6.8 qnx-nto (rev. 506) Copyright (C) 2008 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 "--host=i686-pc-linux-gnu --target=arm-unknown-nto-qnx6.5.0"... warning: Host file /home2/opt/qnx650sp1/target/qnx6/armle/lib/libsocket.so.3 does not match target file. warning: Host file /home2/opt/qnx650sp1/target/qnx6/armle/lib/libc.so.3 does not match target file. Reading symbols from /home2/opt/qnx650sp1/target/qnx6/armle/lib/libsocket.so.3...done. Loaded symbols for /home2/opt/qnx650sp1/target/qnx6/armle/lib/libsocket.so.3 Reading symbols from /home2/opt/qnx650sp1/target/qnx6/armle/lib/libc.so.3...done. Loaded symbols for /home2/opt/qnx650sp1/target/qnx6/armle/lib/libc.so.3 Program terminated with signal 11, Segmentation fault. [New pid 2158686 tid 1] #0 0x001118c0 in if_start_update () at ../../nest/iface.c:338 338 WALK_LIST(i, iface_list) (gdb) bt #0 0x001118c0 in if_start_update () at ../../nest/iface.c:338 #1 0x0015a0fc in kif_do_scan (p=0x18a528) at krt-sock.c:892 #2 0x0015aa9c in kif_scan (t=0x1860d0) at krt.c:98 #3 0x0015aef4 in kif_start (P=0x18a528) at krt.c:191 #4 0x0010e1bc in proto_rethink_goal (p=0x18a528) at ../../nest/proto.c:632 #5 0x0010df80 in protos_commit (new=0x18f9a8, old=0x0, force_reconfig=0, type=1) at ../../nest/proto.c:580 #6 0x00151d80 in config_do_commit (c=0x18f9a8, type=1) at conf.c:255 #7 0x00151fc0 in config_commit (c=0x18f9a8, type=1, timeout=0) at conf.c:348 #8 0x0015f6cc in main (argc=2, argv=0xff944) at main.c:822 (gdb)
On Thu, Dec 11, 2014 at 06:48:10AM +0000, Pendzik, Edward wrote:
Thu Dec 11 01:46:41 EST 2014
Hello.
I am working on porting bird 1.4.5 to QNX SP1 (QNX OS service pack 1). QNX is actually close to BSD and there have been very few changes to the code.
I have bird built but I get a core dump on initialization. I was hoping that someone could give me some specific ideas on exactly where to look while debugging. I have many years of writing and debugging Linux and Solaris drivers and networking code, but I am not yet familiar with the bird internal data structures. ...
confopts="\ --sysconfdir=$btop \ --localstatedir=$btop \ --prefix=$btop \ CC=$HOME/qccbird \ CFLAGS=-V4.4.2,gcc_ntoarmle \
Hello What is the compiler, GCC? If your CFLAGS override options override the default ones, you should keep -fno-strict-aliasing and -fno-strict-overflow as we have some problems with aggresive GCC optimizations in list functions. Or you could try to compile it with disabled optimizations. -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
participants (2)
-
Ondrej Zajicek -
Pendzik, Edward