Do not update find.result_v4 and find.result_v6
These values are supposed to be static for the life of the find and
clean_finds_at_name was updating them resulting in TSAN error
reports.
WARNING: ThreadSanitizer: data race
Write of size 4 at 0x000000000001 by thread T1 (mutexes: write M1, write M2):
#0 clean_finds_at_name lib/dns/adb.c:1537
#1 fetch_callback lib/dns/adb.c:4009
#2 task_run lib/isc/task.c:815
#3 isc_task_run lib/isc/task.c:896
#4 isc__nm_async_task netmgr/netmgr.c:848
#5 process_netievent netmgr/netmgr.c:920
#6 process_queue netmgr/netmgr.c:1013
#7 process_all_queues netmgr/netmgr.c:767
#8 async_cb netmgr/netmgr.c:796
#9 uv__async_io /usr/src/libuv-v1.44.1/src/unix/async.c:163
#10 isc__trampoline_run lib/isc/trampoline.c:189
Previous read of size 4 at 0x000000000001 by thread T2:
#0 findname lib/dns/resolver.c:3749
#1 fctx_getaddresses lib/dns/resolver.c:3993
#2 fctx_try lib/dns/resolver.c:4390
#3 rctx_nextserver lib/dns/resolver.c:10356
#4 rctx_done lib/dns/resolver.c:10503
#5 resquery_response lib/dns/resolver.c:8511
#6 udp_recv lib/dns/dispatch.c:638
#7 isc__nm_async_readcb netmgr/netmgr.c:2885
#8 isc__nm_readcb netmgr/netmgr.c:2858
#9 udp_recv_cb netmgr/udp.c:650
#10 isc__nm_udp_read_cb netmgr/udp.c:1057
#11 uv__udp_recvmsg /usr/src/libuv-v1.44.1/src/unix/udp.c:303
#12 isc__trampoline_run lib/isc/trampoline.c:189
This commit is contained in:
@@ -937,8 +937,6 @@ clean_finds_at_name(dns_adbname_t *name, dns_adbstatus_t astat,
|
||||
|
||||
INSIST(!FIND_EVENTSENT(find));
|
||||
|
||||
find->result_v4 = find_err_map[name->fetch_err];
|
||||
find->result_v6 = find_err_map[name->fetch6_err];
|
||||
find->status = astat;
|
||||
|
||||
DP(DEF_LEVEL, "cfan: sending find %p to caller", find);
|
||||
@@ -2278,8 +2276,6 @@ static void
|
||||
find_sendevent(dns_adbfind_t *find) {
|
||||
if (!FIND_EVENTSENT(find)) {
|
||||
find->status = DNS_ADB_CANCELED;
|
||||
find->result_v4 = ISC_R_CANCELED;
|
||||
find->result_v6 = ISC_R_CANCELED;
|
||||
|
||||
DP(DEF_LEVEL, "sending find %p to caller", find);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user