Acquire qpmulti->mutex during destruction
Thread sanitizer warns that parts of the qp-trie are accessed both with and without the mutex; the unlocked accesses happen during destruction, so they should be benign, but there's no harm locking anyway to convince tsan it is clean. Also, ensure .tsan-suppress and .tsan-suppress-extra are in sync.
This commit is contained in:
@@ -3,5 +3,5 @@ called_from_lib:libfstrm.so
|
||||
called_from_lib:libdummyrpz.so
|
||||
# be more selective with liburcu
|
||||
race:rcu_barrier
|
||||
race:rcu_memb_barrier
|
||||
race:rcu_*_barrier
|
||||
thread:*
|
||||
|
||||
12
lib/dns/qp.c
12
lib/dns/qp.c
@@ -1431,14 +1431,22 @@ static void
|
||||
qpmulti_destroy_cb(struct rcu_head *arg) {
|
||||
qp_rcuctx_t *rcuctx = isc_urcu_container(arg, qp_rcuctx_t, rcu_head);
|
||||
REQUIRE(QPRCU_VALID(rcuctx));
|
||||
/* only nonzero for reclaim_chunks_cb() */
|
||||
REQUIRE(rcuctx->count == 0);
|
||||
|
||||
dns_qpmulti_t *multi = rcuctx->multi;
|
||||
REQUIRE(QPMULTI_VALID(multi));
|
||||
|
||||
/* reassure thread sanitizer */
|
||||
LOCK(&multi->mutex);
|
||||
|
||||
dns_qp_t *qp = &multi->writer;
|
||||
REQUIRE(QP_VALID(qp));
|
||||
|
||||
REQUIRE(rcuctx->count == 0);
|
||||
|
||||
destroy_guts(qp);
|
||||
|
||||
UNLOCK(&multi->mutex);
|
||||
|
||||
isc_mutex_destroy(&multi->mutex);
|
||||
isc_mem_putanddetach(&rcuctx->mctx, rcuctx,
|
||||
STRUCT_FLEX_SIZE(rcuctx, chunk, rcuctx->count));
|
||||
|
||||
Reference in New Issue
Block a user