rspamd icon indicating copy to clipboard operation
rspamd copied to clipboard

rdns timeout crash

Open wvolz opened this issue 10 years ago • 11 comments

I'm seeing another crash that I think is related to reverse DNS lookups. Backtrace and stack trace info below:

GNU gdb (Debian 7.7.1+dfsg-5) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/rspamd...(no debugging symbols found)...done.
[New LWP 8476]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `rspamd: normal process                       '.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00000000008f6ea8 in ?? ()
(gdb) bt full
#0  0x00000000008f6ea8 in ?? ()
No symbol table info available.
#1  0x00000000008f8371 in rdns_process_timer ()
No symbol table info available.
#2  0x00007f05d5ede3dc in event_base_loop () from /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5
No symbol table info available.
#3  0x0000000000444846 in start_worker ()
No symbol table info available.
#4  0x00000000004c632d in rspamd_fork_worker ()
No symbol table info available.
#5  0x0000000000441e53 in ?? ()
No symbol table info available.
#6  0x0000000000442402 in ?? ()
No symbol table info available.
#7  0x0000000000437170 in main ()
No symbol table info available.
(gdb) 

strace buffer:

sendto(21, "\301\263\1\0\0\1\0\0\0\0\0\1\003208\003202\0017\003199\4list\5"..., 57, 0, NULL, 0) = 57
sendto(13, "H}\1\0\0\1\0\0\0\0\0\1\3omp\6emails\7xfinity\3"..., 51, 0, NULL, 0) = 51
sendto(18, "\0267\1\0\0\1\0\0\0\0\0\1\6envfrm\5rsys5\3com\0\0\34"..., 45, 0, NULL, 0) = 45
epoll_wait(4, {{EPOLLERR, {u32=20, u64=20}}, {EPOLLERR, {u32=15, u64=15}}, {EPOLLERR, {u32=17, u64=17}}, {EPOLLERR, {u32=22, u64=22}}, {EPOLLERR, {u32=19, u64=19}}, {EPOLLERR, {u32=21, u64=21}}, {EPOLLERR, {u32=13, u64=13}}, {EPOLLERR, {u32=18, u64=18}}}, 32, 1) = 8
read(20, 0x7ffe7f258830, 4096)          = -1 ECONNREFUSED (Connection refused)
read(15, 0x7ffe7f258830, 4096)          = -1 ECONNREFUSED (Connection refused)
read(17, 0x7ffe7f258830, 4096)          = -1 ECONNREFUSED (Connection refused)
read(22, 0x7ffe7f258830, 4096)          = -1 ECONNREFUSED (Connection refused)
read(19, 0x7ffe7f258830, 4096)          = -1 ECONNREFUSED (Connection refused)
read(21, 0x7ffe7f258830, 4096)          = -1 ECONNREFUSED (Connection refused)
read(13, 0x7ffe7f258830, 4096)          = -1 ECONNREFUSED (Connection refused)
read(18, 0x7ffe7f258830, 4096)          = -1 ECONNREFUSED (Connection refused)
sendto(13, "\37\340\1\0\0\1\0\0\0\0\0\1\6_dmarc\6emails\7xfini"..., 54, 0, NULL, 0) = 54
epoll_wait(4, {{EPOLLERR, {u32=13, u64=13}}}, 32, 998) = 1
read(13, 0x7ffe7f258830, 4096)          = -1 ECONNREFUSED (Connection refused)
epoll_wait(4, {}, 32, 998)              = 0
sendto(18, "\0267\1\0\0\1\0\0\0\0\0\1\6envfrm\5rsys5\3com\0\0\34"..., 45, 0, NULL, 0) = 45
sendto(20, "\6h\1\0\0\1\0\0\0\0\0\1\5adnxs\3com\6public\5sa"..., 55, 0, NULL, 0) = 55
sendto(15, "\202\35\1\0\0\1\0\0\0\0\0\1\7xfinity\3com\5multi\5u"..., 56, 0, NULL, 0) = 56
sendto(20, "\314\261\1\0\0\1\0\0\0\0\0\1\7xfinity\3com\0\0\1\0\1\0\0)"..., 40, 0, NULL, 0) = -1 ECONNREFUSED (Connection refused)
sendto(13, "H}\1\0\0\1\0\0\0\0\0\1\3omp\6emails\7xfinity\3"..., 51, 0, NULL, 0) = 51
sendto(19, "\363L\1\0\0\1\0\0\0\0\0\1\003208\003202\0017\003199\3xbl\10s"..., 59, 0, NULL, 0) = 59
sendto(21, "\301\263\1\0\0\1\0\0\0\0\0\1\003208\003202\0017\003199\4list\5"..., 57, 0, NULL, 0) = 57
sendto(17, "\320\223\1\0\0\1\0\0\0\0\0\1\6envfrm\5rsys5\3com\0\0\1"..., 45, 0, NULL, 0) = 45
sendto(22, "\276\27\1\0\0\1\0\0\0\0\0\1\7xfinity\3com\5multi\5s"..., 56, 0, NULL, 0) = 56
epoll_wait(4, {{EPOLLERR, {u32=18, u64=18}}, {EPOLLERR, {u32=15, u64=15}}, {EPOLLERR, {u32=13, u64=13}}, {EPOLLERR, {u32=19, u64=19}}, {EPOLLERR, {u32=21, u64=21}}, {EPOLLERR, {u32=17, u64=17}}, {EPOLLERR, {u32=22, u64=22}}}, 32, 1) = 7
read(18, 0x7ffe7f258830, 4096)          = -1 ECONNREFUSED (Connection refused)
read(15, 0x7ffe7f258830, 4096)          = -1 ECONNREFUSED (Connection refused)
read(13, 0x7ffe7f258830, 4096)          = -1 ECONNREFUSED (Connection refused)
read(19, 0x7ffe7f258830, 4096)          = -1 ECONNREFUSED (Connection refused)
read(21, 0x7ffe7f258830, 4096)          = -1 ECONNREFUSED (Connection refused)
read(17, 0x7ffe7f258830, 4096)          = -1 ECONNREFUSED (Connection refused)
read(22, 0x7ffe7f258830, 4096)          = -1 ECONNREFUSED (Connection refused)
sendto(13, "\37\340\1\0\0\1\0\0\0\0\0\1\6_dmarc\6emails\7xfini"..., 54, 0, NULL, 0) = 54
epoll_wait(4, {{EPOLLERR, {u32=13, u64=13}}}, 32, 998) = 1
read(13, 0x7ffe7f258830, 4096)          = -1 ECONNREFUSED (Connection refused)
epoll_wait(4, {}, 32, 997)              = 0
sendto(15, "\0267\1\0\0\1\0\0\0\0\0\1\6envfrm\5rsys5\3com\0\0\34"..., 45, 0, NULL, 0) = 45
sendto(22, "\6h\1\0\0\1\0\0\0\0\0\1\5adnxs\3com\6public\5sa"..., 55, 0, NULL, 0) = 55
sendto(15, "\301\263\1\0\0\1\0\0\0\0\0\1\003208\003202\0017\003199\4list\5"..., 57, 0, NULL, 0) = -1 ECONNREFUSED (Connection refused)
sendto(18, "\276\27\1\0\0\1\0\0\0\0\0\1\7xfinity\3com\5multi\5s"..., 56, 0, NULL, 0) = 56
sendto(19, "\363L\1\0\0\1\0\0\0\0\0\1\003208\003202\0017\003199\3xbl\10s"..., 59, 0, NULL, 0) = 59
sendto(19, "\320\223\1\0\0\1\0\0\0\0\0\1\6envfrm\5rsys5\3com\0\0\1"..., 45, 0, NULL, 0) = -1 ECONNREFUSED (Connection refused)
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x78} ---
+++ killed by SIGSEGV (core dumped) +++

wvolz avatar Sep 20 '16 19:09 wvolz

It would help to show a trace with debug symbols... New back trace with symbols below:

GNU gdb (Debian 7.7.1+dfsg-5) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/rspamd...Reading symbols from /usr/lib/debug/.build-id/31/201c04bf3888b3e7d8ff1a1f51d9a8a9a7e1b9.debug...done.
done.
[New LWP 25232]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `rspamd: normal process                       '.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00000000008f6efe in rdns_request_unschedule (req=req@entry=0x7ff0aebde780)
    at /rspamd-1.3.5/contrib/librdns/resolver.c:245
