[Olsr-dev] OLSRv2 Segfault

Syed Salman Haider Rizvi (spam-protected)
Tue Jan 7 10:59:34 CET 2014

Hi Henning Sir ,
       I m getting following error while cross compiling for my openwrt attitude adjustment . Log is given below 
[  6%] Built target oonf_commonmake[6]: Entering directory `/home/salman/openwrt/attitude_adjustment/build_dir/target-mips_r2_uClibc-'make[6]: Leaving directory `/home/salman/openwrt/attitude_adjustment/build_dir/target-mips_r2_uClibc-'make[6]: Entering directory `/home/salman/openwrt/attitude_adjustment/build_dir/target-mips_r2_uClibc-'Linking C static library ../../liboonf_static_common.a/home/salman/openwrt/attitude_adjustment/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc- two different operation options specifiedmake[6]: *** [liboonf_static_common.a] Error 1make[6]: Leaving directory `/home/salman/openwrt/attitude_adjustment/build_dir/target-mips_r2_uClibc-'make[5]: *** [src-api/common/CMakeFiles/oonf_static_common.dir/all] Error 2make[5]: Leaving directory `/home/salman/openwrt/attitude_adjustment/build_dir/target-mips_r2_uClibc-'make[4]: *** [all] Error 2make[4]: Leaving directory `/home/salman/openwrt/attitude_adjustment/build_dir/target-mips_r2_uClibc-'make[3]: *** [/home/salman/openwrt/attitude_adjustment/build_dir/target-mips_r2_uClibc-] Error 2make[3]: Leaving directory `/home/salman/openwrt/attitude_adjustment/package/oonf_api/openwrt/oonf-api'make[2]: *** [package/oonf_api/openwrt/oonf-api/compile] Error 2make[2]: Leaving directory `/home/salman/openwrt/attitude_adjustment'make[1]: *** [/home/salman/openwrt/attitude_adjustment/staging_dir/target-mips_r2_uClibc-] Error 2make[1]: Leaving directory `/home/salman/openwrt/attitude_adjustment'make: *** [world] Error 2
Please let me know if the problem is at my end , the last update oonf_api was working fine for me 

From: (spam-protected)
Date: Mon, 30 Dec 2013 11:00:07 +0100
Subject: Re: [Olsr-dev] OLSRv2 Segfault
To: (spam-protected)
CC: (spam-protected); (spam-protected)

Thank you for the GDB log,
it seems that the Hello generation fails... I have to look more closely into the problem when I am back at work next week, but I committed your patch as a hotfix until I know what the hell is going on.

@Syed Salman Haider Rizvi:I have also added a patch to OLSRD2 that allows to switch off the linkspeed part of the ETT plugin, downgrading it to ETX. So you might also want to have a look into the most recent version.

Henning Rogge 
On Mon, Dec 30, 2013 at 4:50 AM, Vigneswaran R <(spam-protected)> wrote:

On 12/28/2013 12:17 AM, Henning Rogge wrote:


thank you for the bugreport, I would like to dig a little bit deeper

into this problem (maybe writing an automatic test-case afterwards).

Can you post the whole stacktrace from GDB first? That would allow to

identify if the error happens during the creation of a Hello or a TC.

Please find the GDB log attached. Thanks.


Henning Rogge

On Fri, Dec 27, 2013 at 11:10 AM, Vigneswaran R <(spam-protected)> wrote:


I am running olsrd2 on a few (qemu) virtual machines. On one of the virtual

machines, olsrd2 segfaults within a few seconds. I am invoking OLSRd2 in the

following manner,

     ./olsrd2 --set interface[eth0].bindto= --set

interface[eth1].bindto= --set interface[eth2].bindto=

Traced the error using gdb to some extent. Please see the following patch

for context.

In general, addr_start->_block_end becomes NULL just before exiting from the

do..while loop. However, in some cases, addr_start->_block_end becomes NULL

before the do..while loop meeting the exit criteria (addr_end == last_addr).

So, the loop continues and trying to de-reference NULL pointer causing


--- a/oonf_api/src-api/rfc5444/rfc5444_msg_generator.c    2013-12-19

18:27:48.471467295 +0530

+++ b/oonf_api/src-api/rfc5444/rfc5444_msg_generator.c    2013-12-27

14:15:14.000000000 +0530

@@ -1180,7 +1180,7 @@

      tlvblock_length[0] = (ptr - tlvblock_length - 2) >> 8;

      tlvblock_length[1] = (ptr - tlvblock_length - 2) & 255;

      addr_start = list_next_element(addr_end, _addr_node);

-  } while (addr_end != last_addr);

+  } while (addr_end != last_addr && addr_start->_block_end != NULL);

    /* store size of address(tlv) data */

    msg->_bin_addr_size = ptr - start;

I am using the latest oonf_api (last commit:

2355db6a460abe10cc7096842b3b10686c68012c) and olsrd2 (last commit:

23051120419372a175ddb08fa8a3bb8d7d709f1e) repositories.

The Interface details are,

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN

     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

     inet scope host lo

     inet6 ::1/128 scope host

        valid_lft forever preferred_lft forever

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state

UP qlen 1000

     link/ether de:ad:be:ef:5a:38 brd ff:ff:ff:ff:ff:ff

     inet brd scope global eth0

     inet6 fe80::dcad:beff:feef:5a38/64 scope link

        valid_lft forever preferred_lft forever

3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state

UP qlen 1000

     link/ether de:ad:be:ef:0d:2f brd ff:ff:ff:ff:ff:ff

     inet brd scope global eth1

     inet6 fe80::dcad:beff:feef:d2f/64 scope link

        valid_lft forever preferred_lft forever

4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state

UP qlen 1000

     link/ether de:ad:be:ef:5a:39 brd ff:ff:ff:ff:ff:ff

     inet brd scope global eth2

     inet6 fe80::dcad:beff:feef:5a39/64 scope link

        valid_lft forever preferred_lft forever




Olsr-dev mailing list



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.olsr.org/pipermail/olsr-dev/attachments/20140107/046f9746/attachment.html>

More information about the Olsr-dev mailing list