ThreadSanitizer: data race rbt.c:1392 in dns_rbt_addnode
Found in the ns3 log running named
compiled from c5b6f215 in the serve-stale system test:
WARNING: ThreadSanitizer: data race (pid=31139)
Write of size 4 at 0x7b1800005df8 by thread T5 (mutexes: write M999934889782418456):
#0 dns_rbt_addnode rbt.c:1392 (libdns.1503.dylib:x86_64+0xaa64d)
#1 findnodeintree rbtdb.c:2739 (libdns.1503.dylib:x86_64+0xc896a)
#2 findnode rbtdb.c:2784 (libdns.1503.dylib:x86_64+0xb532b)
#3 dns_db_findnode db.c:447 (libdns.1503.dylib:x86_64+0x2b158)
#4 validated resolver.c:5620 (libdns.1503.dylib:x86_64+0x14b111)
#5 run task.c:1134 (libisc.1503.dylib:x86_64+0x2c9e1)
Previous write of size 4 at 0x7b1800005df8 by thread T6:
#0 dns_rbt_deletenode rbt.c:2777 (libdns.1503.dylib:x86_64+0xadece)
#1 delete_node rbtdb.c (libdns.1503.dylib:x86_64+0xc3f7f)
#2 decrement_reference rbtdb.c:2070 (libdns.1503.dylib:x86_64+0xc3449)
#3 prune_tree rbtdb.c:2120 (libdns.1503.dylib:x86_64+0xc3894)
#4 run task.c:1134 (libisc.1503.dylib:x86_64+0x2c9e1)
Location is heap block of size 89 at 0x7b1800005dc0 allocated by thread T5:
#0 malloc <null>:5828000 (libclang_rt.tsan_osx_dynamic.dylib:x86_64h+0x4e65a)
#1 default_memalloc mem.c:685 (libisc.1503.dylib:x86_64+0x17ae1)
#2 dns_rbtdb_create rbtdb.c:8200 (libdns.1503.dylib:x86_64+0xb0e92)
#3 dns_db_create db.c:118 (libdns.1503.dylib:x86_64+0x2a09c)
#4 dns_cache_create cache.c:173 (libdns.1503.dylib:x86_64+0x1c5d0)
#5 configure_view server.c:4484 (named:x86_64+0x1000279cf)
#6 load_configuration server.c:8916 (named:x86_64+0x100021275)
#7 run_server server.c:9638 (named:x86_64+0x10000de29)
#8 run task.c:1134 (libisc.1503.dylib:x86_64+0x2c9e1)
Mutex M999934889782418456 is already destroyed.
Thread T5 (tid=4591543, running) created by main thread at:
#0 pthread_create <null>:5828048 (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 T6 (tid=4591544, running) created by main thread at:
#0 pthread_create <null>:5828048 (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 rbt.c:1392 in dns_rbt_addnode