245 /rspamd-1.3.5/contrib/librdns/resolver.c: No such file or directory.
(gdb) bt full
#0  0x00000000008f6efe in rdns_request_unschedule (req=req@entry=0x7ff0aebde780)
    at /rspamd-1.3.5/contrib/librdns/resolver.c:245
        _hd_bkt = <optimized out>
        _hd_hh_del = <optimized out>
#1  0x00000000008f82cd in rdns_process_timer (arg=0x7ff0aebde780) at /rspamd-1.3.5/contrib/librdns/resolver.c:387
        req = 0x7ff0aebde780
        rep = 0x7ff0d5ffe730
        r = <optimized out>
        renew = <optimized out>
        resolver = <optimized out>
        serv = <optimized out>
        __func__ = "rdns_process_timer"
#2  0x00007ff0d9dd73dc in event_base_loop () from /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5
No symbol table info available.
#3  0x0000000000444846 in start_worker (worker=0x7ff0cdfb1d00) at /rspamd-1.3.5/src/worker.c:564
        ctx = 0x7ff0d5c67660
        lp = <optimized out>
        ltmp = <optimized out>
#4  0x00000000004c632d in rspamd_fork_worker (rspamd_main=0x7ff0d5c66080, cf=0x7ff0d5d88450, index=0, ev_base=0x7fff60f0af00)
    at /rspamd-1.3.5/src/libserver/worker_util.c:596
        rc = 1626386176
        rlim = {rlim_cur = 104857600, rlim_max = 104857600}
        __func__ = "rspamd_fork_worker"
#5  0x0000000000441e53 in spawn_worker_type (rspamd_main=0x7ff0d5c66080, ev_base=0x7ff0d5c0f980, cf=0x7ff0d5d88450)
    at /rspamd-1.3.5/src/rspamd.c:514
        i = 0
#6  0x0000000000442402 in spawn_workers (rspamd_main=rspamd_main@entry=0x7ff0d5c66080, ev_base=ev_base@entry=0x7ff0d5c0f980)
    at /rspamd-1.3.5/src/rspamd.c:596
        cur = 0x7ff0d5c28380
        ls = <optimized out>
        cf = <optimized out>
        p = <optimized out>
        bcf = <optimized out>
        listen_ok = <optimized out>
        seen_mandatory_workers = 0x7ff0d5f0fb20
        cw = <optimized out>
        wrk = <optimized out>
        i = <optimized out>
        __func__ = "spawn_workers"
#7  0x0000000000437170 in main (argc=1, argv=0x7fff60f0b6c8, env=<optimized out>) at /rspamd-1.3.5/src/rspamd.c:1335
        i = <optimized out>
        res = 0
        signals = {__sigaction_handler = {sa_handler = 0x0, sa_sigaction = 0x0}, sa_mask = {__val = {0 <repeats 16 times>}}, 
          sa_flags = 0, sa_restorer = 0x0}
        sigpipe_act = {__sigaction_handler = {sa_handler = 0x1, sa_sigaction = 0x1}, sa_mask = {__val = {4096, 
              0 <repeats 15 times>}}, sa_flags = 0, sa_restorer = 0x4e}
        pworker = <optimized out>
        type = <optimized out>
