New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coredump when compiled with gcc under SunOS sparc #780

Open
michaelortmann opened this Issue Nov 23, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@michaelortmann
Member

michaelortmann commented Nov 23, 2018

[08:31:23] net: connect! sock 4
[08:31:23] DNS Resolver: Creating new record
[08:31:23] DNS Resolver: Sent domain lookup request for "<ip>".
[08:31:23] DNS Resolver: Received nameserver reply. (qd:1 an:1 ns:0 ar:0)
[08:31:23] DNS Resolver: answered domain query: "<ip>.in-addr.arpa"
[08:31:23] * Last context: tclhash.c/749 []
[08:31:23] * Please REPORT this BUG!
[08:31:23] * Check doc/BUG-REPORT on how to do so.
[08:31:23] * Wrote DEBUG
[08:31:23] * BUS ERROR -- CRASHING!
Bus Error (core dumped)

(gdb) bt full
#0  parserespacket (response=0xffffffff7ca48c80 <resrecvbuf> "8r\201\200", len=<optimized out>) at .././dns.mod/coredns.c:988
        rp = 0x100c0b450
        qclass = <optimized out>
        r = <optimized out>
        rcount = 1
        hdr = 0xffffffff7ca48c80 <resrecvbuf>
        qdatatype = <optimized out>
        rr = 0xffffffff7ca48cae <resrecvbuf+46>
        rc = <optimized out>
        c = 0xffffffff7ca48c80 <resrecvbuf> "8r\201\200"
        len = <optimized out>
        response = 0xffffffff7ca48c80 <resrecvbuf> "8r\201\200"
        c = 0xffffffff7ca48c80 <resrecvbuf> "8r\201\200"
#1  0xffffffff7c90729c in dns_ack () at .././dns.mod/coredns.c:1109
        from = {sin_family = 2, sin_port = 53, sin_addr = {S_un = {S_un_b = {s_b1 = 37 '%', s_b2 = 58 ':', s_b3 = 58 ':', s_b4 = 137 '\211'}, S_un_w = {s_w1 = 9530, s_w2 = 14985}, S_addr = 624573065}}, 
          sin_zero = "\000\000\000\000\000\000\000"}
        fromlen = 16
        r = <optimized out>
        i = <optimized out>
#2  dns_socket (idx=<optimized out>, buf=0xffffffff7ffff270 "", len=<optimized out>) at .././dns.mod/dns.c:104
No locals.
#3  0x0000000100052c70 in mainloop (toplevel=toplevel@entry=1) at ./main.c:881
        idx = <optimized out>
        socket_cleanup = 4
        xx = <optimized out>
        i = 0
        eggbusy = 1
        tclbusy = 0
        buf = "\000\000\000\000\000\000\000s\377\377\377\377\177\377\357\070\377\377\377\377}\330\267\250\000\000\000\000\000\000\027\250\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\006\000\000\000\000\000\000\000\000\377\377\377\377\177\377\362\270", '\000' <repeats 23 times>, "\001\000\000\000\001\000\312l\220\377\377\377\377\177\377\353\021\377\377\377\377\177\003k\354\000\000\000\000\000\000\003\376\000\000\000\000\177\377\374\000\000\000\000\001\000\307/\330\000\000\000\000\000\000\000\001\000\000\000\001\000\301\223P\000\000\000\001\000\030P\000\000\000\000\000\000\001t\021\000\000\000\001\000\030`\000\000\000\000\000\000\000\vK\000\000\000\001\000\302\313\200\000\000\000\001\000\001\220\000\000\000\000\000\000\000\000"...
#4  0x000000010007e3f0 in main (arg_c=<optimized out>, arg_v=<optimized out>) at ./main.c:1286
        i = <optimized out>
        xx = <optimized out>
        s = "Fri Nov 23 2018\000:03 2018"
        f = <optimized out>
        sv = {sa_flags = 0, _funcptr = {_handler = 0x100051de8 <got_alarm>, _sigaction = 0x100051de8 <got_alarm>}, sa_mask = {__sigbits = {0, 0, 0, 0}}}
        chan = <optimized out>
        cdlim = {rlim_cur = 18446744073709551613, rlim_max = 18446744073709551613}

Repeatable by connecting to the bot.

My first guess was classic alignment error under SunOS sparc, may even be the one i found and fixed by #759 but could not demo back then, and i was right, so consider this Issue prof of concept, and never ignore a sanitizer warning about alignment!

@michaelortmann michaelortmann referenced a pull request that will close this issue Nov 23, 2018

Open

Fix misaligned address in coredns.c #759

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment