Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-46041

DiagnosticListeners are destructed before detached threads die

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.3.4
    • Affects Version/s: None
    • Component/s: None
    • Fully Compatible
    • ALL

      gcc currently prints "pure virtual method called" at the end of a unit test if it is built in debug mode. gdb reveals a SIGTRAP occurring from here:

      (gdb) bt
      #0  raise (sig=<optimized out>) at ../sysdeps/unix/sysv/linux/raise.c:51
      #1  0x00005555622538b6 in mongo::breakpoint () at src/mongo/util/debugger.cpp:72
      #2  0x0000555561d91d77 in mongo::(anonymous namespace)::myTerminate () at src/mongo/util/signal_handlers_synchronous.cpp:237
      #3  0x00007ffff5d1da06 in __cxxabiv1::__terminate(void (*)()) () at ../../../../src/libstdc++-v3/libsupc++/eh_terminate.cc:47
      #4  0x00007ffff5d1da41 in std::terminate () at ../../../../src/libstdc++-v3/libsupc++/eh_terminate.cc:57
      #5  0x00007ffff5d1e80f in __cxxabiv1::__cxa_pure_virtual () at ../../../../src/libstdc++-v3/libsupc++/pure.cc:50
      #6  0x0000555561d5d75c in mongo::Mutex::_onQuickLock (this=0x55556771ef40 <mongo::globalRSMonitorManager>) at src/mongo/platform/mutex.cpp:102
      #7  0x0000555561d5d0c9 in mongo::Mutex::lock (this=0x55556771ef40 <mongo::globalRSMonitorManager>) at src/mongo/platform/mutex.cpp:51
      #8  0x000055555c0a87c1 in std::lock_guard<mongo::Latch>::lock_guard (this=0x7fffffffd730, __m=...) at /usr/include/c++/8/bits/std_mutex.h:162
      #9  0x00005555609eb549 in mongo::ReplicaSetMonitorManager::shutdown (this=0x55556771ef40 <mongo::globalRSMonitorManager>)
          at src/mongo/client/replica_set_monitor_manager.cpp:165
      #10 0x00005555609e929a in mongo::ReplicaSetMonitorManager::~ReplicaSetMonitorManager (this=0x55556771ef40 <mongo::globalRSMonitorManager>, 
          __in_chrg=<optimized out>) at src/mongo/client/replica_set_monitor_manager.cpp:69
      #11 0x00007ffff5108041 in __run_exit_handlers (status=0, listp=0x7ffff54b0718 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, 
          run_dtors=run_dtors@entry=true) at exit.c:108
      #12 0x00007ffff510813a in __GI_exit (status=<optimized out>) at exit.c:139
      #13 0x00007ffff50e6b9e in __libc_start_main (main=0x55555c036388 <main(int, char**, char**)>, argc=3, argv=0x7fffffffdca8, init=<optimized out>, 
          fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffdc98) at ../csu/libc-start.c:344
      #14 0x000055555ab6257a in _start ()
      

            Assignee:
            ben.caimano@mongodb.com Benjamin Caimano (Inactive)
            Reporter:
            jacob.evans@mongodb.com Jacob Evans
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: