ThreadSanitizer: data race rbtdb.c:2987 in bind_rdataset
WARNING: ThreadSanitizer: data race (pid=31139)
Write of size 4 at 0x7b2c00010218 by thread T6 (mutexes: write M657661300922451992, write M1030334187267172112):
#0 bind_rdataset rbtdb.c:2987 (libdns.1503.dylib:x86_64+0xbfdb5)
#1 zone_find rbtdb.c:4249 (libdns.1503.dylib:x86_64+0xc5c2e)
#2 dns_db_find db.c:511 (libdns.1503.dylib:x86_64+0x2b4df)
#3 dns_view_findzonecut view.c:1284 (libdns.1503.dylib:x86_64+0x18d567)
#4 dns_resolver_createfetch resolver.c:4891 (libdns.1503.dylib:x86_64+0x12c797)
#5 zone_maintenance zone.c:10586 (libdns.1503.dylib:x86_64+0x1ca57d)
#6 zone_timer zone.c:13669 (libdns.1503.dylib:x86_64+0x1aadb5)
#7 run task.c:1134 (libisc.1503.dylib:x86_64+0x2c9e1)
Previous write of size 4 at 0x7b2c00010218 by thread T8:
#0 bind_rdataset rbtdb.c:2987 (libdns.1503.dylib:x86_64+0xbfdb5)
#1 rdatasetiter_current rbtdb.c:8810 (libdns.1503.dylib:x86_64+0xcc7d1)
#2 dns_rdatasetiter_current rdatasetiter.c:70 (libdns.1503.dylib:x86_64+0x1227cf)
#3 dump_rdatasets_raw masterdump.c:1224 (libdns.1503.dylib:x86_64+0x6f46e)
#4 dumptostreaminc masterdump.c:1686 (libdns.1503.dylib:x86_64+0x6d4e8)
#5 dump_quantum masterdump.c:1421 (libdns.1503.dylib:x86_64+0x704cf)
#6 run task.c:1134 (libisc.1503.dylib:x86_64+0x2c9e1)
Location is heap block of size 171 at 0x7b2c000101d0 allocated by thread T8:
#0 malloc <null>:6875376 (libclang_rt.tsan_osx_dynamic.dylib:x86_64h+0x4e65a)
#1 default_memalloc mem.c:685 (libisc.1503.dylib:x86_64+0x17ae1)
#2 loading_addrdataset rbtdb.c:7027 (libdns.1503.dylib:x86_64+0xbbe1e)
#3 dns_diff_load diff.c:508 (libdns.1503.dylib:x86_64+0x30973)
#4 xfrin_recv_done xfrin.c:324 (libdns.1503.dylib:x86_64+0x194627)
#5 run task.c:1134 (libisc.1503.dylib:x86_64+0x2c9e1)
Mutex M657661300922451992 is already destroyed.
Mutex M1030334187267172112 is already destroyed.
Thread T6 (tid=4591544, running) created by main thread at:
#0 pthread_create <null>:6875424 (libclang_rt.tsan_osx_dynamic.dylib:x86_64h+0x2a9cd)
#1 isc_thread_create thread.c:75 (libisc.1503.dylib:x86_64+0x46d1c)
#2 main main.c:902 (named:x86_64+0x10000ad16)
Thread T8 (tid=4591546, running) created by main thread at:
#0 pthread_create <null>:6875424 (libclang_rt.tsan_osx_dynamic.dylib:x86_64h+0x2a9cd)
#1 isc_thread_create thread.c:75 (libisc.1503.dylib:x86_64+0x46d1c)
#2 main main.c:902 (named:x86_64+0x10000ad16)
SUMMARY: ThreadSanitizer: data race rbtdb.c:2987 in bind_rdataset
WARNING: ThreadSanitizer: data race (pid=45980)
Write of size 4 at 0x7b30000115c8 by thread T7 (mutexes: write M290055290576030928):
#0 bind_rdataset rbtdb.c:2987 (libdns.1503.dylib:x86_64+0xbfdb5)
#1 find_deepest_zonecut rbtdb.c:4543 (libdns.1503.dylib:x86_64+0xc96df)
#2 cache_find rbtdb.c:4738 (libdns.1503.dylib:x86_64+0xb5f48)
#3 dns_db_find db.c:511 (libdns.1503.dylib:x86_64+0x2b4df)
#4 dns_view_find view.c:1019 (libdns.1503.dylib:x86_64+0x18cb59)
#5 dbfind_name adb.c:3658 (libdns.1503.dylib:x86_64+0xd8e3)
#6 dns_adb_createfind adb.c:3083 (libdns.1503.dylib:x86_64+0xc163)
#7 findname resolver.c:3371 (libdns.1503.dylib:x86_64+0x13ae8b)
#8 fctx_try resolver.c:3660 (libdns.1503.dylib:x86_64+0x136402)
#9 fctx_start resolver.c:4647 (libdns.1503.dylib:x86_64+0x12f383)
#10 run task.c:1134 (libisc.1503.dylib:x86_64+0x2c9e1)
Previous write of size 4 at 0x7b30000115c8 by thread T5:
#0 bind_rdataset rbtdb.c:2987 (libdns.1503.dylib:x86_64+0xbfdb5)
#1 cache_findzonecut rbtdb.c:5132 (libdns.1503.dylib:x86_64+0xb6bde)
#2 dns_db_findzonecut db.c:577 (libdns.1503.dylib:x86_64+0x2b900)
#3 dns_view_findzonecut view.c:1309 (libdns.1503.dylib:x86_64+0x18d4be)
#4 rctx_done resolver.c:9348 (libdns.1503.dylib:x86_64+0x1443e8)
#5 resquery_response resolver.c (libdns.1503.dylib:x86_64+0x13ece7)
#6 run task.c:1134 (libisc.1503.dylib:x86_64+0x2c9e1)
Location is heap block of size 183 at 0x7b3000011580 allocated by thread T5:
#0 malloc <null>:7941664 (libclang_rt.tsan_osx_dynamic.dylib:x86_64h+0x4e65a)
#1 default_memalloc mem.c:685 (libisc.1503.dylib:x86_64+0x17ae1)
#2 addrdataset rbtdb.c:6450 (libdns.1503.dylib:x86_64+0xb88d4)
#3 dns_db_addrdataset db.c:744 (libdns.1503.dylib:x86_64+0x2c2ee)
#4 resquery_response resolver.c:6341 (libdns.1503.dylib:x86_64+0x1424a7)
#5 run task.c:1134 (libisc.1503.dylib:x86_64+0x2c9e1)
Mutex M290055290576030928 is already destroyed.
Thread T7 (tid=4654360, running) created by main thread at:
#0 pthread_create <null>:7941712 (libclang_rt.tsan_osx_dynamic.dylib:x86_64h+0x2a9cd)
#1 isc_thread_create thread.c:75 (libisc.1503.dylib:x86_64+0x46d1c)
#2 main main.c:902 (named:x86_64+0x10000ad16)
Thread T5 (tid=4654358, running) created by main thread at:
#0 pthread_create <null>:7941712 (libclang_rt.tsan_osx_dynamic.dylib:x86_64h+0x2a9cd)
#1 isc_thread_create thread.c:75 (libisc.1503.dylib:x86_64+0x46d1c)
#2 main main.c:902 (named:x86_64+0x10000ad16)
SUMMARY: ThreadSanitizer: data race rbtdb.c:2987 in bind_rdataset
Edited by Ondřej Surý