[Olsr-dev] OLSRd SegFault

Ferry Huberts (spam-protected)
Wed Apr 20 23:25:41 CEST 2016


I've pushed the patch upstream already since I'm betting it fixes the 
issue and because it fixes something that needed fixing anyway.



On 20/04/16 23:14, Ferry Huberts wrote:
>
>
> On 20/04/16 22:25, Gabriel wrote:
>>
>> On 20/04/2016 21:49, Ferry Huberts wrote:
>>> Please give me more info so that I can try to reproduce it.
>>>
>>> How did you compile?
>> I compiled it locally on the machine, i've tryied a couple of times.
>> These are the commands i use:
>>
>> git clone https://github.com/OLSR/olsrd.git
>> cd olsrd
>> make
>> make libs
>> make install
>> make install_libs
>>
>>
>>> How did you run?
>>
>> /usr/local/sbin/olsrd -f /etc/olsrd/olsrd.conf.netjson
>>
>>
>>> What do your interface look like (ifconfig)?
>> 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
>>      link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
>>      inet 127.0.0.1/8 scope host lo
>>         valid_lft forever preferred_lft forever
>>      inet6 fdc0:ffee::10:150:25:1/128 scope global
>>         valid_lft forever preferred_lft forever
>>      inet6 ::1/128 scope host
>>         valid_lft forever preferred_lft forever
>> 2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue
>> master br0 state DOWN
>>      link/ether 04:18:d6:31:37:9f brd ff:ff:ff:ff:ff:ff
>> 3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state
>> UNKNOWN
>>      link/ether 04:18:d6:31:37:a0 brd ff:ff:ff:ff:ff:ff
>>      inet6 fe80::618:d6ff:fe31:37a0/64 scope link
>>         valid_lft forever preferred_lft forever
>> 4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state
>> UNKNOWN
>>      link/ether 04:18:d6:31:37:a1 brd ff:ff:ff:ff:ff:ff
>>      inet 150.***.***.***/24 brd 150.***.***.255 scope global eth2
>>         valid_lft forever preferred_lft forever
>>      inet6 fe80::618:d6ff:fe31:37a1/64 scope link
>>         valid_lft forever preferred_lft forever
>> 5: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
>>      link/ether 04:18:d6:31:37:9f brd ff:ff:ff:ff:ff:ff
>>      inet 10.150.25.1/24 brd 10.150.25.255 scope global br0
>>         valid_lft forever preferred_lft forever
>>      inet6 fe80::9850:fcff:febf:9894/64 scope link
>>         valid_lft forever preferred_lft forever
>> 6: (spam-protected): <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue
>> state UP
>>      link/ether 04:18:d6:31:37:a0 brd ff:ff:ff:ff:ff:ff
>>      inet 172.19.189.3/16 brd 172.19.255.255 scope global eth1.4
>>         valid_lft forever preferred_lft forever
>>      inet6 fe80::618:d6ff:fe31:37a0/64 scope link
>>         valid_lft forever preferred_lft forever
>> 7: (spam-protected): <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue
>> state UP
>>      link/ether 04:18:d6:31:37:a0 brd ff:ff:ff:ff:ff:ff
>>      inet 172.19.189.2/16 brd 172.19.255.255 scope global eth1.3
>>         valid_lft forever preferred_lft forever
>>      inet6 fe80::618:d6ff:fe31:37a0/64 scope link
>>         valid_lft forever preferred_lft forever
>> 8: (spam-protected): <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue
>> master br0 state UP
>>      link/ether 04:18:d6:31:37:a0 brd ff:ff:ff:ff:ff:ff
>>      inet6 fe80::618:d6ff:fe31:37a0/64 scope link
>>         valid_lft forever preferred_lft forever
>> 9: (spam-protected): <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue
>> state UP
>>      link/ether 04:18:d6:31:37:a0 brd ff:ff:ff:ff:ff:ff
>>      inet 172.19.189.1/16 brd 172.19.255.255 scope global eth1.2
>>         valid_lft forever preferred_lft forever
>>      inet6 fe80::618:d6ff:fe31:37a0/64 scope link
>>         valid_lft forever preferred_lft forever
>> 10: (spam-protected): <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc
>> noqueue state UP
>>      link/ether 04:18:d6:31:37:a0 brd ff:ff:ff:ff:ff:ff
>>      inet 172.19.189.4/16 brd 172.19.255.255 scope global eth1.5
>>         valid_lft forever preferred_lft forever
>>      inet6 fe80::618:d6ff:fe31:37a0/64 scope link
>>         valid_lft forever preferred_lft forever
>>
>>
>>
>>>
>>> When does it crash? During startup?
>>
>> It crashes immediatly, but looking at the stdout it looks like it
>> crashes after he interact with some peer.
>>
>> I've made a test only with br0 as interface and it doesn't crashes.
>>
>>
>>
>>>
>>> It works fine for me.
>>
>> I think the key point is the MIPS architecture.
>>
>> 2 years ago I found a bug on this architecture.
>> https://github.com/OLSR/olsrd/commit/f1db5724d04dc92866afe60858c344cc29b0b18e
>>
>
> I fail to see what that commit has to do with this problem
>
>>
>> It was causing a SegFault only on MIPS machines.
>>
>>
>>
>>>
>>> Try to run with a debug version (DEBUG=1) and with -nofork.
>>> If it crashes then repeat it using strace.
>>
>>
>> This is the output of gdb backtrace
>>
>> IP addr (2-hop)  IP addr (1-hop)  Total cost
>> Received MID from NON SYM neighbor 172.19.64.1
>> Received MID from NON SYM neighbor 172.19.64.1
>> Received HNA from NON SYM neighbor 172.19.64.1
>> Received MID from NON SYM neighbor 172.19.64.1
>> Received HNA from NON SYM neighbor 172.19.64.1
>> Received HNA from NON SYM neighbor 172.19.64.1
>> Adding 172.19.189.4=>172.19.64.1 to link set
>>
>> Program received signal SIGSEGV, Segmentation fault.
>> 0x00425844 in set_loss_link_multiplier (entry=0x4a4d08) at
>> src/link_set.c:361
>> 361      OLSR_PRINTF(1, "Set linkloss multiplier for %s on %s to %d\n",
>
> that is weird, it crashes in the olsr_printf
>
> Does the attached patch help?
>
>> (gdb) bt
>> #0  0x00425844 in set_loss_link_multiplier (entry=0x4a4d08) at
>> src/link_set.c:361
>> #1  0x004265a0 in add_link_entry (local=0x4a3474, remote=0x7fdff194,
>> remote_main=0x7fdff050, vtime=20000, htime=2000, local_if=0x4a3408) at
>> src/link_set.c:602
>> #2  0x00426ce4 in update_link_entry (local=0x4a3474, remote=0x7fdff194,
>> message=0x7fdff048, in_if=0x4a3408) at src/link_set.c:702
>> #3  0x00440ee4 in olsr_hello_tap (message=0x7fdff048, in_if=0x4a3408,
>> from_addr=0x7fdff194) at src/process_package.c:417
>> #4  0x00440d70 in olsr_input_hello (ser=0x493a40, inif=0x4a3408,
>> from=0x7fdff194) at src/process_package.c:385
>> #5  0x0043d484 in parse_packet (olsr=0x4939b4, size=196, in_if=0x4a3408,
>> from_addr=0x7fdff194) at src/parser.c:397
>> #6  0x0043da90 in olsr_input (fd=11, data=0x0, flags=1) at
>> src/parser.c:511
>> #7  0x004460a0 in poll_sockets () at src/scheduler.c:382
>> #8  0x00446b3c in olsr_scheduler () at src/scheduler.c:540
>> #9  0x00430ab4 in main (argc=6, argv=0x7fdff934) at src/main.c:738
>> (gdb)
>>

-- 
Ferry Huberts



More information about the Olsr-dev mailing list