ThreadSanitizer: data race rbtdb.c:5200 in detachnode
Found in the ns3 log running named
compiled from c5b6f215 in the serve-stale system test:
WARNING: ThreadSanitizer: data race (pid=31139)
Read of size 1 at 0x7b680004c11c by thread T6:
#0 detachnode rbtdb.c:5200 (libdns.1503.dylib:x86_64+0xb705f)
#1 rdataset_disassociate rbtdb.c:8377 (libdns.1503.dylib:x86_64+0xc0330)
#2 dns_rdataset_disassociate rdataset.c:118 (libdns.1503.dylib:x86_64+0x120089)
#3 fctx_destroy resolver.c:4395 (libdns.1503.dylib:x86_64+0x130251)
#4 fctx_doshutdown resolver.c:4570 (libdns.1503.dylib:x86_64+0x14c626)
#5 run task.c:1134 (libisc.1503.dylib:x86_64+0x2c9e1)
Previous write of size 1 at 0x7b680004c11c by thread T1:
#0 maybe_free_rbtdb rbtdb.c:1173 (libdns.1503.dylib:x86_64+0xbb9b9)
#1 detach rbtdb.c:1212 (libdns.1503.dylib:x86_64+0xb30b3)
#2 dns_db_detach db.c:159 (libdns.1503.dylib:x86_64+0x2a3b3)
#3 query_reset query.c:674 (libns.1501.dylib:x86_64+0xfa10)
#4 query_cleanup query.c:751 (libns.1501.dylib:x86_64+0x1762b)
#5 ns__client_reset_cb client.c:188 (libns.1501.dylib:x86_64+0x4ce8)
#6 isc_nmhandle_unref netmgr.c:874 (libisc.1503.dylib:x86_64+0x1b50b)
#7 isc__nm_uvreq_put netmgr.c:1002 (libisc.1503.dylib:x86_64+0x1bdb8)
#8 udp_send_cb udp.c:436 (libisc.1503.dylib:x86_64+0x1f785)
#9 uv__udp_run_completed <null>:6891168 (libuv.1.dylib:x86_64+0x1278f)
Location is heap block of size 1529 at 0x7b680004bc00 allocated by thread T8:
#0 malloc <null>:6891200 (libclang_rt.tsan_osx_dynamic.dylib:x86_64h+0x4e65a)
#1 default_memalloc mem.c:685 (libisc.1503.dylib:x86_64+0x17ae1)
#2 dns_db_create db.c:118 (libdns.1503.dylib:x86_64+0x2a09c)
#3 xfrin_recv_done xfrin.c:280 (libdns.1503.dylib:x86_64+0x1943ae)
#4 run task.c:1134 (libisc.1503.dylib:x86_64+0x2c9e1)
Thread T6 (tid=4591544, running) created by main thread at:
#0 pthread_create <null>:6891248 (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 T1 (tid=4591539, running) created by main thread at:
#0 pthread_create <null>:6891248 (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:895 (named:x86_64+0x10000acbe)
Thread T8 (tid=4591546, running) created by main thread at:
#0 pthread_create <null>:6891152 (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:5200 in detachnode
Edited by Ondřej Surý