Closed ae6xe closed 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')
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
ok thanks for working that out. fixed by 42f8417095531f152311c79d8c8c986be98ac0fd on master
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)