ThreadSanitizer: data race lib/isc/task.c:435 in task_send (unprotected access to `task->threadid`)
(This should be ultimately resolved by making the tasks to be assigned to a single worker for their entire lifetime.)
==================
WARNING: ThreadSanitizer: data race (pid=32684)
Write of size 4 at 0x7b3800034688 by thread T1 (mutexes: write M134399044339482320, write M230660, write M362957240824530600, write M239952160606078560):
#0 task_send /builds/isc-projects/bind9/lib/isc/task.c:435 (libisc-9.16.16.so+0x66587)
#1 isc_task_sendtoanddetach /builds/isc-projects/bind9/lib/isc/task.c:515 (libisc-9.16.16.so+0x66587)
#2 isc_task_sendanddetach /builds/isc-projects/bind9/lib/isc/task.c:456 (libisc-9.16.16.so+0x669bd)
#3 dns_resolver_cancelfetch /builds/isc-projects/bind9/lib/dns/resolver.c:11159 (libdns-9.16.16.so+0x19a861)
#4 ns_query_cancel /builds/isc-projects/bind9/lib/ns/query.c:653 (libns-9.16.16.so+0x30ad8)
#5 ns_client_killoldestquery /builds/isc-projects/bind9/lib/ns/client.c:175 (libns-9.16.16.so+0xea95)
#6 ns_query_recurse /builds/isc-projects/bind9/lib/ns/query.c:6302 (libns-9.16.16.so+0x327d2)
#7 query_delegation_recurse /builds/isc-projects/bind9/lib/ns/query.c:8643 (libns-9.16.16.so+0x4093c)
#8 query_delegation /builds/isc-projects/bind9/lib/ns/query.c:8589 (libns-9.16.16.so+0x4093c)
#9 query_gotanswer /builds/isc-projects/bind9/lib/ns/query.c:7322 (libns-9.16.16.so+0x3c4f9)
#10 query_lookup /builds/isc-projects/bind9/lib/ns/query.c:5919 (libns-9.16.16.so+0x3dbb7)
#11 ns__query_start /builds/isc-projects/bind9/lib/ns/query.c:5561 (libns-9.16.16.so+0x3ebc9)
#12 query_setup /builds/isc-projects/bind9/lib/ns/query.c:5274 (libns-9.16.16.so+0x477a2)
#13 ns_query_start /builds/isc-projects/bind9/lib/ns/query.c:11870 (libns-9.16.16.so+0x48073)
#14 ns__client_request /builds/isc-projects/bind9/lib/ns/client.c:2165 (libns-9.16.16.so+0x15bd8)
#15 isc__nm_async_readcb /builds/isc-projects/bind9/lib/isc/netmgr/netmgr.c:2575 (libisc-9.16.16.so+0x4883e)
#16 isc__nm_readcb /builds/isc-projects/bind9/lib/isc/netmgr/netmgr.c:2550 (libisc-9.16.16.so+0x489e7)
#17 udp_recv_cb /builds/isc-projects/bind9/lib/isc/netmgr/udp.c:426 (libisc-9.16.16.so+0x4fd79)
#18 <null> <null> (libuv.so.1+0x1d6d4)
#19 isc__trampoline_run /builds/isc-projects/bind9/lib/isc/trampoline.c:191 (libisc-9.16.16.so+0x6bdc5)
#20 <null> <null> (libtsan.so.0+0x29b3d)
Previous read of size 4 at 0x7b3800034688 by thread T3:
#0 task_ready /builds/isc-projects/bind9/lib/isc/task.c:347 (libisc-9.16.16.so+0x6a1dc)
#1 isc_task_unpause /builds/isc-projects/bind9/lib/isc/task.c:1230 (libisc-9.16.16.so+0x6a1dc)
#2 ns__client_request /builds/isc-projects/bind9/lib/ns/client.c:2191 (libns-9.16.16.so+0x15bed)
#3 isc__nm_async_readcb /builds/isc-projects/bind9/lib/isc/netmgr/netmgr.c:2575 (libisc-9.16.16.so+0x4883e)
#4 isc__nm_readcb /builds/isc-projects/bind9/lib/isc/netmgr/netmgr.c:2550 (libisc-9.16.16.so+0x489e7)
#5 udp_recv_cb /builds/isc-projects/bind9/lib/isc/netmgr/udp.c:426 (libisc-9.16.16.so+0x4fd79)
#6 <null> <null> (libuv.so.1+0x1d6d4)
#7 isc__trampoline_run /builds/isc-projects/bind9/lib/isc/trampoline.c:191 (libisc-9.16.16.so+0x6bdc5)
#8 <null> <null> (libtsan.so.0+0x29b3d)
Location is heap block of size 209 at 0x7b3800034640 allocated by thread T1:
#0 malloc <null> (libtsan.so.0+0x2b1a3)
#1 default_memalloc /builds/isc-projects/bind9/lib/isc/mem.c:717 (libisc-9.16.16.so+0x3796e)
#2 mem_get /builds/isc-projects/bind9/lib/isc/mem.c:626 (libisc-9.16.16.so+0x384b6)
#3 mem_allocateunlocked /builds/isc-projects/bind9/lib/isc/mem.c:1292 (libisc-9.16.16.so+0x384b6)
#4 isc___mem_allocate /builds/isc-projects/bind9/lib/isc/mem.c:1312 (libisc-9.16.16.so+0x384b6)
#5 isc__mem_allocate /builds/isc-projects/bind9/lib/isc/mem.c:2563 (libisc-9.16.16.so+0x3e6e0)
#6 isc___mem_get /builds/isc-projects/bind9/lib/isc/mem.c:1061 (libisc-9.16.16.so+0x3ec16)
#7 isc__mem_get /builds/isc-projects/bind9/lib/isc/mem.c:2542 (libisc-9.16.16.so+0x3d7de)
#8 isc_task_create_bound /builds/isc-projects/bind9/lib/isc/task.c:216 (libisc-9.16.16.so+0x67f93)
#9 ns_clientmgr_create /builds/isc-projects/bind9/lib/ns/client.c:2475 (libns-9.16.16.so+0x110b2)
#10 ns_interface_create /builds/isc-projects/bind9/lib/ns/interfacemgr.c:430 (libns-9.16.16.so+0x19fe5)
#11 ns_interface_setup /builds/isc-projects/bind9/lib/ns/interfacemgr.c:513 (libns-9.16.16.so+0x19fe5)
#12 do_scan /builds/isc-projects/bind9/lib/ns/interfacemgr.c:1088 (libns-9.16.16.so+0x1b4e4)
#13 ns_interfacemgr_scan0 /builds/isc-projects/bind9/lib/ns/interfacemgr.c:1147 (libns-9.16.16.so+0x1bad9)
#14 ns_interfacemgr_scan /builds/isc-projects/bind9/lib/ns/interfacemgr.c:1195 (libns-9.16.16.so+0x1bc30)
#15 load_configuration server.c:8871 (named+0x55513)
#16 run_server server.c:9815 (named+0x5b132)
#17 task_run /builds/isc-projects/bind9/lib/isc/task.c:852 (libisc-9.16.16.so+0x68ae9)
#18 isc_task_run /builds/isc-projects/bind9/lib/isc/task.c:945 (libisc-9.16.16.so+0x68ae9)
#19 isc__nm_async_task /builds/isc-projects/bind9/lib/isc/netmgr/netmgr.c:880 (libisc-9.16.16.so+0x40ba0)
#20 process_netievent /builds/isc-projects/bind9/lib/isc/netmgr/netmgr.c:959 (libisc-9.16.16.so+0x48f04)
#21 process_queue /builds/isc-projects/bind9/lib/isc/netmgr/netmgr.c:1028 (libisc-9.16.16.so+0x496de)
#22 process_all_queues /builds/isc-projects/bind9/lib/isc/netmgr/netmgr.c:799 (libisc-9.16.16.so+0x49fae)
#23 async_cb /builds/isc-projects/bind9/lib/isc/netmgr/netmgr.c:828 (libisc-9.16.16.so+0x49fae)
#24 <null> <null> (libuv.so.1+0x10667)
#25 isc__trampoline_run /builds/isc-projects/bind9/lib/isc/trampoline.c:191 (libisc-9.16.16.so+0x6bdc5)
#26 <null> <null> (libtsan.so.0+0x29b3d)
Mutex M134399044339482320 is already destroyed.
Mutex M230660 (0x7b7c001b8488) created at:
#0 pthread_mutex_init <null> (libtsan.so.0+0x2c5ad)
#1 isc__mutex_init /builds/isc-projects/bind9/lib/isc/pthreads/mutex.c:288 (libisc-9.16.16.so+0x888f7)
#2 ns_query_init /builds/isc-projects/bind9/lib/ns/query.c:798 (libns-9.16.16.so+0x32012)
#3 ns__client_setup /builds/isc-projects/bind9/lib/ns/client.c:2291 (libns-9.16.16.so+0x10cbf)
#4 ns__client_request /builds/isc-projects/bind9/lib/ns/client.c:1658 (libns-9.16.16.so+0x134c4)
#5 isc__nm_async_readcb /builds/isc-projects/bind9/lib/isc/netmgr/netmgr.c:2575 (libisc-9.16.16.so+0x4883e)
#6 isc__nm_readcb /builds/isc-projects/bind9/lib/isc/netmgr/netmgr.c:2550 (libisc-9.16.16.so+0x489e7)
#7 udp_recv_cb /builds/isc-projects/bind9/lib/isc/netmgr/udp.c:426 (libisc-9.16.16.so+0x4fd79)
#8 <null> <null> (libuv.so.1+0x1d6d4)
#9 isc__trampoline_run /builds/isc-projects/bind9/lib/isc/trampoline.c:191 (libisc-9.16.16.so+0x6bdc5)
#10 <null> <null> (libtsan.so.0+0x29b3d)
Mutex M362957240824530600 is already destroyed.
Mutex M239952160606078560 is already destroyed.
Thread T1 'isc-net-0000' (tid=32699, running) created by main thread at:
#0 pthread_create <null> (libtsan.so.0+0x2be1b)
#1 isc_thread_create /builds/isc-projects/bind9/lib/isc/pthreads/thread.c:79 (libisc-9.16.16.so+0x889a0)
#2 isc__netmgr_create /builds/isc-projects/bind9/lib/isc/netmgr/netmgr.c:374 (libisc-9.16.16.so+0x41619)
#3 isc_managers_create /builds/isc-projects/bind9/lib/isc/managers.c:33 (libisc-9.16.16.so+0x359cb)
#4 create_managers main.c:920 (named+0x2886e)
#5 setup main.c:1245 (named+0x2886e)
#6 main main.c:1548 (named+0x2886e)
Thread T3 'isc-net-0002' (tid=32701, running) created by main thread at:
#0 pthread_create <null> (libtsan.so.0+0x2be1b)
#1 isc_thread_create /builds/isc-projects/bind9/lib/isc/pthreads/thread.c:79 (libisc-9.16.16.so+0x889a0)
#2 isc__netmgr_create /builds/isc-projects/bind9/lib/isc/netmgr/netmgr.c:374 (libisc-9.16.16.so+0x41619)
#3 isc_managers_create /builds/isc-projects/bind9/lib/isc/managers.c:33 (libisc-9.16.16.so+0x359cb)
#4 create_managers main.c:920 (named+0x2886e)
#5 setup main.c:1245 (named+0x2886e)
#6 main main.c:1548 (named+0x2886e)
SUMMARY: ThreadSanitizer: data race /builds/isc-projects/bind9/lib/isc/task.c:435 in task_send