ThreadSanitizer: data race lib/dns/dispatch.c in dns_dispatch_send
A ThreadSanitizer report in a CI job in the private repository.
==================
WARNING: ThreadSanitizer: data race (pid=29526)
Read of size 8 at 0x7b5000020a10 by thread T9 (mutexes: write M2079, write M542256371492526000):
#0 dns_dispatch_send /builds/isc-private/bind9/lib/dns/dispatch.c (libdns-9.18.0.so+0x66d0c)
#1 req_send /builds/isc-private/bind9/lib/dns/request.c:352:2 (libdns-9.18.0.so+0x18a044)
#2 req_connected /builds/isc-private/bind9/lib/dns/request.c:1016:3 (libdns-9.18.0.so+0x18a044)
#3 dns_dispatch_connect /builds/isc-private/bind9/lib/dns/dispatch.c:1835:5 (libdns-9.18.0.so+0x6619d)
#4 dns_request_createvia /builds/isc-private/bind9/lib/dns/request.c:772:12 (libdns-9.18.0.so+0x18b7f8)
#5 checkds_send_toaddr /builds/isc-private/bind9/lib/dns/zone.c:21358:11 (libdns-9.18.0.so+0x23db16)
#6 task_run /builds/isc-private/bind9/lib/isc/task.c:821:5 (libisc-9.18.0.so+0x75856)
#7 isc_task_run /builds/isc-private/bind9/lib/isc/task.c:901:10 (libisc-9.18.0.so+0x75856)
#8 isc__nm_async_task /builds/isc-private/bind9/lib/isc/netmgr/netmgr.c:846:11 (libisc-9.18.0.so+0x2dfa7)
#9 process_netievent /builds/isc-private/bind9/lib/isc/netmgr/netmgr.c (libisc-9.18.0.so+0x2712f)
#10 process_queue /builds/isc-private/bind9/lib/isc/netmgr/netmgr.c:1019:16 (libisc-9.18.0.so+0x20f58)
#11 process_all_queues /builds/isc-private/bind9/lib/isc/netmgr/netmgr.c:765:25 (libisc-9.18.0.so+0x20f58)
#12 async_cb /builds/isc-private/bind9/lib/isc/netmgr/netmgr.c:794:6 (libisc-9.18.0.so+0x20f58)
#13 uv__async_io /usr/src/libuv-v1.43.0/src/unix/async.c:163:5 (libuv.so.1+0x10e82)
#14 isc__trampoline_run /builds/isc-private/bind9/lib/isc/trampoline.c:187:11 (libisc-9.18.0.so+0x7f0d9)
Previous write of size 8 at 0x7b5000020a10 by thread T2 (mutexes: write M686371576748313440):
#0 isc__nmhandle_attach /builds/isc-private/bind9/lib/isc/netmgr/netmgr.c:1711:11 (libisc-9.18.0.so+0x24380)
#1 startrecv /builds/isc-private/bind9/lib/dns/dispatch.c:1705:3 (libdns-9.18.0.so+0x67f91)
#2 tcp_connected /builds/isc-private/bind9/lib/dns/dispatch.c:1730:3 (libdns-9.18.0.so+0x6645b)
#3 isc__nm_async_connectcb /builds/isc-private/bind9/lib/isc/netmgr/netmgr.c:2735:2 (libisc-9.18.0.so+0x2c625)
#4 isc__nm_connectcb /builds/isc-private/bind9/lib/isc/netmgr/netmgr.c:2710:3 (libisc-9.18.0.so+0x29c19)
#5 tcpdns_connect_cb /builds/isc-private/bind9/lib/isc/netmgr/tcpdns.c:249:2 (libisc-9.18.0.so+0x37af9)
#6 uv__stream_connect /usr/src/libuv-v1.43.0/src/unix/stream.c:1390:5 (libuv.so.1+0x22a9f)
#7 isc__trampoline_run /builds/isc-private/bind9/lib/isc/trampoline.c:187:11 (libisc-9.18.0.so+0x7f0d9)
Location is heap block of size 480 at 0x7b5000020a00 allocated by thread T2:
#0 malloc <null> (named+0x45f71d)
#1 mallocx /builds/isc-private/bind9/lib/isc/./jemalloc_shim.h:35:10 (libisc-9.18.0.so+0x5fd97)
#2 mem_get /builds/isc-private/bind9/lib/isc/mem.c:345:8 (libisc-9.18.0.so+0x5fd97)
#3 isc__mem_get /builds/isc-private/bind9/lib/isc/mem.c:760:8 (libisc-9.18.0.so+0x5fd97)
#4 dispatch_allocate /builds/isc-private/bind9/lib/dns/dispatch.c:1090:9 (libdns-9.18.0.so+0x61d5b)
#5 dns_dispatch_createtcp /builds/isc-private/bind9/lib/dns/dispatch.c:1144:2 (libdns-9.18.0.so+0x61ae6)
#6 tcp_dispatch /builds/isc-private/bind9/lib/dns/request.c:417:11 (libdns-9.18.0.so+0x189acd)
#7 get_dispatch /builds/isc-private/bind9/lib/dns/request.c:458:12 (libdns-9.18.0.so+0x189acd)
#8 dns_request_createvia /builds/isc-private/bind9/lib/dns/request.c:719:11 (libdns-9.18.0.so+0x18b16f)
#9 checkds_send_toaddr /builds/isc-private/bind9/lib/dns/zone.c:21358:11 (libdns-9.18.0.so+0x23db16)
#10 task_run /builds/isc-private/bind9/lib/isc/task.c:821:5 (libisc-9.18.0.so+0x75856)
#11 isc_task_run /builds/isc-private/bind9/lib/isc/task.c:901:10 (libisc-9.18.0.so+0x75856)
#12 isc__nm_async_task /builds/isc-private/bind9/lib/isc/netmgr/netmgr.c:846:11 (libisc-9.18.0.so+0x2dfa7)
#13 process_netievent /builds/isc-private/bind9/lib/isc/netmgr/netmgr.c (libisc-9.18.0.so+0x2712f)
#14 process_queue /builds/isc-private/bind9/lib/isc/netmgr/netmgr.c:1019:16 (libisc-9.18.0.so+0x20f58)
#15 process_all_queues /builds/isc-private/bind9/lib/isc/netmgr/netmgr.c:765:25 (libisc-9.18.0.so+0x20f58)
#16 async_cb /builds/isc-private/bind9/lib/isc/netmgr/netmgr.c:794:6 (libisc-9.18.0.so+0x20f58)
#17 uv__async_io /usr/src/libuv-v1.43.0/src/unix/async.c:163:5 (libuv.so.1+0x10e82)
#18 isc__trampoline_run /builds/isc-private/bind9/lib/isc/trampoline.c:187:11 (libisc-9.18.0.so+0x7f0d9)
Mutex M2079 (0x7b7c00015008) created at:
#0 pthread_mutex_init <null> (named+0x46251f)
#1 isc__mutex_init /builds/isc-private/bind9/lib/isc/mutex.c:52:8 (libisc-9.18.0.so+0x64b97)
#2 dns_zone_create /builds/isc-private/bind9/lib/dns/zone.c:1148:2 (libdns-9.18.0.so+0x1f4cca)
#3 dns_zonemgr_createzone /builds/isc-private/bind9/lib/dns/zone.c:18937:11 (libdns-9.18.0.so+0x20afca)
#4 configure_zone /builds/isc-private/bind9/bin/named/server.c:6746:3 (named+0x507551)
#5 configure_view /builds/isc-private/bind9/bin/named/server.c:4149:3 (named+0x4fe365)
#6 load_configuration /builds/isc-private/bind9/bin/named/server.c:9277:3 (named+0x4f8661)
#7 run_server /builds/isc-private/bind9/bin/named/server.c:9990:2 (named+0x4e5f75)
#8 task_run /builds/isc-private/bind9/lib/isc/task.c:821:5 (libisc-9.18.0.so+0x75856)
#9 isc_task_run /builds/isc-private/bind9/lib/isc/task.c:901:10 (libisc-9.18.0.so+0x75856)
#10 isc__nm_async_task /builds/isc-private/bind9/lib/isc/netmgr/netmgr.c:846:11 (libisc-9.18.0.so+0x2dfa7)
#11 process_netievent /builds/isc-private/bind9/lib/isc/netmgr/netmgr.c (libisc-9.18.0.so+0x2712f)
#12 process_queue /builds/isc-private/bind9/lib/isc/netmgr/netmgr.c:1019:16 (libisc-9.18.0.so+0x20f58)
#13 process_all_queues /builds/isc-private/bind9/lib/isc/netmgr/netmgr.c:765:25 (libisc-9.18.0.so+0x20f58)
#14 async_cb /builds/isc-private/bind9/lib/isc/netmgr/netmgr.c:794:6 (libisc-9.18.0.so+0x20f58)
#15 uv__async_io /usr/src/libuv-v1.43.0/src/unix/async.c:163:5 (libuv.so.1+0x10e82)
#16 isc__trampoline_run /builds/isc-private/bind9/lib/isc/trampoline.c:187:11 (libisc-9.18.0.so+0x7f0d9)
Mutex M542256371492526000 is already destroyed.
Mutex M686371576748313440 is already destroyed.
Thread T9 'isc-net-0008' (tid=29574, running) created by main thread at:
#0 pthread_create <null> (named+0x460dad)
#1 isc_thread_create /builds/isc-private/bind9/lib/isc/thread.c:81:8 (libisc-9.18.0.so+0x7804a)
#2 isc__netmgr_create /builds/isc-private/bind9/lib/isc/netmgr/netmgr.c:331:3 (libisc-9.18.0.so+0x20cb1)
#3 isc_managers_create /builds/isc-private/bind9/lib/isc/managers.c:41:2 (libisc-9.18.0.so+0x5e117)
#4 create_managers /builds/isc-private/bind9/bin/named/main.c:922:11 (named+0x4e1a9c)
#5 setup /builds/isc-private/bind9/bin/named/main.c:1186:11 (named+0x4e1a9c)
#6 main /builds/isc-private/bind9/bin/named/main.c:1454:2 (named+0x4e1a9c)
Thread T2 'isc-net-0001' (tid=29549, running) created by main thread at:
#0 pthread_create <null> (named+0x460dad)
#1 isc_thread_create /builds/isc-private/bind9/lib/isc/thread.c:81:8 (libisc-9.18.0.so+0x7804a)
#2 isc__netmgr_create /builds/isc-private/bind9/lib/isc/netmgr/netmgr.c:331:3 (libisc-9.18.0.so+0x20cb1)
#3 isc_managers_create /builds/isc-private/bind9/lib/isc/managers.c:41:2 (libisc-9.18.0.so+0x5e117)
#4 create_managers /builds/isc-private/bind9/bin/named/main.c:922:11 (named+0x4e1a9c)
#5 setup /builds/isc-private/bind9/bin/named/main.c:1186:11 (named+0x4e1a9c)
#6 main /builds/isc-private/bind9/bin/named/main.c:1454:2 (named+0x4e1a9c)
SUMMARY: ThreadSanitizer: data race /builds/isc-private/bind9/lib/dns/dispatch.c in dns_dispatch_send
==================
ThreadSanitizer: reported 1 warnings