Data race in fwrite, memcpy, and free in dnstap_test with atomics disabled
GCC and Clang report TSAN errors on ~"v9.11" with dnstap enabled and atomics disabled in the dnstap_test
. These errors should not come from libfstrm.so
as these are suppressed. Before !4618 (merged) gets integrated see the mnowak/configure-with-enable-dnstap-by-default-v9_11
branch and set CI_REGISTRY_IMAGE=registry.gitlab.isc.org/isc-projects/images/bind9-staging
.
WARNING: ThreadSanitizer: data race
Read of size 8 at 0x000000000001 by thread T1:
#0 memcpy <null>
#1 <null> <null>
Previous write of size 8 at 0x000000000001 by main thread:
#0 memcpy <null>
#1 <null> <null>
#2 dns_dt_send lib/dns/dnstap.c:780:3
#3 send_test lib/dns/tests/dnstap_test.c:259:3
#4 <null> <null>
#5 __libc_start_main /build/glibc-vjB4T2/glibc-2.28/csu/../csu/libc-start.c:308:16
Location is heap block of size 16384 at 0x000000000009 allocated by main thread:
#0 calloc <null>
#1 <null> <null>
#2 send_test lib/dns/tests/dnstap_test.c:176:11
#3 <null> <null>
#4 __libc_start_main /build/glibc-vjB4T2/glibc-2.28/csu/../csu/libc-start.c:308:16
Thread T2 (running) created by main thread at:
#0 pthread_create <null>
#1 fstrm_iothr_init <null>
#2 send_test lib/dns/tests/dnstap_test.c:176:11
#3 <null> <null>
#4 __libc_start_main /build/glibc-vjB4T2/glibc-2.28/csu/../csu/libc-start.c:308:16
SUMMARY: ThreadSanitizer: data race in memcpy
WARNING: ThreadSanitizer: data race
Write of size 8 at 0x000000000001 by thread T1:
#0 free <null>
#1 <null> <null>
Previous write of size 8 at 0x000000000001 by main thread:
#0 malloc <null>
#1 pack_dt lib/dns/dnstap.c:543:14
#2 dns_dt_send lib/dns/dnstap.c:779:6
#3 send_test lib/dns/tests/dnstap_test.c:257:3
#4 <null> <null>
#5 __libc_start_main /build/glibc-vjB4T2/glibc-2.28/csu/../csu/libc-start.c:308:16
Thread T2 (running) created by main thread at:
#0 pthread_create <null>
#1 fstrm_iothr_init <null>
#2 send_test lib/dns/tests/dnstap_test.c:176:11
#3 <null> <null>
#4 __libc_start_main /build/glibc-vjB4T2/glibc-2.28/csu/../csu/libc-start.c:308:16
SUMMARY: ThreadSanitizer: data race in free
WARNING: ThreadSanitizer: data race
Read of size 8 at 0x000000000001 by thread T1:
#0 fwrite <null>
#1 <null> <null>
Previous write of size 8 at 0x000000000001 by main thread:
#0 malloc <null>
#1 pack_dt lib/dns/dnstap.c:543:14
#2 dns_dt_send lib/dns/dnstap.c:779:6
#3 send_test lib/dns/tests/dnstap_test.c:254:3
#4 <null> <null>
#5 __libc_start_main /build/glibc-vjB4T2/glibc-2.28/csu/../csu/libc-start.c:308:16
Location is heap block of size 256 at 0x000000000001 allocated by main thread:
#0 malloc <null>
#1 pack_dt lib/dns/dnstap.c:543:14
#2 dns_dt_send lib/dns/dnstap.c:779:6
#3 send_test lib/dns/tests/dnstap_test.c:254:3
#4 <null> <null>
#5 __libc_start_main /build/glibc-vjB4T2/glibc-2.28/csu/../csu/libc-start.c:308:16
Thread T2 (running) created by main thread at:
#0 pthread_create <null>
#1 fstrm_iothr_init <null>
#2 send_test lib/dns/tests/dnstap_test.c:176:11
#3 <null> <null>
#4 __libc_start_main /build/glibc-vjB4T2/glibc-2.28/csu/../csu/libc-start.c:308:16
SUMMARY: ThreadSanitizer: data race in fwrite
I'll just disable dnstap in unit:gcc:tsan:noatomics
and unit:clang:tsan:noatomics
if we decide not to fix these errors given the phase ~"v9.11" is in.