OLSR / olsrd

OLSR.org main repository - olsrd v1 - maintained by Freifunk Berlin
Other
84 stars 65 forks source link

Merge: bugfix: jsoninfo segfault on ar71xx #47

Closed ae6xe closed 7 years ago

ae6xe commented 7 years ago

olsrv1: 0.9.6.2-git_8e32ff4-hash_cdaa6990297f6561cff31a78a3e5d4e6 openwrt: Chaos Calmer r48676 architecture: ar71xx (Ubiquiti AirMax line -- Failed on NSM2 XM, bullet M2, NS M2 Loco, a couple others) linux-3.18.29

Program received signal SIGSEGV, Segmentation fault. 0x00000000 in ?? () (gdb) bt

0 0x00000000 in ?? ()

1 0x77cae67a in abuf_json_float (session=0x77cc33b0 ,

abuf=, key=, value=0) at ../info/json_helpers.c:191

2 0x77caa4b4 in ipc_print_links (abuf=0x77cc4420 <info_cache+32>) at

src/olsrd_jsoninfo.c:535

3 0x77caf30a in send_info_from_table (abuf=,

send_what=, funcs=, funcsSize=<optimized out>, outputLength=0x7fff6120) at ../info/olsrd_info.c:447

4 0x77caf74c in send_info (req=,

add_headers=, send_what=16383, the_socket=<optimized out>, status=200) at ../info/olsrd_info.c:516

5 0x77cafdb4 in ipc_action (fd=, data=<optimized

out>, flags=) at ../info/olsrd_info.c:950

6 0x0040b7e2 in poll_sockets () at src/scheduler.c:394

7 0x0040c382 in olsr_scheduler () at src/scheduler.c:552

8 0x00407fb2 in main (argc=, argv=) at

src/main.c:775 (gdb)

fhuberts commented 7 years ago

please first check whether there is a define (that is currently not set in the build) that exposes isinf and isnan (see 'man isnan' and 'man isinf')

cmlara commented 7 years ago

Of note, this issue was only observed on OpenWrt which uses uclibc which is known not to link the math library unless specifically requested (which is standards compliant to my knowledge)

On a quick test adding the following to lib/jsoninfo/Makefile appears to solve the segfault on OpenWRT. LDFLAGS += -lm

fhuberts commented 7 years ago

ok thanks for working that out. fixed by 42f8417095531f152311c79d8c8c986be98ac0fd on master