ThreadSanitizer: lock-order-inversion in pthread_mutex_lock
Job #1621539 failed for cae34f75 on v9.16:
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 <null>
#1 dns_view_find lib/dns/view.c:1040
#2 dbfind_name lib/dns/adb.c:3833
#3 dns_adb_createfind lib/dns/adb.c:3198
#4 findname lib/dns/resolver.c:3564
#5 fctx_getaddresses lib/dns/resolver.c:3875
#6 fctx_try lib/dns/resolver.c:4264
#7 fctx_timeout lib/dns/resolver.c:4711
#8 dispatch lib/isc/task.c:1153
#9 run lib/isc/task.c:1345
#10 isc__trampoline_run lib/isc/trampoline.c:191
#11 <null> <null>
Mutex M1 previously acquired by the same thread here:
#0 pthread_mutex_lock <null>
#1 find_name_and_lock lib/dns/adb.c:2117
#2 dns_adb_createfind lib/dns/adb.c:3085
#3 findname lib/dns/resolver.c:3564
#4 fctx_getaddresses lib/dns/resolver.c:3875
#5 fctx_try lib/dns/resolver.c:4264
#6 fctx_timeout lib/dns/resolver.c:4711
#7 dispatch lib/isc/task.c:1153
#8 run lib/isc/task.c:1345
#9 isc__trampoline_run lib/isc/trampoline.c:191
#10 <null> <null>
Mutex M3 acquired here while holding mutex M2 in thread T2:
#0 pthread_mutex_lock <null>
#1 dns_zone_flush lib/dns/zone.c:11441
#2 flush lib/dns/zt.c:215
#3 dns_zt_apply lib/dns/zt.c:537
#4 zt_destroy lib/dns/zt.c:221
#5 zt_flushanddetach lib/dns/zt.c:243
#6 dns_zt_flushanddetach lib/dns/zt.c:249
#7 view_flushanddetach lib/dns/view.c:645
#8 dns_view_flushanddetach lib/dns/view.c:687
#9 shutdown_server server.c:9873
#10 dispatch lib/isc/task.c:1153
#11 run lib/isc/task.c:1345
#12 isc__trampoline_run lib/isc/trampoline.c:191
#13 <null> <null>
Mutex M2 previously acquired by the same thread here:
#0 pthread_mutex_lock <null>
#1 view_flushanddetach lib/dns/view.c:642
#2 dns_view_flushanddetach lib/dns/view.c:687
#3 shutdown_server server.c:9873
#4 dispatch lib/isc/task.c:1153
#5 run lib/isc/task.c:1345
#6 isc__trampoline_run lib/isc/trampoline.c:191
#7 <null> <null>
Mutex M1 acquired here while holding mutex M3 in thread T3:
#0 pthread_mutex_lock <null>
#1 violate_locking_hierarchy lib/dns/adb.c:1279
#2 dns_adb_cancelfind lib/dns/adb.c:3457
#3 notify_cancel lib/dns/zone.c:11796
#4 zone_shutdown lib/dns/zone.c:14532
#5 dispatch lib/isc/task.c:1153
#6 run lib/isc/task.c:1345
#7 isc__trampoline_run lib/isc/trampoline.c:191
#8 <null> <null>
Mutex M3 previously acquired by the same thread here:
#0 pthread_mutex_lock <null>
#1 zone_shutdown lib/dns/zone.c:14503
#2 dispatch lib/isc/task.c:1153
#3 run lib/isc/task.c:1345
#4 isc__trampoline_run lib/isc/trampoline.c:191
#5 <null> <null>
Thread T1 (running) created by main thread at:
#0 pthread_create <null>
#1 isc_thread_create lib/isc/pthreads/thread.c:79
#2 isc_taskmgr_create lib/isc/task.c:1435
#3 create_managers main.c:928
#4 setup main.c:1269
#5 main main.c:1572
Thread T2 (running) created by main thread at:
#0 pthread_create <null>
#1 isc_thread_create lib/isc/pthreads/thread.c:79
#2 isc_taskmgr_create lib/isc/task.c:1435
#3 create_managers main.c:928
#4 setup main.c:1269
#5 main main.c:1572
Thread T3 (running) created by main thread at:
#0 pthread_create <null>
#1 isc_thread_create lib/isc/pthreads/thread.c:79
#2 isc_taskmgr_create lib/isc/task.c:1435
#3 create_managers main.c:928
#4 setup main.c:1269
#5 main main.c:1572
SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) in pthread_mutex_lock