Skip to content

8.1.0 Crash on write_dns #7315

Closed
Closed

Description

@masaori335

We faced crashes on v8.1.0 when the DNS server gets slow.

[ 0  ] libpthread-2.17.so waitpid                                                ( :undefined           ) 
[ 1  ] traffic_server     crash_logger_invoke(int, siginfo_t*, void*)            ( Crash.cc:165         ) 
[ 2  ] libpthread-2.17.so 0x7fbfcaebd630                                         ( :undefined           ) 
[ 3  ] libtscore.so.8.1.0 ink_atomiclist_push                                    ( ink_queue.cc:533     ) 
[ 4  ] traffic_server     ProtectedQueue::enqueue(Event*, bool)                  ( ProtectedQueue.cc:52 ) 
[ 5  ] traffic_server     write_dns(DNSHandler*, bool)                           ( DNS.cc:undefined     ) 
[ 6  ] traffic_server     DNSHandler::mainEvent(int, Event*)                     ( DNS.cc:956           ) 
[ 7  ] traffic_server     NetHandler::waitForActivity(long)                      ( UnixNet.cc:519       ) 
[ 8  ] traffic_server     non-virtual thunk to NetHandler::waitForActivity(long) ( UnixNet.cc:undefined ) 
[ 9  ] traffic_server     EThread::execute_regular()                             ( UnixEThread.cc:278   ) 
[ 10 ] traffic_server     spawn_thread_internal(void*)                           ( Thread.cc:85         ) 
[ 11 ] libpthread-2.17.so start_thread                                           ( :undefined           )

Activity

  1. added this to the 10.0.0 milestone on Nov 11, 2020
  2. masaori335 commented on Nov 11, 2020

    @masaori335
    ContributorAuthor
    (gdb) bt
    #0  0x00007fe90c4e61d9 in waitpid () from /lib64/libpthread.so.0
    #1  0x000055c6a88f8024 in crash_logger_invoke(int, siginfo_t*, void*) (signo=11, info=0x7fe8ff5090b0,
        ctx=0x7fe8ff508f80) at traffic_server/Crash.cc:165
    #2  <signal handler called>
    #3  ink_atomiclist_push (l=0x100b10, item=0x7fe90a9e4d80) at ink_queue.cc:533
    #4  0x000055c6a8b03f83 in ProtectedQueue::enqueue(Event*, bool) (this=0x100b10, e=0x7fe90a9e4d80,
        fast_signal=false) at ProtectedQueue.cc:52
    #5  0x000055c6a8a46224 in write_dns_event (h=0x7fe90674ec00, e=0x7fe8ff302b00, over_tcp=<optimized out>)
        at P_UnixEvent.h:30
    #6  write_dns(DNSHandler*, bool) (h=0x7fe90674ec00, tcp_retry=<optimized out>) at DNS.cc:1038
    #7  0x000055c6a8a42717 in DNSHandler::mainEvent(int, Event*) (this=0x7fe90674ec00,
        event=<optimized out>, e=<optimized out>) at DNS.cc:956
    #8  0x000055c6a8ad86fe in NetHandler::waitForActivity(long) (this=<optimized out>,
        timeout=<optimized out>) at UnixNet.cc:519
    #9  0x000055c6a8ad8bfd in non-virtual thunk to NetHandler::waitForActivity(long) ()
    #10 0x000055c6a8b05d81 in EThread::execute_regular() (this=0x7fe8ff60dc40) at UnixEThread.cc:278
    #11 0x000055c6a8b04b0c in spawn_thread_internal(void*) (a=0x7fe90a995320) at Thread.cc:85
    #12 0x00007fe90c4deea5 in start_thread () from /lib64/libpthread.so.0
    #13 0x00007fe90b8fc8dd in clone () from /lib64/libc.so.6
    

    It looks like ProtectedQueue on frame 4 is pointing to an invalid address.

    (gdb) frame 4
    #4  0x000055c6a8b03f83 in ProtectedQueue::enqueue(Event*, bool) (this=0x100b10, e=0x7fe90a9e4d80,
        fast_signal=false) at ProtectedQueue.cc:52
    52	  bool was_empty       = (ink_atomiclist_push(&al, e) == nullptr);
    (gdb) p this
    $12 = (struct ProtectedQueue *) 0x100b10
    

    This might be made by referring thread_holding of unlocked mutex on write_dns_event.

    (gdb) frame 6
    #6  write_dns(DNSHandler*, bool) (h=0x7fe90674ec00, tcp_retry=<optimized out>) at DNS.cc:1038
    1038	        if (h->ns_down[h->name_server] || !write_dns_event(h, e, over_tcp)) {
    (gdb) p *h->mutex.m_ptr
    $13 = {<RefCountObj> = {<> = {_vptr$ForceVFPTToTop = 0x55c6a8dc1e78 <vtable for ProxyMutex+16>},
        m_refcount = 8}, the_mutex = {__data = {__lock = 0, __count = 0, __owner = 0, __nusers = 0,
          __kind = 0, __spins = 0, __elision = 0, __list = {__prev = 0x0, __next = 0x0}},
        __size = '\000' <repeats 39 times>, __align = 0}, thread_holding = 0x0, nthread_holding = 0}
    

    e->timeout = h->mutex->thread_holding->schedule_in(e, HRTIME_SECONDS(dns_timeout));

  3. masaori335 commented on Nov 13, 2020

    @masaori335
    ContributorAuthor

    I'm pretty sure this happens with SplitDNS. The DNSHandler mutex of SplitDNS is not locked.

  4. modified the milestones: 10.0.0, 9.1.0 on Jan 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions