The following TSAN report about accessing the mgr timers (mgr->init,
mgr->idle, mgr->keepalive and mgr->advertised) has been fixed in this
commit:
==================
WARNING: ThreadSanitizer: data race (pid=2746)
Read of size 4 at 0x7b440008a948 by thread T18:
#0 isc__nm_tcpdns_read /home/ondrej/Projects/bind9/lib/isc/netmgr/tcpdns.c:849:25 (libisc.so.1706+0x2ba0f)
#1 isc_nm_read /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:1679:3 (libisc.so.1706+0x22258)
#2 tcpdns_connect_connect_cb /home/ondrej/Projects/bind9/lib/isc/tests/tcpdns_test.c:363:2 (tcpdns_test+0x4bc5fb)
#3 isc__nm_async_connectcb /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:1816:2 (libisc.so.1706+0x228c9)
#4 isc__nm_connectcb /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:1791:3 (libisc.so.1706+0x22713)
#5 tcpdns_connect_cb /home/ondrej/Projects/bind9/lib/isc/netmgr/tcpdns.c:343:2 (libisc.so.1706+0x2d89d)
#6 uv__stream_connect /home/ondrej/Projects/tsan/libuv/src/unix/stream.c:1381:5 (libuv.so.1+0x27c18)
#7 uv__stream_io /home/ondrej/Projects/tsan/libuv/src/unix/stream.c:1298:5 (libuv.so.1+0x25977)
#8 uv__io_poll /home/ondrej/Projects/tsan/libuv/src/unix/linux-core.c:462:11 (libuv.so.1+0x2e795)
#9 uv_run /home/ondrej/Projects/tsan/libuv/src/unix/core.c:385:5 (libuv.so.1+0x158ec)
#10 nm_thread /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:530:11 (libisc.so.1706+0x1c94a)
Previous write of size 4 at 0x7b440008a948 by main thread:
#0 isc_nm_settimeouts /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:490:12 (libisc.so.1706+0x1dda5)
#1 tcpdns_recv_two /home/ondrej/Projects/bind9/lib/isc/tests/tcpdns_test.c:601:2 (tcpdns_test+0x4bad0e)
#2 cmocka_run_one_test_or_fixture <null> (libcmocka.so.0+0x70be)
#3 __libc_start_main /build/glibc-vjB4T1/glibc-2.28/csu/../csu/libc-start.c:308:16 (libc.so.6+0x2409a)
Location is heap block of size 281 at 0x7b440008a840 allocated by main thread:
#0 malloc <null> (tcpdns_test+0x42864b)
#1 default_memalloc /home/ondrej/Projects/bind9/lib/isc/mem.c:713:8 (libisc.so.1706+0x6d261)
#2 mem_get /home/ondrej/Projects/bind9/lib/isc/mem.c:622:8 (libisc.so.1706+0x69b9c)
#3 isc___mem_get /home/ondrej/Projects/bind9/lib/isc/mem.c:1044:9 (libisc.so.1706+0x6d379)
#4 isc__mem_get /home/ondrej/Projects/bind9/lib/isc/mem.c:2432:10 (libisc.so.1706+0x6889e)
#5 isc_nm_start /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:203:8 (libisc.so.1706+0x1c219)
#6 nm_setup /home/ondrej/Projects/bind9/lib/isc/tests/tcpdns_test.c:244:11 (tcpdns_test+0x4baaa4)
#7 cmocka_run_one_test_or_fixture <null> (libcmocka.so.0+0x70fd)
#8 __libc_start_main /build/glibc-vjB4T1/glibc-2.28/csu/../csu/libc-start.c:308:16 (libc.so.6+0x2409a)
Thread T18 'isc-net-0000' (tid=3513, running) created by main thread at:
#0 pthread_create <null> (tcpdns_test+0x429e7b)
#1 isc_thread_create /home/ondrej/Projects/bind9/lib/isc/pthreads/thread.c:73:8 (libisc.so.1706+0x8476a)
#2 isc_nm_start /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:271:3 (libisc.so.1706+0x1c66a)
#3 nm_setup /home/ondrej/Projects/bind9/lib/isc/tests/tcpdns_test.c:244:11 (tcpdns_test+0x4baaa4)
#4 cmocka_run_one_test_or_fixture <null> (libcmocka.so.0+0x70fd)
#5 __libc_start_main /build/glibc-vjB4T1/glibc-2.28/csu/../csu/libc-start.c:308:16 (libc.so.6+0x2409a)
SUMMARY: ThreadSanitizer: data race /home/ondrej/Projects/bind9/lib/isc/netmgr/tcpdns.c:849:25 in isc__nm_tcpdns_read
==================
ThreadSanitizer: reported 1 warnings
(cherry picked from commit 2e1dd56d0b)
142 lines
4.4 KiB
Makefile
142 lines
4.4 KiB
Makefile
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
|
#
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
#
|
|
# See the COPYRIGHT file distributed with this work for additional
|
|
# information regarding copyright ownership.
|
|
|
|
srcdir = @srcdir@
|
|
VPATH = @srcdir@
|
|
top_srcdir = @top_srcdir@
|
|
|
|
VERSION=@BIND9_VERSION@
|
|
|
|
@LIBISC_API@
|
|
|
|
@BIND9_MAKE_INCLUDES@
|
|
|
|
CINCLUDES = -I${srcdir}/unix/include \
|
|
-I${srcdir}/pthreads/include \
|
|
-I./include \
|
|
-I${srcdir}/include ${DNS_INCLUDES} \
|
|
${OPENSSL_CFLAGS} \
|
|
${JSON_C_CFLAGS} \
|
|
${LIBXML2_CFLAGS} \
|
|
${ZLIB_CFLAGS}
|
|
CDEFINES =
|
|
CWARNINGS =
|
|
|
|
# Alphabetically
|
|
UNIXOBJS = unix/pk11_api.@O@ \
|
|
unix/dir.@O@ unix/errno.@O@ \
|
|
unix/errno2result.@O@ unix/file.@O@ unix/fsaccess.@O@ \
|
|
unix/interfaceiter.@O@ unix/meminfo.@O@ \
|
|
unix/net.@O@ unix/os.@O@ unix/resource.@O@ unix/socket.@O@ \
|
|
unix/stdio.@O@ unix/stdtime.@O@ \
|
|
unix/syslog.@O@ unix/time.@O@
|
|
|
|
THREADOBJS = pthreads/condition.@O@ pthreads/mutex.@O@ pthreads/thread.@O@
|
|
|
|
WIN32OBJS = win32/condition.@O@ win32/dir.@O@ win32/errno.@O@ \
|
|
win32/file.@O@ win32/fsaccess.@O@ \
|
|
win32/meminfo.@O@ win32/once.@O@ \
|
|
win32/stdtime.@O@ win32/thread.@O@ win32/time.@O@
|
|
|
|
# Alphabetically
|
|
OBJS = pk11.@O@ pk11_result.@O@ \
|
|
aes.@O@ app.@O@ assertions.@O@ astack.@O@ \
|
|
backtrace.@O@ base32.@O@ base64.@O@ \
|
|
bind9.@O@ buffer.@O@ bufferlist.@O@ \
|
|
commandline.@O@ counter.@O@ crc64.@O@ error.@O@ entropy.@O@ \
|
|
event.@O@ hash.@O@ ht.@O@ heap.@O@ hex.@O@ \
|
|
hmac.@O@ hp.@O@ httpd.@O@ iterated_hash.@O@ \
|
|
lex.@O@ lfsr.@O@ lib.@O@ log.@O@ \
|
|
md.@O@ mem.@O@ mutexblock.@O@ \
|
|
netmgr/netmgr.@O@ netmgr/tcp.@O@ netmgr/udp.@O@ \
|
|
netmgr/tcpdns.@O@ netmgr/tls.@O@ netmgr/tlsdns.@O@ netmgr/uverr2result.@O@ netmgr/uv-compat.@O@ \
|
|
netaddr.@O@ netscope.@O@ nonce.@O@ openssl_shim.@O@ pool.@O@ \
|
|
parseint.@O@ portset.@O@ queue.@O@ quota.@O@ \
|
|
radix.@O@ random.@O@ ratelimiter.@O@ \
|
|
region.@O@ regex.@O@ result.@O@ rwlock.@O@ \
|
|
safe.@O@ serial.@O@ siphash.@O@ sockaddr.@O@ stats.@O@ \
|
|
string.@O@ symtab.@O@ task.@O@ taskpool.@O@ \
|
|
utf8.@O@ tm.@O@ timer.@O@ version.@O@ \
|
|
${UNIXOBJS} ${THREADOBJS}
|
|
SYMTBLOBJS = backtrace-emptytbl.@O@
|
|
|
|
# Alphabetically
|
|
SRCS = pk11.c pk11_result.c \
|
|
aes.c app.c assertions.c astack.c \
|
|
backtrace.c base32.c base64.c bind9.c \
|
|
buffer.c bufferlist.c commandline.c counter.c crc64.c \
|
|
entropy.c error.c event.c hash.c ht.c heap.c \
|
|
hex.c hmac.c hp.c httpd.c iterated_hash.c \
|
|
lex.c lfsr.c lib.c log.c \
|
|
md.c mem.c mutexblock.c \
|
|
netaddr.c netscope.c nonce.c openssl_shim.c pool.c \
|
|
parseint.c portset.c queue.c quota.c radix.c random.c \
|
|
ratelimiter.c region.c regex.c result.c rwlock.c \
|
|
safe.c serial.c siphash.c sockaddr.c stats.c string.c \
|
|
symtab.c task.c taskpool.c timer.c \
|
|
utf8.c tm.c version.c
|
|
|
|
LIBS = ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBUV_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS} @LIBS@
|
|
|
|
# Note: the order of SUBDIRS is important.
|
|
# Attempt to disable parallel processing.
|
|
.NOTPARALLEL:
|
|
.NO_PARALLEL:
|
|
SUBDIRS = include netmgr unix pthreads
|
|
TARGETS = timestamp
|
|
TESTDIRS = @UNITTESTS@
|
|
|
|
@BIND9_MAKE_RULES@
|
|
|
|
version.@O@: version.c
|
|
${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \
|
|
-DVERSION=\"${VERSION}\" \
|
|
-DLIBINTERFACE=${LIBINTERFACE} \
|
|
-DLIBREVISION=${LIBREVISION} \
|
|
-DLIBAGE=${LIBAGE} \
|
|
-c ${srcdir}/version.c
|
|
|
|
libisc.@SA@: ${OBJS} ${SYMTBLOBJS}
|
|
${AR} ${ARFLAGS} $@ ${OBJS} ${SYMTBLOBJS}
|
|
${RANLIB} $@
|
|
|
|
libisc-nosymtbl.@SA@: ${OBJS}
|
|
${AR} ${ARFLAGS} $@ ${OBJS}
|
|
${RANLIB} $@
|
|
|
|
libisc.la: ${OBJS} ${SYMTBLOBJS}
|
|
${LIBTOOL_MODE_LINK} \
|
|
${CC} ${ALL_CFLAGS} ${LDFLAGS} -o libisc.la -rpath ${libdir} \
|
|
-version-info ${LIBINTERFACE}:${LIBREVISION}:${LIBAGE} \
|
|
${OBJS} ${SYMTBLOBJS} ${LIBS}
|
|
|
|
libisc-nosymtbl.la: ${OBJS}
|
|
${LIBTOOL_MODE_LINK} \
|
|
${CC} ${ALL_CFLAGS} ${LDFLAGS} -o libisc-nosymtbl.la -rpath ${libdir} \
|
|
-version-info ${LIBINTERFACE}:${LIBREVISION}:${LIBAGE} \
|
|
${OBJS} ${LIBS}
|
|
|
|
timestamp: libisc.@A@ libisc-nosymtbl.@A@
|
|
touch timestamp
|
|
|
|
testdirs: libisc.@A@ libisc-nosymtbl.@A@
|
|
|
|
installdirs:
|
|
$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${libdir}
|
|
|
|
install:: timestamp installdirs
|
|
${LIBTOOL_MODE_INSTALL} ${INSTALL_LIBRARY} libisc.@A@ ${DESTDIR}${libdir}
|
|
|
|
uninstall::
|
|
${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${libdir}/libisc.@A@
|
|
|
|
clean distclean::
|
|
rm -f libisc.@A@ libisc-nosymtbl.@A@ libisc.la \
|
|
libisc-nosymtbl.la timestamp
|