ThreadSanitizer: data race /home/ondrej/Projects/bind9/lib/dns/zt.c:241:7 in zt_flushanddetach
This might be unrelated to the dispatch@netmgr changes, but I don't recall seeing this. I reproduced the issue locally, just by running the system tests in the loop.
WARNING: ThreadSanitizer: data race (pid=1780187)
Write of size 8 at 0x7b6c00003820 by thread T3:
#0 zt_flushanddetach /home/ondrej/Projects/bind9/lib/dns/zt.c:241:7 (libdns-9.17.18.so+0x41c9cf)
#1 dns_zt_flushanddetach /home/ondrej/Projects/bind9/lib/dns/zt.c:254:2 (libdns-9.17.18.so+0x41c8fa)
#2 view_flushanddetach /home/ondrej/Projects/bind9/lib/dns/view.c:649:4 (libdns-9.17.18.so+0x36ce97)
#3 dns_view_detach /home/ondrej/Projects/bind9/lib/dns/view.c:697:2 (libdns-9.17.18.so+0x36d297)
#4 ns_client_endrequest /home/ondrej/Projects/bind9/lib/ns/client.c:195:3 (libns-9.17.18.so+0x159fa)
#5 ns__client_reset_cb /home/ondrej/Projects/bind9/lib/ns/client.c:1561:2 (libns-9.17.18.so+0x14f5d)
#6 nmhandle_detach_cb /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:1864:3 (libisc-9.17.18.so+0x2c1cd)
#7 isc__nmhandle_detach /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:1820:3 (libisc-9.17.18.so+0x2520f)
#8 prefetch_done /home/ondrej/Projects/bind9/lib/ns/query.c:2523:2 (libns-9.17.18.so+0x524a4)
#9 task_run /home/ondrej/Projects/bind9/lib/isc/task.c:827:5 (libisc-9.17.18.so+0xafd6c)
#10 isc_task_run /home/ondrej/Projects/bind9/lib/isc/task.c:907:10 (libisc-9.17.18.so+0xaf645)
#11 isc__nm_async_task /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:834:11 (libisc-9.17.18.so+0x32f3e)
#12 process_netievent /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:913:3 (libisc-9.17.18.so+0x2797a)
#13 process_queue /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:1007:16 (libisc-9.17.18.so+0x32dda)
#14 process_all_queues /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:753:25 (libisc-9.17.18.so+0x32bff)
#15 async_cb /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:782:6 (libisc-9.17.18.so+0x215a2)
#16 uv__async_io /home/ondrej/Projects/tsan/libuv/src/unix/async.c:163:5 (libuv.so.1+0x12403)
#17 uv__io_poll /home/ondrej/Projects/tsan/libuv/src/unix/epoll.c:374:11 (libuv.so.1+0x309bc)
#18 uv_run /home/ondrej/Projects/tsan/libuv/src/unix/core.c:389:5 (libuv.so.1+0x12d2a)
#19 nm_thread /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:688:11 (libisc-9.17.18.so+0x21662)
#20 isc__trampoline_run /home/ondrej/Projects/bind9/lib/isc/trampoline.c:185:11 (libisc-9.17.18.so+0xbe689)
Previous read of size 8 at 0x7b6c00003820 by thread T6 (mutexes: write M780947598420187352, write M1150242458626439272):
#0 dns_view_find /home/ondrej/Projects/bind9/lib/dns/view.c:1055:12 (libdns-9.17.18.so+0x372908)
#1 dbfind_name /home/ondrej/Projects/bind9/lib/dns/adb.c:3674:11 (libdns-9.17.18.so+0x458b9)
#2 dns_adb_createfind /home/ondrej/Projects/bind9/lib/dns/adb.c:3043:12 (libdns-9.17.18.so+0x42561)
#3 findname /home/ondrej/Projects/bind9/lib/dns/resolver.c:3274:11 (libdns-9.17.18.so+0x2dac56)
#4 fctx_getaddresses /home/ondrej/Projects/bind9/lib/dns/resolver.c:3609:3 (libdns-9.17.18.so+0x2d6afb)
#5 fctx_try /home/ondrej/Projects/bind9/lib/dns/resolver.c:3999:12 (libdns-9.17.18.so+0x2ce520)
#6 fctx_start /home/ondrej/Projects/bind9/lib/dns/resolver.c:4494:2 (libdns-9.17.18.so+0x2c48ed)
#7 task_run /home/ondrej/Projects/bind9/lib/isc/task.c:827:5 (libisc-9.17.18.so+0xafd6c)
#8 isc_task_run /home/ondrej/Projects/bind9/lib/isc/task.c:907:10 (libisc-9.17.18.so+0xaf645)
#9 isc__nm_async_task /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:834:11 (libisc-9.17.18.so+0x32f3e)
#10 process_netievent /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:913:3 (libisc-9.17.18.so+0x2797a)
#11 process_queue /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:1007:16 (libisc-9.17.18.so+0x32dda)
#12 process_all_queues /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:753:25 (libisc-9.17.18.so+0x32bff)
#13 async_cb /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:782:6 (libisc-9.17.18.so+0x215a2)
#14 uv__async_io /home/ondrej/Projects/tsan/libuv/src/unix/async.c:163:5 (libuv.so.1+0x12403)
#15 uv__io_poll /home/ondrej/Projects/tsan/libuv/src/unix/epoll.c:374:11 (libuv.so.1+0x309bc)
#16 uv_run /home/ondrej/Projects/tsan/libuv/src/unix/core.c:389:5 (libuv.so.1+0x12d2a)
#17 nm_thread /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:688:11 (libisc-9.17.18.so+0x21662)
#18 isc__trampoline_run /home/ondrej/Projects/bind9/lib/isc/trampoline.c:185:11 (libisc-9.17.18.so+0xbe689)
Location is heap block of size 1752 at 0x7b6c00003800 allocated by thread T1:
#0 malloc <null> (named+0x45e47d)
#1 mallocx /home/ondrej/Projects/bind9/lib/isc/./jemalloc_shim.h:30:10 (libisc-9.17.18.so+0x8f46e)
#2 mem_get /home/ondrej/Projects/bind9/lib/isc/mem.c:340:8 (libisc-9.17.18.so+0x87c0e)
#3 isc__mem_get /home/ondrej/Projects/bind9/lib/isc/mem.c:753:8 (libisc-9.17.18.so+0x87ab7)
#4 dns_view_create /home/ondrej/Projects/bind9/lib/dns/view.c:103:9 (libdns-9.17.18.so+0x369883)
#5 create_view /home/ondrej/Projects/bind9/bin/named/server.c:6306:11 (named+0x51dea4)
#6 load_configuration /home/ondrej/Projects/bind9/bin/named/server.c:9103:3 (named+0x516325)
#7 loadconfig /home/ondrej/Projects/bind9/bin/named/server.c:10329:11 (named+0x4f61a6)
#8 reload /home/ondrej/Projects/bind9/bin/named/server.c:10352:2 (named+0x4f5ea4)
#9 named_server_reloadcommand /home/ondrej/Projects/bind9/bin/named/server.c:10678:12 (named+0x4f5cee)
#10 named_control_docommand /home/ondrej/Projects/bind9/bin/named/control.c:252:12 (named+0x4da8b7)
#11 control_command /home/ondrej/Projects/bind9/bin/named/controlconf.c:389:17 (named+0x4e3f76)
#12 task_run /home/ondrej/Projects/bind9/lib/isc/task.c:827:5 (libisc-9.17.18.so+0xafd6c)
#13 isc_task_run /home/ondrej/Projects/bind9/lib/isc/task.c:907:10 (libisc-9.17.18.so+0xaf645)
#14 isc__nm_async_task /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:834:11 (libisc-9.17.18.so+0x32f3e)
#15 process_netievent /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:913:3 (libisc-9.17.18.so+0x2797a)
#16 process_queue /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:1007:16 (libisc-9.17.18.so+0x32dda)
#17 process_all_queues /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:753:25 (libisc-9.17.18.so+0x32bff)
#18 async_cb /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:782:6 (libisc-9.17.18.so+0x215a2)
#19 uv__async_io /home/ondrej/Projects/tsan/libuv/src/unix/async.c:163:5 (libuv.so.1+0x12403)
#20 uv__io_poll /home/ondrej/Projects/tsan/libuv/src/unix/epoll.c:374:11 (libuv.so.1+0x309bc)
#21 uv_run /home/ondrej/Projects/tsan/libuv/src/unix/core.c:389:5 (libuv.so.1+0x12d2a)
#22 nm_thread /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:688:11 (libisc-9.17.18.so+0x21662)
#23 isc__trampoline_run /home/ondrej/Projects/bind9/lib/isc/trampoline.c:185:11 (libisc-9.17.18.so+0xbe689)
Mutex M780947598420187352 is already destroyed.
Mutex M1150242458626439272 is already destroyed.
Thread T3 'isc-net-0002' (tid=1780264, running) created by main thread at:
#0 pthread_create <null> (named+0x45fb0d)
#1 isc_thread_create /home/ondrej/Projects/bind9/lib/isc/thread.c:79:8 (libisc-9.17.18.so+0xb40a6)
#2 isc__netmgr_create /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:328:3 (libisc-9.17.18.so+0x213e4)
#3 isc_managers_create /home/ondrej/Projects/bind9/lib/isc/managers.c:36:2 (libisc-9.17.18.so+0x848dc)
#4 create_managers /home/ondrej/Projects/bind9/bin/named/main.c:920:11 (named+0x4ed365)
#5 setup /home/ondrej/Projects/bind9/bin/named/main.c:1184:11 (named+0x4eada8)
#6 main /home/ondrej/Projects/bind9/bin/named/main.c:1452:2 (named+0x4e92fe)
Thread T6 'isc-net-0005' (tid=1780271, running) created by main thread at:
#0 pthread_create <null> (named+0x45fb0d)
#1 isc_thread_create /home/ondrej/Projects/bind9/lib/isc/thread.c:79:8 (libisc-9.17.18.so+0xb40a6)
#2 isc__netmgr_create /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:328:3 (libisc-9.17.18.so+0x213e4)
#3 isc_managers_create /home/ondrej/Projects/bind9/lib/isc/managers.c:36:2 (libisc-9.17.18.so+0x848dc)
#4 create_managers /home/ondrej/Projects/bind9/bin/named/main.c:920:11 (named+0x4ed365)
#5 setup /home/ondrej/Projects/bind9/bin/named/main.c:1184:11 (named+0x4eada8)
#6 main /home/ondrej/Projects/bind9/bin/named/main.c:1452:2 (named+0x4e92fe)
Thread T1 'isc-net-0000' (tid=1780223, running) created by main thread at:
#0 pthread_create <null> (named+0x45fb0d)
#1 isc_thread_create /home/ondrej/Projects/bind9/lib/isc/thread.c:79:8 (libisc-9.17.18.so+0xb40a6)
#2 isc__netmgr_create /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:328:3 (libisc-9.17.18.so+0x213e4)
#3 isc_managers_create /home/ondrej/Projects/bind9/lib/isc/managers.c:36:2 (libisc-9.17.18.so+0x848dc)
#4 create_managers /home/ondrej/Projects/bind9/bin/named/main.c:920:11 (named+0x4ed365)
#5 setup /home/ondrej/Projects/bind9/bin/named/main.c:1184:11 (named+0x4eada8)
#6 main /home/ondrej/Projects/bind9/bin/named/main.c:1452:2 (named+0x4e92fe)
SUMMARY: ThreadSanitizer: data race /home/ondrej/Projects/bind9/lib/dns/zt.c:241:7 in zt_flushanddetach