SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) in pthread_rwlock_wrlock - zone_postload
One variant is race between zone_postload
and resume_iteration
, and the second variant is race between zone_postload
and receive_secure_db
.
WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
Cycle in lock order graph: M1 (0x000000000000) => M2 (0x000000000000) => M1
Mutex M2 acquired here while holding mutex M1 in thread T1:
#0 pthread_rwlock_wrlock <null>
#1 isc_rwlock_lock lib/isc/rwlock.c:54:4
#2 zone_postload lib/dns/zone.c:4908:2
#3 receive_secure_db lib/dns/zone.c:15645:11
#4 dispatch lib/isc/task.c:1143:7
#5 run lib/isc/task.c:1328:2
Mutex M1 previously acquired by the same thread here:
#0 pthread_rwlock_rdlock <null>
#1 isc_rwlock_lock lib/isc/rwlock.c:50:3
#2 resume_iteration lib/dns/rbtdb.c:8946:2
#3 dbiterator_first lib/dns/rbtdb.c:8993:3
#4 dns_dbiterator_first lib/dns/dbiterator.c:44:10
#5 receive_secure_db lib/dns/zone.c:15575:16
#6 dispatch lib/isc/task.c:1143:7
#7 run lib/isc/task.c:1328:2
Mutex M1 acquired here while holding mutex M2 in thread T2:
#0 pthread_rwlock_rdlock <null>
#1 isc_rwlock_lock lib/isc/rwlock.c:50:3
#2 findnodeintree lib/dns/rbtdb.c:2742:2
#3 findnode lib/dns/rbtdb.c:2804:10
#4 dns_db_findnode lib/dns/db.c:447:11
#5 zone_get_from_db lib/dns/zone.c:5373:11
#6 get_raw_serial lib/dns/zone.c:2398:12
#7 zone_gotwritehandle lib/dns/zone.c:2435:4
#8 dispatch lib/isc/task.c:1143:7
#9 run lib/isc/task.c:1328:2
Mutex M2 previously acquired by the same thread here:
#0 pthread_rwlock_rdlock <null>
#1 isc_rwlock_lock lib/isc/rwlock.c:50:3
#2 zone_gotwritehandle lib/dns/zone.c:2428:2
#3 dispatch lib/isc/task.c:1143:7
#4 run lib/isc/task.c:1328:2
Thread T1 (running) created by main thread at:
#0 pthread_create <null>
#1 isc_thread_create lib/isc/pthreads/thread.c:75:8
#2 isc_taskmgr_create lib/isc/task.c:1419:3
#3 create_managers bin/named/./main.c:902:11
#4 setup bin/named/./main.c:1235:11
#5 main bin/named/./main.c:1515:2
Thread T2 (running) created by main thread at:
#0 pthread_create <null>
#1 isc_thread_create lib/isc/pthreads/thread.c:75:8
#2 isc_taskmgr_create lib/isc/task.c:1419:3
#3 create_managers bin/named/./main.c:902:11
#4 setup bin/named/./main.c:1235:11
#5 main bin/named/./main.c:1515:2
SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) in pthread_rwlock_wrlock
WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
Cycle in lock order graph: M1 (0x000000000001) => M2 (0x000000000002) => M1
Mutex M2 acquired here while holding mutex M1 in thread T1:
#0 pthread_rwlock_wrlock <null>
#1 isc_rwlock_lock lib/isc/rwlock.c:54:4
#2 zone_postload lib/dns/zone.c:4908:2
#3 receive_secure_db lib/dns/zone.c:15645:11
#4 dispatch lib/isc/task.c:1143:7
#5 run lib/isc/task.c:1328:2
Mutex M1 previously acquired by the same thread here:
#0 pthread_mutex_lock <null>
#1 receive_secure_db lib/dns/zone.c:15643:2
#2 dispatch lib/isc/task.c:1143:7
#3 run lib/isc/task.c:1328:2
Mutex M1 acquired here while holding mutex M2 in thread T1:
#0 pthread_mutex_lock <null>
#1 get_raw_serial lib/dns/zone.c:2396:2
#2 zone_gotwritehandle lib/dns/zone.c:2435:4
#3 dispatch lib/isc/task.c:1143:7
#4 run lib/isc/task.c:1328:2
Mutex M2 previously acquired by the same thread here:
#0 pthread_rwlock_rdlock <null>
#1 isc_rwlock_lock lib/isc/rwlock.c:50:3
#2 zone_gotwritehandle lib/dns/zone.c:2428:2
#3 dispatch lib/isc/task.c:1143:7
#4 run lib/isc/task.c:1328:2
Thread T1 (running) created by main thread at:
#0 pthread_create <null>
#1 isc_thread_create lib/isc/pthreads/thread.c:75:8
#2 isc_taskmgr_create lib/isc/task.c:1419:3
#3 create_managers bin/named/./main.c:902:11
#4 setup bin/named/./main.c:1235:11
#5 main bin/named/./main.c:1515:2
SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) in pthread_rwlock_wrlock