WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) Cycle in lock order graph: M1 (0x000000000000) => M2 (0x000000000000) => M3 (0x000000000000) => M1 Mutex M2 acquired here while holding mutex M1 in thread T1: #0 pthread_mutex_lock #1 dns_view_find lib/dns/view.c:1037:2 #2 dbfind_name lib/dns/adb.c:3833:11 #3 dns_adb_createfind lib/dns/adb.c:3155:12 #4 findname lib/dns/resolver.c:3497:11 #5 fctx_getaddresses lib/dns/resolver.c:3808:3 #6 fctx_try lib/dns/resolver.c:4197:12 #7 fctx_timeout lib/dns/resolver.c:4633:4 #8 dispatch lib/isc/task.c:1152:7 #9 run lib/isc/task.c:1344:2 Mutex M1 previously acquired by the same thread here: #0 pthread_mutex_lock #1 find_name_and_lock lib/dns/adb.c:2117:3 #2 dns_adb_createfind lib/dns/adb.c:3085:12 #3 findname lib/dns/resolver.c:3497:11 #4 fctx_getaddresses lib/dns/resolver.c:3808:3 #5 fctx_try lib/dns/resolver.c:4197:12 #6 fctx_timeout lib/dns/resolver.c:4633:4 #7 dispatch lib/isc/task.c:1152:7 #8 run lib/isc/task.c:1344:2 Mutex M3 acquired here while holding mutex M2 in thread T2: #0 pthread_mutex_lock #1 dns_adb_shutdown lib/dns/adb.c:2977:2 #2 view_flushanddetach lib/dns/view.c:635:4 #3 dns_view_detach lib/dns/view.c:689:2 #4 ns_client_endrequest lib/ns/client.c:217:3 #5 ns__client_reset_cb lib/ns/client.c:1539:2 #6 isc_nmhandle_detach lib/isc/netmgr/netmgr.c:1248:3 #7 isc__nm_uvreq_put lib/isc/netmgr/netmgr.c:1380:3 #8 isc__nm_async_tcpdnssend lib/isc/netmgr/tcpdns.c:557:3 #9 process_queue lib/isc/netmgr/netmgr.c:643:4 #10 async_cb lib/isc/netmgr/netmgr.c:596:2 #11 uv__async_io /home/ondrej/Projects/tsan/libuv/src/unix/async.c:163:5 #12 uv__io_poll /home/ondrej/Projects/tsan/libuv/src/unix/linux-core.c:461:11 #13 uv_run /home/ondrej/Projects/tsan/libuv/src/unix/core.c:385:5 #14 nm_thread lib/isc/netmgr/netmgr.c:500:11 Mutex M2 previously acquired by the same thread here: #0 pthread_mutex_lock #1 view_flushanddetach lib/dns/view.c:630:3 #2 dns_view_detach lib/dns/view.c:689:2 #3 ns_client_endrequest lib/ns/client.c:217:3 #4 ns__client_reset_cb lib/ns/client.c:1539:2 #5 isc_nmhandle_detach lib/isc/netmgr/netmgr.c:1248:3 #6 isc__nm_uvreq_put lib/isc/netmgr/netmgr.c:1380:3 #7 isc__nm_async_tcpdnssend lib/isc/netmgr/tcpdns.c:557:3 #8 process_queue lib/isc/netmgr/netmgr.c:643:4 #9 async_cb lib/isc/netmgr/netmgr.c:596:2 #10 uv__async_io /home/ondrej/Projects/tsan/libuv/src/unix/async.c:163:5 #11 uv__io_poll /home/ondrej/Projects/tsan/libuv/src/unix/linux-core.c:461:11 #12 uv_run /home/ondrej/Projects/tsan/libuv/src/unix/core.c:385:5 #13 nm_thread lib/isc/netmgr/netmgr.c:500:11 Mutex M1 acquired here while holding mutex M3 in thread T3: #0 pthread_mutex_lock #1 shutdown_names lib/dns/adb.c:1296:3 #2 shutdown_stage2 lib/dns/adb.c:2961:8 #3 dispatch lib/isc/task.c:1152:7 #4 run lib/isc/task.c:1344:2 Mutex M3 previously acquired by the same thread here: #0 pthread_mutex_lock #1 shutdown_stage2 lib/dns/adb.c:2958:2 #2 dispatch lib/isc/task.c:1152:7 #3 run lib/isc/task.c:1344:2 Thread T1 (running) created by main thread at: #0 pthread_create #1 isc_thread_create lib/isc/pthreads/thread.c:73:8 #2 isc_taskmgr_create lib/isc/task.c:1434:3 #3 create_managers bin/named/main.c:915:11 #4 setup bin/named/main.c:1223:11 #5 main bin/named/main.c:1523:2 Thread T2 (running) created by main thread at: #0 pthread_create #1 isc_thread_create lib/isc/pthreads/thread.c:73:8 #2 isc_nm_start lib/isc/netmgr/netmgr.c:223:3 #3 create_managers bin/named/main.c:909:15 #4 setup bin/named/main.c:1223:11 #5 main bin/named/main.c:1523:2 Thread T3 (running) created by main thread at: #0 pthread_create #1 isc_thread_create lib/isc/pthreads/thread.c:73:8 #2 isc_taskmgr_create lib/isc/task.c:1434:3 #3 create_managers bin/named/main.c:915:11 #4 setup bin/named/main.c:1223:11 #5 main bin/named/main.c:1523:2 SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) in pthread_mutex_lock