ThreadSanitizer: data race rbt.c:1312 in dns_rbt_addnode
Binary: named
Commit: d744a6fc
Tests: mkeys
WARNING: ThreadSanitizer: data race (pid=9284)
Write of size 4 at 0x7b2400019cf4 by thread T8 (mutexes: write M18726, write M18318):
#0 dns_rbt_addnode rbt.c:1312 (libdns.1505.dylib:x86_64+0xaabba)
#1 findnodeintree rbtdb.c:2738 (libdns.1505.dylib:x86_64+0xc965a)
#2 findnode rbtdb.c:2783 (libdns.1505.dylib:x86_64+0xb641b)
#3 dns_db_findnode db.c:447 (libdns.1505.dylib:x86_64+0x2bcd8)
#4 validated resolver.c:5501 (libdns.1505.dylib:x86_64+0x14b9c1)
#5 run task.c:1134 (libisc.1504.dylib:x86_64+0x3be51)
Previous read of size 4 at 0x7b2400019cf4 by thread T7 (mutexes: write M18786):
#0 addrdataset rbtdb.c:6524 (libdns.1505.dylib:x86_64+0xb9fe7)
#1 dns_db_addrdataset db.c:744 (libdns.1505.dylib:x86_64+0x2ce6e)
#2 addoptout ncache.c:271 (libdns.1505.dylib:x86_64+0x98317)
#3 dns_ncache_add ncache.c:101 (libdns.1505.dylib:x86_64+0x97abc)
#4 resquery_response resolver.c:6479 (libdns.1505.dylib:x86_64+0x144186)
#5 run task.c:1134 (libisc.1504.dylib:x86_64+0x3be51)
Location is heap block of size 138 at 0x7b2400019ce0 allocated by thread T7:
#0 malloc <null>:9010464 (libclang_rt.tsan_osx_dynamic.dylib:x86_64h+0x4e65a)
#1 default_memalloc mem.c:685 (libisc.1504.dylib:x86_64+0x21bbf)
#2 isc___mem_allocate mem.c:598 (libisc.1504.dylib:x86_64+0x22a1c)
#3 isc___mem_get mem.c:2387 (libisc.1504.dylib:x86_64+0x22037)
#4 isc__mem_get mem.c:2365 (libisc.1504.dylib:x86_64+0x1cd3e)
#5 create_node rbt.c:2189 (libdns.1505.dylib:x86_64+0xabcc5)
#6 dns_rbt_addnode rbt.c:1146 (libdns.1505.dylib:x86_64+0xab888)
#7 findnodeintree rbtdb.c:2738 (libdns.1505.dylib:x86_64+0xc965a)
#8 findnode rbtdb.c:2783 (libdns.1505.dylib:x86_64+0xb641b)
#9 dns_db_findnode db.c:447 (libdns.1505.dylib:x86_64+0x2bcd8)
#10 resquery_response resolver.c:6632 (libdns.1505.dylib:x86_64+0x144064)
#11 run task.c:1134 (libisc.1504.dylib:x86_64+0x3be51)
Mutex M18726 (0x7b7c00003030) created at:
#0 pthread_mutex_init <null>:9010320 (libclang_rt.tsan_osx_dynamic.dylib:x86_64h+0x2b9a3)
#1 isc__mutex_init mutex.c:286 (libisc.1504.dylib:x86_64+0x58ca9)
#2 dns_resolver_create resolver.c:10030 (libdns.1505.dylib:x86_64+0x12b7b0)
#3 dns_view_createresolver view.c:763 (libdns.1505.dylib:x86_64+0x18ca48)
#4 configure_view server.c:4553 (named:x86_64+0x10002aebf)
#5 load_configuration server.c:8903 (named:x86_64+0x100023fa6)
#6 run_server server.c:9639 (named:x86_64+0x10001100d)
#7 run task.c:1134 (libisc.1504.dylib:x86_64+0x3be51)
Mutex M18318 (0x7b5c00012060) created at:
#0 pthread_rwlock_init <null>:9010320 (libclang_rt.tsan_osx_dynamic.dylib:x86_64h+0x2bd21)
#1 isc_rwlock_init rwlock.c:41 (libisc.1504.dylib:x86_64+0x34ffb)
#2 dns_rbtdb_create rbtdb.c:8094 (libdns.1505.dylib:x86_64+0xb1960)
#3 dns_db_create db.c:118 (libdns.1505.dylib:x86_64+0x2ac1c)
#4 dns_cache_create cache.c:173 (libdns.1505.dylib:x86_64+0x1d150)
#5 configure_view server.c:4485 (named:x86_64+0x10002ab4f)
#6 load_configuration server.c:8903 (named:x86_64+0x100023fa6)
#7 run_server server.c:9639 (named:x86_64+0x10001100d)
#8 run task.c:1134 (libisc.1504.dylib:x86_64+0x3be51)
Mutex M18786 (0x7b7c00003648) created at:
#0 pthread_mutex_init <null>:9010320 (libclang_rt.tsan_osx_dynamic.dylib:x86_64h+0x2b9a3)
#1 isc__mutex_init mutex.c:286 (libisc.1504.dylib:x86_64+0x58ca9)
#2 dns_resolver_create resolver.c:10030 (libdns.1505.dylib:x86_64+0x12b7b0)
#3 dns_view_createresolver view.c:763 (libdns.1505.dylib:x86_64+0x18ca48)
#4 configure_view server.c:4553 (named:x86_64+0x10002aebf)
#5 load_configuration server.c:8903 (named:x86_64+0x100023fa6)
#6 run_server server.c:9639 (named:x86_64+0x10001100d)
#7 run task.c:1134 (libisc.1504.dylib:x86_64+0x3be51)
Thread T8 (tid=2457582, running) created by main thread at:
#0 pthread_create <null>:9010512 (libclang_rt.tsan_osx_dynamic.dylib:x86_64h+0x2a9cd)
#1 isc_thread_create thread.c:75 (libisc.1504.dylib:x86_64+0x58db1)
#2 isc_taskmgr_create task.c:1410 (libisc.1504.dylib:x86_64+0x3b340)
#3 main main.c:902 (named:x86_64+0x10000df16)
Thread T7 (tid=2457581, running) created by main thread at:
#0 pthread_create <null>:9010512 (libclang_rt.tsan_osx_dynamic.dylib:x86_64h+0x2a9cd)
#1 isc_thread_create thread.c:75 (libisc.1504.dylib:x86_64+0x58db1)
#2 isc_taskmgr_create task.c:1410 (libisc.1504.dylib:x86_64+0x3b340)
#3 main main.c:902 (named:x86_64+0x10000df16)
SUMMARY: ThreadSanitizer: data race rbt.c:1312 in dns_rbt_addnode
Edited by Ondřej Surý