openwrt / odhcpd

This repository is a mirror of https://git.openwrt.org/?p=project/odhcpd.git. Pull requests will be accepted which will be merged in odhcpd.git
GNU General Public License v2.0
161 stars 98 forks source link

odhcpd crashes in libc #57

Closed hnyman closed 9 years ago

hnyman commented 9 years ago

Today's update to odhcpd seems deadly: odhcpd crashes immediately at boot and the same happens if tried to start manually. It seems to crash in libc.o, so it might be some conversion function from today's changes.

Mon Sep  7 16:21:36 2015 kern.info kernel: [  827.241405] do_page_fault(): sending SIGSEGV to odhcpd for invalid read access from 00000000
Mon Sep  7 16:21:36 2015 kern.info kernel: [  827.249939] epc = 771954d8 in libc.so[77122000+95000]
Mon Sep  7 16:21:36 2015 kern.info kernel: [  827.255007] ra  = 004064f5 in odhcpd[400000+b000]
Mon Sep  7 16:21:36 2015 kern.info kernel: [  827.259771]
Mon Sep  7 16:21:36 2015 daemon.info procd: Instance odhcpd::instance1 s in a crash loop 6 crashes, 0 seconds since last crash

The previous build 2 days ago worked ok.

ar71xx / WNDR3700 / trunk with default musl etc. native ipv6

sbyx commented 9 years ago

sorry, should be fixed now.

hnyman commented 9 years ago

Debug data from gdb:

Command name abbreviations are allowed if unambiguous.
(gdb) c
Continuing.

Program received signal SIGSEGV, Segmentation fault.
memcpy (dest=dest@entry=0x77f33ea1, src=<optimized out>, n=14)
    at src/string/memcpy.c:107
107         *d++ = *s++; *d++ = *s++; *d++ = *s++; *d++ = *s++;
(gdb) bt full
#0  memcpy (dest=dest@entry=0x77f33ea1, src=<optimized out>, n=14)
    at src/string/memcpy.c:107
        d = 0x77f33ea2 ""
        s = 0x1 <error: Cannot access memory at address 0x1>
        w = <optimized out>
        x = <optimized out>
#1  0x004064f4 in setup_dhcpv6_ia_interface (iface=iface@entry=0x77f333f0, 
    enable=enable@entry=true)
    at /Openwrt/trunk/build_dir/target-mips_34kc_musl-1.1.11/odhcpd-2015-09-07/src/dhcpv6-ia.c:112
        duid_len = 14
        a = 0x77f33db0
        c = <optimized out>
        lease = 0x77f05900
#2  0x00404e1c in setup_dhcpv6_interface (iface=iface@entry=0x77f333f0, 
    enable=enable@entry=true)
    at /Openwrt/trunk/build_dir/target-mips_34kc_musl-1.1.11/odhcpd-2015-09-07/src/dhcpv6.c:97
No locals.
#3  0x00403488 in odhcpd_reload ()
    at /Openwrt/trunk/build_dir/target-mips_34kc_musl-1.1.11/odhcpd-2015-09-07/src/config.c:675
        uci = 0x77f4cec0
        master = 0x0
        i = 0x77f333f0
        n = 0x41b01c <interfaces>
        dhcp = 0x77f4cdb0
        any_dhcpv6_slave = <optimized out>
        any_ra_slave = false
        any_ndp_slave = false
#4  0x00408324 in handle_dump (req=<optimized out>, type=<optimized out>, 
    msg=<optimized out>)
    at /Openwrt/trunk/build_dir/target-mips_34kc_musl-1.1.11/odhcpd-2015-09-07/src/ubus.c:188
        tb = {0x41c020}
#5  0x77f088fa in ?? ()
No symbol table info available.
(gdb) 
hnyman commented 9 years ago

Thanks, I compiled a new version and installed the .ipk to the router. Seems to work.