Commit 289f143d authored by Ondřej Surý's avatar Ondřej Surý

Merge branch '1416-threadsanitizer-data-race-resolver-c-3384-in-findname' into 'master'

Resolve "ThreadSanitizer: data race resolver.c:3384 in findname"

Closes #1416

See merge request !2668
parents cf8e034b 9ca6ad63
Pipeline #26828 passed with stages
in 1 minute and 38 seconds
...@@ -359,8 +359,8 @@ struct fetchctx { ...@@ -359,8 +359,8 @@ struct fetchctx {
/*% /*%
* Random numbers to use for mixing up server addresses. * Random numbers to use for mixing up server addresses.
*/ */
uint32_t rand_buf; uint32_t rand_buf;
uint32_t rand_bits; uint32_t rand_bits;
/*% /*%
* Fetch-local statistics for detailed logging. * Fetch-local statistics for detailed logging.
...@@ -370,7 +370,7 @@ struct fetchctx { ...@@ -370,7 +370,7 @@ struct fetchctx {
int exitline; int exitline;
isc_time_t start; isc_time_t start;
uint64_t duration; uint64_t duration;
bool logged; bool logged;
unsigned int querysent; unsigned int querysent;
unsigned int referrals; unsigned int referrals;
unsigned int lamecount; unsigned int lamecount;
...@@ -380,7 +380,7 @@ struct fetchctx { ...@@ -380,7 +380,7 @@ struct fetchctx {
unsigned int adberr; unsigned int adberr;
unsigned int findfail; unsigned int findfail;
unsigned int valfail; unsigned int valfail;
bool timeout; bool timeout;
dns_adbaddrinfo_t *addrinfo; dns_adbaddrinfo_t *addrinfo;
const isc_sockaddr_t *client; const isc_sockaddr_t *client;
dns_messageid_t id; dns_messageid_t id;
...@@ -4692,8 +4692,6 @@ fctx_join(fetchctx_t *fctx, isc_task_t *task, const isc_sockaddr_t *client, ...@@ -4692,8 +4692,6 @@ fctx_join(fetchctx_t *fctx, isc_task_t *task, const isc_sockaddr_t *client,
fctx_increference(fctx); fctx_increference(fctx);
fctx->client = client;
fetch->magic = DNS_FETCH_MAGIC; fetch->magic = DNS_FETCH_MAGIC;
fetch->private = fctx; fetch->private = fctx;
...@@ -4717,8 +4715,9 @@ log_ns_ttl(fetchctx_t *fctx, const char *where) { ...@@ -4717,8 +4715,9 @@ log_ns_ttl(fetchctx_t *fctx, const char *where) {
static isc_result_t static isc_result_t
fctx_create(dns_resolver_t *res, const dns_name_t *name, dns_rdatatype_t type, fctx_create(dns_resolver_t *res, const dns_name_t *name, dns_rdatatype_t type,
const dns_name_t *domain, dns_rdataset_t *nameservers, const dns_name_t *domain, dns_rdataset_t *nameservers,
unsigned int options, unsigned int bucketnum, unsigned int depth, const isc_sockaddr_t *client, unsigned int options,
isc_counter_t *qc, fetchctx_t **fctxp) unsigned int bucketnum, unsigned int depth, isc_counter_t *qc,
fetchctx_t **fctxp)
{ {
fetchctx_t *fctx; fetchctx_t *fctx;
isc_result_t result; isc_result_t result;
...@@ -4830,7 +4829,7 @@ fctx_create(dns_resolver_t *res, const dns_name_t *name, dns_rdatatype_t type, ...@@ -4830,7 +4829,7 @@ fctx_create(dns_resolver_t *res, const dns_name_t *name, dns_rdatatype_t type,
fctx->rand_bits = 0; fctx->rand_bits = 0;
fctx->timeout = false; fctx->timeout = false;
fctx->addrinfo = NULL; fctx->addrinfo = NULL;
fctx->client = NULL; fctx->client = client;
fctx->ns_ttl = 0; fctx->ns_ttl = 0;
fctx->ns_ttl_ok = false; fctx->ns_ttl_ok = false;
...@@ -10569,7 +10568,8 @@ dns_resolver_createfetch(dns_resolver_t *res, const dns_name_t *name, ...@@ -10569,7 +10568,8 @@ dns_resolver_createfetch(dns_resolver_t *res, const dns_name_t *name,
if (fctx == NULL) { if (fctx == NULL) {
result = fctx_create(res, name, type, domain, nameservers, result = fctx_create(res, name, type, domain, nameservers,
options, bucketnum, depth, qc, &fctx); client, options, bucketnum, depth, qc,
&fctx);
if (result != ISC_R_SUCCESS) if (result != ISC_R_SUCCESS)
goto unlock; goto unlock;
new_fctx = true; new_fctx = true;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment