ThreadSanitizer: data race lib/dns/xfrin.c:830:15 in dns_xfrin_getendserial
A data race introduced in the development branch by a recent work in xfrin.
See https://gitlab.isc.org/isc-projects/bind9/-/jobs/3673987
WARNING: ThreadSanitizer: data race
Read of size 4 at 0x000000000001 by main thread:
#0 dns_xfrin_getendserial lib/dns/xfrin.c:830:15 (BuildId: a436a9622c5b7f074360887e81e2d47117534f02)
#1 xfrin_xmlrender bin/named/statschannel.c:1531:12 (BuildId: 417ea5308cb332d66dbff676d25ceae18ab025f1)
#2 dns_zt_apply lib/dns/zt.c:518:12 (BuildId: a436a9622c5b7f074360887e81e2d47117534f02)
#3 generatexml bin/named/statschannel.c:2011:4 (BuildId: 417ea5308cb332d66dbff676d25ceae18ab025f1)
#4 render_xml bin/named/statschannel.c:2141:11
#5 render_xml_xfrins bin/named/statschannel.c:2211:10 (BuildId: 417ea5308cb332d66dbff676d25ceae18ab025f1)
#6 prepare_response lib/isc/httpd.c:790:12 (BuildId: 7cc468b843634188ce4e45319f2b8b561393a8e8)
#7 httpd_request lib/isc/httpd.c:944:2
#8 isc___nm_readcb lib/isc/netmgr/netmgr.c:1766:2 (BuildId: 7cc468b843634188ce4e45319f2b8b561393a8e8)
#9 isc__nm_readcb lib/isc/netmgr/netmgr.c:1781:3
#10 isc__nm_tcp_read_cb lib/isc/netmgr/tcp.c:770:2 (BuildId: 7cc468b843634188ce4e45319f2b8b561393a8e8)
#11 uv__read /usr/src/libuv-v1.46.0/src/unix/stream.c:1143:7 (BuildId: 1b5307d484d8cb99602a0a0749ea2f3df2d7d355)
#12 thread_body lib/isc/thread.c:85:8 (BuildId: 7cc468b843634188ce4e45319f2b8b561393a8e8)
#13 isc_thread_main lib/isc/thread.c:116:2
#14 isc_loopmgr_run lib/isc/loop.c:454:2 (BuildId: 7cc468b843634188ce4e45319f2b8b561393a8e8)
#15 main bin/named/main.c:1580:2 (BuildId: 417ea5308cb332d66dbff676d25ceae18ab025f1)
Previous write of size 4 at 0x000000000001 by thread T0001:
#0 xfr_rr lib/dns/xfrin.c:566:19 (BuildId: a436a9622c5b7f074360887e81e2d47117534f02)
#1 xfrin_recv_done lib/dns/xfrin.c:1725:5 (BuildId: a436a9622c5b7f074360887e81e2d47117534f02)
#2 tcp_recv_processall lib/dns/dispatch.c:750:3 (BuildId: a436a9622c5b7f074360887e81e2d47117534f02)
#3 tcp_recv lib/dns/dispatch.c:893:2 (BuildId: a436a9622c5b7f074360887e81e2d47117534f02)
#4 streamdns_on_complete_dnsmessage lib/isc/netmgr/streamdns.c (BuildId: 7cc468b843634188ce4e45319f2b8b561393a8e8)
#5 streamdns_on_dnsmessage_data_cb lib/isc/netmgr/streamdns.c:206:11
#6 isc__dnsstream_assembler_callcb lib/isc/./include/isc/dnsstream.h:306:8 (BuildId: 7cc468b843634188ce4e45319f2b8b561393a8e8)
#7 isc__dnsstream_assembler_handle_message lib/isc/./include/isc/dnsstream.h:353:10
#8 isc__dnsstream_assembler_incoming_direct_non_empty lib/isc/./include/isc/dnsstream.h:455:10 (BuildId: 7cc468b843634188ce4e45319f2b8b561393a8e8)
#9 isc_dnsstream_assembler_incoming lib/isc/./include/isc/dnsstream.h:511:14 (BuildId: 7cc468b843634188ce4e45319f2b8b561393a8e8)
#10 streamdns_handle_incoming_data lib/isc/netmgr/streamdns.c:242:2
#11 streamdns_readcb lib/isc/netmgr/streamdns.c:526:2 (BuildId: 7cc468b843634188ce4e45319f2b8b561393a8e8)
#12 tls_do_bio lib/isc/netmgr/tlsstream.c:667:5 (BuildId: 7cc468b843634188ce4e45319f2b8b561393a8e8)
#13 tls_readcb lib/isc/netmgr/tlsstream.c:828:2 (BuildId: 7cc468b843634188ce4e45319f2b8b561393a8e8)
#14 isc___nm_readcb lib/isc/netmgr/netmgr.c:1766:2 (BuildId: 7cc468b843634188ce4e45319f2b8b561393a8e8)
#15 isc__nm_readcb lib/isc/netmgr/netmgr.c:1781:3
#16 isc__nm_tcp_read_cb lib/isc/netmgr/tcp.c:770:2 (BuildId: 7cc468b843634188ce4e45319f2b8b561393a8e8)
#17 uv__read /usr/src/libuv-v1.46.0/src/unix/stream.c:1143:7 (BuildId: 1b5307d484d8cb99602a0a0749ea2f3df2d7d355)
#18 thread_body lib/isc/thread.c:85:8 (BuildId: 7cc468b843634188ce4e45319f2b8b561393a8e8)
#19 thread_run lib/isc/thread.c:100:14
Location is heap block of size 2456 at 0x000000000026 allocated by thread T0001:
#0 malloc <null> (BuildId: 417ea5308cb332d66dbff676d25ceae18ab025f1)
#1 mallocx lib/isc/./jemalloc_shim.h:67:14 (BuildId: 7cc468b843634188ce4e45319f2b8b561393a8e8)
#2 mem_get lib/isc/mem.c:305:8
#3 isc__mem_get lib/isc/mem.c:744:8 (BuildId: 7cc468b843634188ce4e45319f2b8b561393a8e8)
#4 xfrin_create lib/dns/xfrin.c:987:8 (BuildId: a436a9622c5b7f074360887e81e2d47117534f02)
#5 dns_xfrin_create lib/dns/xfrin.c:726:2
#6 got_transfer_quota lib/dns/zone.c:17875:11 (BuildId: a436a9622c5b7f074360887e81e2d47117534f02)
#7 isc__async_cb lib/isc/async.c:111:3 (BuildId: 7cc468b843634188ce4e45319f2b8b561393a8e8)
#8 uv__async_io /usr/src/libuv-v1.46.0/src/unix/async.c:176:5 (BuildId: 1b5307d484d8cb99602a0a0749ea2f3df2d7d355)
#9 thread_body lib/isc/thread.c:85:8 (BuildId: 7cc468b843634188ce4e45319f2b8b561393a8e8)
#10 thread_run lib/isc/thread.c:100:14
Thread T0001 'isc-loop-0003' (running) created by main thread at:
#0 pthread_create <null> (BuildId: 417ea5308cb332d66dbff676d25ceae18ab025f1)
#1 isc_thread_create lib/isc/thread.c:139:8 (BuildId: 7cc468b843634188ce4e45319f2b8b561393a8e8)
#2 isc_loopmgr_run lib/isc/loop.c:448:3 (BuildId: 7cc468b843634188ce4e45319f2b8b561393a8e8)
#3 main bin/named/main.c:1580:2 (BuildId: 417ea5308cb332d66dbff676d25ceae18ab025f1)
SUMMARY: ThreadSanitizer: data race lib/dns/xfrin.c:830:15 in dns_xfrin_getendserial