[SERVER-46041] DiagnosticListeners are destructed before detached threads die Created: 07/Feb/20  Updated: 29/Oct/23  Resolved: 25/Feb/20

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.3.4

Type: Bug Priority: Major - P3
Reporter: Jacob Evans Assignee: Benjamin Caimano (Inactive)
Resolution: Fixed Votes: 0
Labels: servicearch-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-46217 Unit tests consistently segfault afte... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

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 ()



 Comments   
Comment by Githook User [ 03/Mar/20 ]

Author:

{'name': 'Ben Caimano', 'email': 'ben.caimano@10gen.com'}

Message: SERVER-43945 Expose out of order latch acquisitions in serverStatus

This commit also backports:

SERVER-42897 Validate base-level latches
SERVER-44746 Fix LatchAnalyzerTest
SERVER-44155 Validate a subset of latches of all levels
SERVER-45691 Change Mutex::LockListeners to use a std::vector again
SERVER-45793 Improve mongo::Mutex contract
SERVER-45424 Track local latch::Identities when getTestCommandsEnabled()
SERVER-46041 Add DiagnosticListener/WaitListener LSAN suppressions
SERVER-46461 Make static in getDiagnosticListenerState() immortal to fix destruction order issues during shutdown
SERVER-46197 Make build flag to disable diagnostic latches
SERVER-45276 Release lock before destroying DBClientBases
Branch: v4.2
https://github.com/mongodb/mongo/commit/24b6ee2dd48e3f1cfde1c4d7e2b01bd73921fbad

Comment by Githook User [ 25/Feb/20 ]

Author:

{'name': 'Ben Caimano', 'email': 'ben.caimano@10gen.com'}

Message: SERVER-46041 Add DiagnosticListener/WaitListener LSAN suppressions

This commit also adds a new opt=off Ubuntu 18.04 builder to better
ensure dev environments function correctly.
Branch: master
https://github.com/mongodb/mongo/commit/32099accea4678bd6e1defde3578896f319c6b8c

Generated at Thu Feb 08 05:10:21 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.