control_addr = 0x7ff0d5f0e790
        ev_base = 0x7ff0d5c0f980
        term_ev = {ev_active_next = {tqe_next = 0x7fff60f0b220, tqe_prev = 0x21}, ev_next = {tqe_next = 0x7fff60f0b1a0, 
            tqe_prev = 0x7ff0d5c0fae0}, ev_timeout_pos = {ev_next_with_common_timeout = {tqe_next = 0x7ff0ffffffff, 
              tqe_prev = 0x7ff0db0a9c1c <check_match+300>}, min_heap_idx = -1}, ev_fd = 15, ev_base = 0x7ff0d5c0f980, _ev = {
            ev_io = {ev_io_next = {tqe_next = 0x0, tqe_prev = 0x7ff0cdfafc60}, ev_timeout = {tv_sec = 0, tv_usec = 0}}, 
            ev_signal = {ev_signal_next = {tqe_next = 0x0, tqe_prev = 0x7ff0cdfafc60}, ev_ncalls = 0, ev_pncalls = 0x0}}, 
          ev_events = 24, ev_res = 0, ev_flags = 128, ev_pri = 0 '\000', ev_closure = 1 '\001', ev_timeout = {
            tv_sec = 140672443784009, tv_usec = 140734819975592}, ev_callback = 0x441780 <rspamd_term_handler>, 
          ev_arg = 0x7ff0d5c66080}
        int_ev = {ev_active_next = {tqe_next = 0x39a, tqe_prev = 0x7ff0da4dfdb8}, ev_next = {tqe_next = 0x7fff60f0b2c0, 
            tqe_prev = 0x7ff0d5c0fae0}, ev_timeout_pos = {ev_next_with_common_timeout = {tqe_next = 0x7ff0ffffffff, 
              tqe_prev = 0x66}, min_heap_idx = -1}, ev_fd = 2, ev_base = 0x7ff0d5c0f980, _ev = {ev_io = {ev_io_next = {
                tqe_next = 0x0, tqe_prev = 0x7ff0cdfafc90}, ev_timeout = {tv_sec = 0, tv_usec = 0}}, ev_signal = {
              ev_signal_next = {tqe_next = 0x0, tqe_prev = 0x7ff0cdfafc90}, ev_ncalls = 0, ev_pncalls = 0x0}}, 
          ev_events = 24, ev_res = 0, ev_flags = 128, ev_pri = 0 '\000', ev_closure = 1 '\001', ev_timeout = {
            tv_sec = 140672355426304, tv_usec = 7}, ev_callback = 0x441780 <rspamd_term_handler>, ev_arg = 0x7ff0d5c66080}
        cld_ev = {ev_active_next = {tqe_next = 0x7ff0d6000608, tqe_prev = 0x7ff0da4e0353}, ev_next = {
            tqe_next = 0x7fff60f0b350, tqe_prev = 0x7ff0d5c0fae0}, ev_timeout_pos = {ev_next_with_common_timeout = {
              tqe_next = 0xffffffff, tqe_prev = 0xab0c315fd4a44a00}, min_heap_idx = -1}, ev_fd = 17, 
          ev_base = 0x7ff0d5c0f980, _ev = {ev_io = {ev_io_next = {tqe_next = 0x0, tqe_prev = 0x7ff0cdfafc80}, ev_timeout = {
                tv_sec = 0, tv_usec = 0}}, ev_signal = {ev_signal_next = {tqe_next = 0x0, tqe_prev = 0x7ff0cdfafc80}, 
              ev_ncalls = 0, ev_pncalls = 0x0}}, ev_events = 24, ev_res = 0, ev_flags = 128, ev_pri = 0 '\000', 
          ev_closure = 1 '\001', ev_timeout = {tv_sec = 3133280928, tv_usec = 18}, 
          ev_callback = 0x441a50 <rspamd_cld_handler>, ev_arg = 0x7ff0d5c66080}
        hup_ev = {ev_active_next = {tqe_next = 0x7ff0db2ab110, tqe_prev = 0x7fff60f0b300}, ev_next = {
            tqe_next = 0x7fff60f0b230, tqe_prev = 0x7ff0d5c0fae0}, ev_timeout_pos = {ev_next_with_common_timeout = {
              tqe_next = 0xffffffff, tqe_prev = 0xab0c315fd4a44a00}, min_heap_idx = -1}, ev_fd = 1, 
          ev_base = 0x7ff0d5c0f980, _ev = {ev_io = {ev_io_next = {tqe_next = 0x0, tqe_prev = 0x7ff0cdfafc50}, ev_timeout = {
                tv_sec = 140672445906944, tv_usec = 0}}, ev_signal = {ev_signal_next = {tqe_next = 0x0, 
                tqe_prev = 0x7ff0cdfafc50}, ev_ncalls = 0, ev_pncalls = 0x0}}, ev_events = 24, ev_res = 0, ev_flags = 128, 
          ev_pri = 0 '\000', ev_closure = 1 '\001', ev_timeout = {tv_sec = 140672355008512, tv_usec = 104}, 
          ev_callback = 0x442a50 <rspamd_hup_handler>, ev_arg = 0x7ff0d5c66080}
        usr1_ev = {ev_active_next = {tqe_next = 0x0, tqe_prev = 0x7ff0db0a9c1c <check_match+300>}, ev_next = {
            tqe_next = 0x7ff0cdfb1e58, tqe_prev = 0x7ff0d5c0fae0}, ev_timeout_pos = {ev_next_with_common_timeout = {
              tqe_next = 0xffffffff, tqe_prev = 0x21}, min_heap_idx = -1}, ev_fd = 10, ev_base = 0x7ff0d5c0f980, _ev = {
            ev_io = {ev_io_next = {tqe_next = 0x0, tqe_prev = 0x7ff0cdfafc70}, ev_timeout = {tv_sec = 140672396165120, 
                tv_usec = 0}}, ev_signal = {ev_signal_next = {tqe_next = 0x0, tqe_prev = 0x7ff0cdfafc70}, ev_ncalls = 0, 
              ev_pncalls = 0x0}}, ev_events = 24, ev_res = 0, ev_flags = 128, ev_pri = 0 '\000', ev_closure = 1 '\001', 
          ev_timeout = {tv_sec = 66985346, tv_usec = 140734819775696}, ev_callback = 0x441710 <rspamd_usr1_handler>, 
          ev_arg = 0x7ff0d5c66080}
        control_ev = {ev_active_next = {tqe_next = 0x0, tqe_prev = 0x7ff0d94bd79f}, ev_next = {tqe_next = 0x7ff0d834fd78, 
            tqe_prev = 0x7ff0db0a9c1c <check_match+300>}, ev_timeout_pos = {ev_next_with_common_timeout = {
              tqe_next = 0x100000000, tqe_prev = 0xf63d4e2e}, min_heap_idx = 0}, ev_fd = 18, ev_base = 0x21, _ev = {ev_io = {
              ev_io_next = {tqe_next = 0x7ff0db2ab110, tqe_prev = 0x7ff0db0aa58e <do_lookup_x+2334>}, ev_timeout = {
                tv_sec = 140734819775896, tv_usec = 140734819775600}}, ev_signal = {ev_signal_next = {
                tqe_next = 0x7ff0db2ab110, tqe_prev = 0x7ff0db0aa58e <do_lookup_x+2334>}, ev_ncalls = -19048, 
              ev_pncalls = 0x7fff60f0b470}}, ev_events = 11560, ev_res = -10188, ev_flags = 32752, ev_pri = 0 '\000', 
          ev_closure = 0 '\000', ev_timeout = {tv_sec = 140672396226984, tv_usec = 140734819775872}, 
          ev_callback = 0x3d8f538, ev_arg = 0x7fff60f0b570}
        term_tv = {tv_sec = 140734819775024, tv_usec = 3838666}
        __func__ = "main"

Looking at the core file with gdb this looks to be faulting in a call to HASH_DEL.

wvolz avatar Sep 20 '16 21:09 wvolz

More that might be related:

[New LWP 28855]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `rspamd: normal process                       '.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  je_bitmap_set (bit=18446744073709551615, binfo=0x7f034f4b5fa8 <je_arena_bin_info+1704>, bitmap=0x7f034242f010)
    at include/jemalloc/internal/bitmap.h:105
105 include/jemalloc/internal/bitmap.h: No such file or directory.
(gdb) bt full
#0  je_bitmap_set (bit=18446744073709551615, binfo=0x7f034f4b5fa8 <je_arena_bin_info+1704>, bitmap=0x7f034242f010)
    at include/jemalloc/internal/bitmap.h:105
        goff = 288230376151711743
        gp = 0x20007f034242f008
        g = <error reading variable g (Cannot access memory at address 0x20007f034242f008)>
#1  je_bitmap_sfu (binfo=0x7f034f4b5fa8 <je_arena_bin_info+1704>, bitmap=0x7f034242f010)
    at include/jemalloc/internal/bitmap.h:140
        bit = 18446744073709551615
        g = <optimized out>
        i = <optimized out>
#2  arena_run_reg_alloc (bin_info=0x7f034f4b5f80 <je_arena_bin_info+1664>, run=0x7f034242f000) at src/arena.c:291
        ret = <optimized out>
        regind = <optimized out>
        bitmap = 0x7f034242f010
#3  je_arena_tcache_fill_small (arena=0x7f034ac000c0, tbin=tbin@entry=0x7f034a806228, binind=binind@entry=16, 
    prof_accumbytes=prof_accumbytes@entry=0) at src/arena.c:1479
        i = 0
        nfill = 3
        bin = 0x7f034ac00b60
        run = 0x7f034242f000
        ptr = <optimized out>
#4  0x00007f034f2a892f in je_tcache_alloc_small_hard (tcache=tcache@entry=0x7f034a806000, tbin=0x7f034a806228, 
    binind=binind@entry=16) at src/tcache.c:72
No locals.
#5  0x00007f034f285172 in je_tcache_alloc_small (zero=false, size=512, tcache=0x7f034a806000)
    at include/jemalloc/internal/tcache.h:303
        ret = <optimized out>
        binind = 16
        tbin = 0x7f034a806228
#6  je_arena_malloc (try_tcache=true, zero=false, size=512, arena=0x0) at include/jemalloc/internal/arena.h:957
No locals.
#7  je_imalloct (arena=0x0, try_tcache=true, size=512) at include/jemalloc/internal/jemalloc_internal.h:771
No locals.
#8  je_imalloc (size=512) at include/jemalloc/internal/jemalloc_internal.h:780
No locals.
#9  malloc (size=size@entry=512) at src/jemalloc.c:929
        ret = <optimized out>
        usize = 512
#10 0x00000000008f79dd in rdns_send_request (req=req@entry=0x7f03424610c0, fd=23, new_req=new_req@entry=true)
    at /rspamd-1.3.5/contrib/librdns/resolver.c:99
        _ha_bkt = <optimized out>
        r = <optimized out>
        serv = 0x7f034aa5fba0
        resolver = 0x7f034aabd660
        tmp = <optimized out>
        header = <optimized out>
        __func__ = "rdns_send_request"
#11 0x00000000008f8c8f in rdns_make_request_full (resolver=<optimized out>, cb=<optimized out>, cbdata=<optimized out>, 
    timeout=1, repeats=5, queries=<optimized out>) at /rspamd-1.3.5/contrib/librdns/resolver.c:634
        args = {{gp_offset = 48, fp_offset = 25972, overflow_arg_area = 0x7fff36b22ae8, reg_save_area = 0x7fff36b22a70}}
        req = 0x7f03424610c0
        serv = 0x7f034aa5fba0
        r = <optimized out>
        type = <optimized out>
        i = <optimized out>
        tlen = <optimized out>
        clen = <optimized out>
        cur = <optimized out>
        olen = 22
        cur_name = <optimized out>
        last_name = <optimized out>
        comp = 0x0
        __func__ = "rdns_make_request_full"
#12 0x00000000004ae713 in make_dns_request (resolver=0x7f034ab0ec00, session=0x7f03424fe020, pool=0x7f0342beee40, 
    cb=0x4fd6b0 <spf_dns_callback>, ud=0x7f031f3e4a70, type=0, type@entry=RDNS_REQUEST_TXT, 
    name=0x7f031f3e49b0 "mail25.atl71.mcdlv.net") at /rspamd-1.3.5/src/libserver/dns.c:111
        req = 0x7f034242f010
        reqdata = 0x7f031f3e4ac0
        __func__ = "make_dns_request"
#13 0x00000000004ae8cd in make_dns_request_task_common (forced=1, name=<optimized out>, type=RDNS_REQUEST_TXT, 
    ud=ud@entry=0x7f034ab404d0, cb=cb@entry=0x4fd6b0 <spf_dns_callback>, task=task@entry=0x7f034ab404d0)
    at /rspamd-1.3.5/src/libserver/dns.c:149
        ret = 1111683088
#14 make_dns_request_task_forced (task=task@entry=0x7f034ab404d0, cb=cb@entry=0x4fd6b0 <spf_dns_callback>, 
    ud=ud@entry=0x7f031f3e4a70, type=type@entry=RDNS_REQUEST_TXT, name=<optimized out>)
    at /rspamd-1.3.5/src/libserver/dns.c:181
No locals.
#15 0x00000000004fd9be in rspamd_spf_resolve (task=task@entry=0x7f034ab404d0, 
    callback=callback@entry=0x4e2510 <spf_plugin_callback>, cbdata=0x7f031f3e4970) at /rspamd-1.3.5/src/libserver/spf.c:1899
        rec = 0x7f031f3e4a70
        cred = 0x7f031f3e4990
        __func__ = "rspamd_spf_resolve"
#16 0x00000000004e26db in spf_symbol_callback (task=0x7f034ab404d0, unused=<optimized out>)
    at /rspamd-1.3.5/src/plugins/spf.c:503
        domain = <optimized out>
        l = 0x0
        w = <optimized out>
        unused = <optimized out>
        task = 0x7f034ab404d0
#17 0x00000000004bd2c4 in rspamd_symbols_cache_check_symbol (task=0x20007f034242f008, task@entry=0x7f034ab404d0, item=0x1, 
    item@entry=0x7f0350064070, total_diff=0xffffffff, total_diff@entry=0x7fff36b22c40, pr=1, pr@entry=0.68560291491959213, 
    checkpoint=<optimized out>, cache=<optimized out>) at /rspamd-1.3.5/src/libserver/symbols_cache.c:1210
        pending_before = 0
        pending_after = 1111683088
        t2 = 1
        diff = 1
        ptask = 0x1
        L = 0x0
        check = 1
#18 0x00000000004bea09 in rspamd_symbols_cache_process_symbols (task=task@entry=0x7f034ab404d0, 
    cache=cache@entry=0x7f034a8690b0, stage=stage@entry=16) at /rspamd-1.3.5/src/libserver/symbols_cache.c:1575
        item = 0x7f0350064070
        checkpoint = 0x7f031f3e4840
        i = 1
        total_microseconds = 0
        all_done = <optimized out>
        start_events_pending = 0
        pr = 0.68560291491959213
        __func__ = "rspamd_symbols_cache_process_symbols"
#19 0x00000000004be8e0 in rspamd_symbols_cache_process_symbols (task=task@entry=0x7f034ab404d0, cache=0x7f034a8690b0, 
    stage=stage@entry=16) at /rspamd-1.3.5/src/libserver/symbols_cache.c:1543
        item = <optimized out>
        checkpoint = 0x7f031f3e4840
        i = <optimized out>
        total_microseconds = 0
        all_done = <optimized out>
        start_events_pending = 0
        pr = 0.086794733783094102
        __func__ = "rspamd_symbols_cache_process_symbols"
#20 0x00000000004c0a69 in rspamd_task_process (task=task@entry=0x7f034ab404d0, stages=stages@entry=16383)
    at /rspamd-1.3.5/src/libserver/task.c:590
        ret = 1
        stat_error = 0x0
        __func__ = "rspamd_task_process"
#21 0x00000000004c0bbd in rspamd_task_process (task=task@entry=0x7f034ab404d0, stages=stages@entry=16383)
    at /rspamd-1.3.5/src/libserver/task.c:688
        ret = <optimized out>
        stat_error = 0x0
        __func__ = "rspamd_task_process"
#22 0x00000000004c0bbd in rspamd_task_process (task=task@entry=0x7f034ab404d0, stages=stages@entry=16383)
    at /rspamd-1.3.5/src/libserver/task.c:688
        ret = <optimized out>
        stat_error = 0x0
        __func__ = "rspamd_task_process"
#23 0x00000000004c0bbd in rspamd_task_process (task=task@entry=0x7f034ab404d0, stages=stages@entry=16383)
    at /rspamd-1.3.5/src/libserver/task.c:688
        ret = <optimized out>
        stat_error = 0x0
        __func__ = "rspamd_task_process"
#24 0x00000000004c0bbd in rspamd_task_process (task=task@entry=0x7f034ab404d0, stages=stages@entry=16383)
    at /rspamd-1.3.5/src/libserver/task.c:688
        ret = <optimized out>
        stat_error = 0x0
        __func__ = "rspamd_task_process"
#25 0x0000000000444e81 in rspamd_worker_body_handler (conn=<optimized out>, msg=<optimized out>, 
    chunk=0x7f031f377010 "Received: from mail25.atl71.mcdlv.net (mail25.atl71.mcdlv.net [198.2.129.25]) by localhost (Postfix) with ESMTP id c4ba62e4b3;\r\nReceived-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip="..., len=106041)
    at /rspamd-1.3.5/src/worker.c:213
        task = 0x7f034ab404d0
        ctx = <optimized out>
        task_tv = {tv_sec = 8, tv_usec = 0}
        guard_ev = 0x7f03424fe0b0
        __func__ = "rspamd_worker_body_handler"
#26 0x000000000046a0eb in rspamd_http_on_message_complete (parser=<optimized out>) at /rspamd-1.3.5/src/libutil/http.c:895
        conn = 0x7f034a857ed0
        priv = 0x7f0342bae310
        ret = 0
        mode = <optimized out>
        __func__ = "rspamd_http_on_message_complete"
#27 0x000000000090097c in http_parser_execute (parser=parser@entry=0x7f0342bae340, settings=settings@entry=0x7f0342bae360, 
    data=<optimized out>, len=len@entry=89924) at /rspamd-1.3.5/contrib/http-parser/http_parser.c:1772
        c = <optimized out>
        ch = 67 'C'
        unhex_val = <optimized out>
        p = 0x7f031f390e48 "\n"
        header_field_mark = <optimized out>
        header_value_mark = <optimized out>
        url_mark = <optimized out>
        body_mark = <optimized out>
        status_mark = <optimized out>
        __PRETTY_FUNCTION__ = "http_parser_execute"
#28 0x000000000046b811 in rspamd_http_event_handler (fd=<optimized out>, what=<optimized out>, ud=0x7f034a857ed0)
    at /rspamd-1.3.5/src/libutil/http.c:1121
        conn = 0x7f034a857ed0
        priv = 0x7f0342bae310
        pbuf = 0x7f03424b3120
        d = 0x7f031f37af05 "Cli=2Ctd=2Cblockquote{\r\n=09=09=09mso-line-height-rule:exactly;\r\n=09=09}\r\n=09=09a[href^=3Dtel]=2Ca[href^=3Dsms]{\r\n=09=09=09color:inherit;\r\n=09=09=09cursor:default;\r\n=09=09=09text-decoration:none;\r\n=09="...
        r = 89924
        err = <optimized out>
#29 0x00007f034eb823dc in event_base_loop () from /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5
No symbol table info available.
#30 0x0000000000444846 in start_worker (worker=0x7f0342bb9e00) at /rspamd-1.3.5/src/worker.c:564
        ctx = 0x7f034a867660
        lp = <optimized out>
        ltmp = <optimized out>
#31 0x00000000004c632d in rspamd_fork_worker (rspamd_main=0x7f034a866080, cf=0x7f034aa73b60, index=1, ev_base=0x7fff36b23140)
    at /rspamd-1.3.5/src/libserver/worker_util.c:596
        rc = 917647680
        rlim = {rlim_cur = 104857600, rlim_max = 104857600}
        __func__ = "rspamd_fork_worker"
#32 0x0000000000441766 in rspamd_fork_delayed_cb (signo=<optimized out>, what=<optimized out>, arg=0x7f034a8425c0)
    at /rspamd-1.3.5/src/rspamd.c:318
        w = 0x7f034a8425c0
#33 0x00007f034eb823dc in event_base_loop () from /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5
No symbol table info available.
#34 0x00000000004371f7 in main (argc=1, argv=0x7fff36b23878, env=<optimized out>) at /rspamd-1.3.5/src/rspamd.c:1347
        i = <optimized out>
        res = 0
        signals = {__sigaction_handler = {sa_handler = 0x0, sa_sigaction = 0x0}, sa_mask = {__val = {0 <repeats 16 times>}}, 
          sa_flags = 0, sa_restorer = 0x0}
        sigpipe_act = {__sigaction_handler = {sa_handler = 0x1, sa_sigaction = 0x1}, sa_mask = {__val = {4096, 
              0 <repeats 15 times>}}, sa_flags = 0, sa_restorer = 0x4e}
        pworker = <optimized out>
        type = <optimized out>
        control_addr = 0x7f034ab0e790
        ev_base = 0x7f034a80f980
        term_ev = {ev_active_next = {tqe_next = 0x7fff36b233d0, tqe_prev = 0x21}, ev_next = {tqe_next = 0x7fff36b23350, 
            tqe_prev = 0x7f034a80fae0}, ev_timeout_pos = {ev_next_with_common_timeout = {tqe_next = 0x7f03ffffffff, 
              tqe_prev = 0x7f034fe54c1c <check_match+300>}, min_heap_idx = -1}, ev_fd = 15, ev_base = 0x7f034a80f980, _ev = {
            ev_io = {ev_io_next = {tqe_next = 0x0, tqe_prev = 0x7f0342bafd20}, ev_timeout = {tv_sec = 0, tv_usec = 0}}, 
            ev_signal = {ev_signal_next = {tqe_next = 0x0, tqe_prev = 0x7f0342bafd20}, ev_ncalls = 0, ev_pncalls = 0x0}}, 
          ev_events = 24, ev_res = 0, ev_flags = 128, ev_pri = 0 '\000', ev_closure = 1 '\001', ev_timeout = {
            tv_sec = 139652202056521, tv_usec = 140734111588776}, ev_callback = 0x441780 <rspamd_term_handler>, 
          ev_arg = 0x7f034a866080}
        int_ev = {ev_active_next = {tqe_next = 0x39a, tqe_prev = 0x7f034f28adb8 <arena_run_split_remove+104>}, ev_next = {
            tqe_next = 0x7fff36b23470, tqe_prev = 0x7f034a80fae0}, ev_timeout_pos = {ev_next_with_common_timeout = {
              tqe_next = 0x7f03ffffffff, tqe_prev = 0x66}, min_heap_idx = -1}, ev_fd = 2, ev_base = 0x7f034a80f980, _ev = {
            ev_io = {ev_io_next = {tqe_next = 0x0, tqe_prev = 0x7f0342bafd50}, ev_timeout = {tv_sec = 0, tv_usec = 0}}, 
            ev_signal = {ev_signal_next = {tqe_next = 0x0, tqe_prev = 0x7f0342bafd50}, ev_ncalls = 0, ev_pncalls = 0x0}}, 
          ev_events = 24, ev_res = 0, ev_flags = 128, ev_pri = 0 '\000', ev_closure = 1 '\001', ev_timeout = {
            tv_sec = 139652111949824, tv_usec = 7}, ev_callback = 0x441780 <rspamd_term_handler>, ev_arg = 0x7f034a866080}
        cld_ev = {ev_active_next = {tqe_next = 0x0, tqe_prev = 0x7f0342bafd60}, ev_next = {tqe_next = 0x7fff36b23500, 
            tqe_prev = 0x7f034a80fae0}, ev_timeout_pos = {ev_next_with_common_timeout = {tqe_next = 0xffffffff, 
              tqe_prev = 0x85281561e70ff500}, min_heap_idx = -1}, ev_fd = 17, ev_base = 0x7f034a80f980, _ev = {ev_io = {
              ev_io_next = {tqe_next = 0x0, tqe_prev = 0x7f0342bafd40}, ev_timeout = {tv_sec = 0, tv_usec = 0}}, 
            ev_signal = {ev_signal_next = {tqe_next = 0x0, tqe_prev = 0x7f0342bafd40}, ev_ncalls = 0, ev_pncalls = 0x0}}, 
          ev_events = 24, ev_res = 8, ev_flags = 128, ev_pri = 0 '\000', ev_closure = 1 '\001', ev_timeout = {
            tv_sec = 3133280928, tv_usec = 18}, ev_callback = 0x441a50 <rspamd_cld_handler>, ev_arg = 0x7f034a866080}
        hup_ev = {ev_active_next = {tqe_next = 0x7f0350056110, tqe_prev = 0x7fff36b234b0}, ev_next = {
            tqe_next = 0x7fff36b233e0, tqe_prev = 0x7f034a80fae0}, ev_timeout_pos = {ev_next_with_common_timeout = {
              tqe_next = 0xffffffff, tqe_prev = 0x85281561e70ff500}, min_heap_idx = -1}, ev_fd = 1, 
          ev_base = 0x7f034a80f980, _ev = {ev_io = {ev_io_next = {tqe_next = 0x0, tqe_prev = 0x7f0342bafd10}, ev_timeout = {
                tv_sec = 139652204134400, tv_usec = 0}}, ev_signal = {ev_signal_next = {tqe_next = 0x0, 
                tqe_prev = 0x7f0342bafd10}, ev_ncalls = 0, ev_pncalls = 0x0}}, ev_events = 24, ev_res = 0, ev_flags = 128, 
          ev_pri = 0 '\000', ev_closure = 1 '\001', ev_timeout = {tv_sec = 139652111532032, tv_usec = 104}, 
          ev_callback = 0x442a50 <rspamd_hup_handler>, ev_arg = 0x7f034a866080}
        usr1_ev = {ev_active_next = {tqe_next = 0x0, tqe_prev = 0x7f034fe54c1c <check_match+300>}, ev_next = {
            tqe_next = 0x7f0342bba058, tqe_prev = 0x7f034a80fae0}, ev_timeout_pos = {ev_next_with_common_timeout = {
              tqe_next = 0xffffffff, tqe_prev = 0x21}, min_heap_idx = -1}, ev_fd = 10, ev_base = 0x7f034a80f980, _ev = {
            ev_io = {ev_io_next = {tqe_next = 0x0, tqe_prev = 0x7f0342bafd30}, ev_timeout = {tv_sec = 139652154392576, 
                tv_usec = 0}}, ev_signal = {ev_signal_next = {tqe_next = 0x0, tqe_prev = 0x7f0342bafd30}, ev_ncalls = 0, 
              ev_pncalls = 0x0}}, ev_events = 24, ev_res = 0, ev_flags = 128, ev_pri = 0 '\000', ev_closure = 1 '\001', 
          ev_timeout = {tv_sec = 66985346, tv_usec = 140734111037056}, ev_callback = 0x441710 <rspamd_usr1_handler>, 
          ev_arg = 0x7f034a866080}
        control_ev = {ev_active_next = {tqe_next = 0x0, tqe_prev = 0x7f034e26879f}, ev_next = {tqe_next = 0x7f0342bb9d58, 
            tqe_prev = 0x7f034a80fae0}, ev_timeout_pos = {ev_next_with_common_timeout = {tqe_next = 0x1ffffffff, 
              tqe_prev = 0xf63d4e2e}, min_heap_idx = -1}, ev_fd = 3, ev_base = 0x7f034a80f980, _ev = {ev_io = {ev_io_next = {
                tqe_next = 0x0, tqe_prev = 0x7f0342b90120}, ev_timeout = {tv_sec = 0, tv_usec = 0}}, ev_signal = {
              ev_signal_next = {tqe_next = 0x0, tqe_prev = 0x7f0342b90120}, ev_ncalls = 0, ev_pncalls = 0x0}}, 
          ev_events = 18, ev_res = 0, ev_flags = 128, ev_pri = 0 '\000', ev_closure = 2 '\002', ev_timeout = {
            tv_sec = 139652154499496, tv_usec = 140734111037232}, ev_callback = 0x441640 <rspamd_control_handler>, 
          ev_arg = 0x7f034a866080}
        term_tv = {tv_sec = 140734111036384, tv_usec = 3838666}
        __func__ = "main"

wvolz avatar Sep 20 '16 22:09 wvolz

Isn't your issue (and another one as well) fixed in the current master branch?

vstakhov avatar Sep 20 '16 22:09 vstakhov

This one has changed with the new code. I now see this type of crash:

Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `rspamd: normal process                       '.
Program terminated with signal SIGABRT, Aborted.
#0  0x00007f96545b3067 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56  ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt full
#0  0x00007f96545b3067 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
        resultvar = 0
        pid = 24348
        selftid = 24348
#1  0x00007f96545b4448 in __GI_abort () at abort.c:89
        save_stage = 2
        act = {__sigaction_handler = {sa_handler = 0x960360 <__func__.42972>, sa_sigaction = 0x960360 <__func__.42972>}, sa_mask = {__val = {5, 133, 140283684511175, 140720308486145, 0, 72057594054705152, 140283636895016, 140283457407040, 133, 
              140283682272288, 140283684537061, 0, 140283597590888, 58, 594, 140283597578240}}, sa_flags = -5375200, sa_restorer = 0xffffffffffadfb10}
        sigs = {__val = {32, 0 <repeats 15 times>}}
#2  0x00007f9656e2ca45 in g_assertion_message () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#3  0x00007f9656e2cada in g_assertion_message_expr () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#4  0x00000000004b5ad1 in rspamd_session_remove_event (session=0x7f962af80020, fin=0x4b3c00 <rspamd_dns_fin_cb>, ud=0x7f9649a38490) at /home/volz/rspam-pkg/rspamd-1.3.5/src/libserver/events.c:172
        search_ev = {subsystem = 0, fin = 0x4b3c00 <rspamd_dns_fin_cb>, user_data = 0x7f9649a38490, w = 0x7f965200f980}
        found_ev = 0x0
        __func__ = "rspamd_session_remove_event"
#5  0x00000000008fc0e7 in rdns_process_timer (arg=0x7f9652065c40) at /home/volz/rspam-pkg/rspamd-1.3.5/contrib/librdns/resolver.c:390
        req = 0x7f9652065c40
        rep = <optimized out>
        r = <optimized out>
        renew = <optimized out>
        resolver = <optimized out>
        serv = <optimized out>
        __func__ = "rdns_process_timer"
#6  0x00007f96560163dc in event_base_loop () from /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5
No symbol table info available.
#7  0x000000000044814e in start_worker (worker=0x7f9649fd7d00) at /home/volz/rspam-pkg/rspamd-1.3.5/src/worker.c:612
        ctx = 0x7f9652067430
        lp = <optimized out>
        ltmp = <optimized out>

I've cut off some of the trace if you are wondering. Thanks for the rapid response on this!

wvolz avatar Sep 21 '16 00:09 wvolz

Another backtrace with a similar failure:

Core was generated by `rspamd: normal process                       '.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00000000008fac35 in rdns_request_unschedule (req=req@entry=0x7fbb58d8b6c0)
    at /home/volz/rspam-pkg/rspamd-1.3.5/contrib/librdns/resolver.c:247
247     HASH_DEL (req->io->requests, req);

wvolz avatar Sep 21 '16 03:09 wvolz

OK, I have added one more check for this issue (thought, I don't understand why do you test Rspamd with a broken DNS resolver).

vstakhov avatar Sep 21 '16 11:09 vstakhov

Ok, this changed behavior slightly but I'm still seeing crashes. Perhaps in a different place now... I'm using Bind9 as my resolver. I can try something different, although I'm thinking a crash should not result from DNS issues.

Latest crash:

Program terminated with signal SIGABRT, Aborted.
#0  0x00007f0988c06067 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56  ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt full
#0  0x00007f0988c06067 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
        resultvar = 0
        pid = 8660
        selftid = 8660
#1  0x00007f0988c07448 in __GI_abort () at abort.c:89
        save_stage = 2
        act = {__sigaction_handler = {sa_handler = 0x9603a0 <__func__.42972>, 
            sa_sigaction = 0x9603a0 <__func__.42972>}, sa_mask = {__val = {8, 133, 139678973169095, 
              140720308486145, 0, 72057594054705152, 139678925552936, 139678747070400, 133, 139678970930208, 
              139678973194981, 0, 139678883811688, 79, 410, 139678883799040}}, sa_flags = -1568, 
          sa_restorer = 0xfffffffffffff9d0}
        sigs = {__val = {32, 0 <repeats 15 times>}}
#2  0x00007f098b47fa45 in g_assertion_message () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#3  0x00007f098b47fada in g_assertion_message_expr () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#4  0x00000000004b5ad1 in rspamd_session_remove_event (session=0x7f0986714020, 
    fin=0x4b3c00 <rspamd_dns_fin_cb>, ud=0x7f097e1a35d0)
    at /home/volz/rspam-pkg/rspamd-1.3.5/src/libserver/events.c:172
        search_ev = {subsystem = 0, fin = 0x4b3c00 <rspamd_dns_fin_cb>, user_data = 0x7f097e1a35d0, 
          w = 0x7f098640f980}
        found_ev = 0x0
        __func__ = "rspamd_session_remove_event"
#5  0x00000000008fc127 in rdns_process_timer (arg=0x7f097e19a8c0)
    at /home/volz/rspam-pkg/rspamd-1.3.5/contrib/librdns/resolver.c:380
        req = 0x7f097e19a8c0
        rep = <optimized out>
        r = <optimized out>
        renew = <optimized out>
        resolver = <optimized out>
        serv = <optimized out>
        __func__ = "rdns_process_timer"

Looking at the req variable:

(gdb) frame 5
#5  0x00000000008fc127 in rdns_process_timer (arg=0x7f097e19a8c0)
    at /home/volz/rspam-pkg/rspamd-1.3.5/contrib/librdns/resolver.c:380
380         req->func (rep, req->arg);
(gdb) print *req
$1 = {resolver = 0x7f09867eb970, async = 0x7f098668b8c0, io = 0x7f097e7c9ec0, reply = 0x7f097e1a21f0, 
  type = 0, timeout = 1, retransmits = 3, id = 49370, requested_names = 0x7f097e164270, qcount = 1, 
  state = RDNS_REQUEST_REPLIED, 
  packet = 0x7f097e1a1600 "ERROR:/home/volz/rspam-pkg/rspamd-1.3.5/src/libserver/events.c:172:rspamd_session_remove_event: assertion failed: (found_ev != NULL)", pos = 59, packet_len = 143, 
  func = 0x4b4180 <rspamd_dns_callback>, arg = 0x7f097e1a35d0, async_event = 0x7f097e1a16a0, hh = {
    tbl = 0x7f097e7cab80, prev = 0x7f097e199f00, next = 0x0, hh_prev = 0x0, hh_next = 0x0, 
    key = 0x7f097e19a8f4, keylen = 4, hashv = 967738930}, ref = {refcount = 1, 
    dtor = 0x8fa240 <rdns_request_free>}}
(gdb) print *req.requested_names
$2 = {name = 0x7f09867f6400 "instagram.com.public.sarbl.org", type = RDNS_REQUEST_A, len = 30}

Would anything else from this core file help? (rspamd-8660.core - for me to keep track of which is which)

wvolz avatar Sep 21 '16 21:09 wvolz

Your comment earlier about a mis-configured resolver made me wonder. After looking through config files and a tcpdump I found out that Bind was never setup to listen on ::1. So, the crash was caused by a lack of response from the local DNS server. I've fixed this and the crashes are gone so far.

Does the code need to be changed to handle this case still? If so, I'm happy to test additional builds.

While looking at logs after the fix I've noticed I no longer see lines like the following:

Sep 21 15:22:38 host rmilter[25243]: <6bc9f8f633>; mlfi_eom: tempfile=/tmp/msg.XXyEbGAO, size=9411
Sep 21 15:22:38 host rmilter[25243]: <6bc9f8f633>; spamdscan: start scanning message on localhost
Sep 21 15:22:40 host rmilter[25243]: <6bc9f8f633>; rspamd; got empty reply from localhost
Sep 21 15:22:40 host rmilter[25243]: <6bc9f8f633>; spamdscan: finish scanning message on localhost
Sep 21 15:22:40 host rmilter[25243]: <6bc9f8f633>; rspamdscan: failed to scan, retry, localhost, /tmp/msg.XXyEbGAO
Sep 21 15:22:41 host rmilter[25243]: <6bc9f8f633>; spamdscan: start scanning message on localhost
Sep 21 15:22:44 host rmilter[25243]: <6bc9f8f633>; rspamd; got empty reply from localhost
Sep 21 15:22:44 host rmilter[25243]: <6bc9f8f633>; spamdscan: finish scanning message on localhost
Sep 21 15:22:44 host rmilter[25243]: <6bc9f8f633>; rspamdscan: failed to scan, retry, localhost, /tmp/msg.XXyEbGAO

Is this related to Debian bug #781092 (rspamd keeps disconneting rmilter)? (see: https://groups.google.com/forum/#!topic/linux.debian.bugs.dist/TeLCOeitprI)

Thank you again for the quick response and helping me find a bug with my stack.

wvolz avatar Sep 22 '16 01:09 wvolz

The rmilter errors are probably a result of rspamd crashing during scan. The debian bug points at an issue with systemd sockets which is no longer relevant.

fatalbanana avatar Sep 22 '16 07:09 fatalbanana

@fatalbanana Ah, so not the same issue. @vstakhov after commit 93afc2d I'm not seeing any crashes even with the broken ipv6 resolver. Thanks! If you are ok, I'll close the issue.

wvolz avatar Sep 23 '16 07:09 wvolz

This still looks resolved for me so I'm closing the issue. Thanks again!

wvolz avatar Sep 25 '16 20:09 wvolz