From 7cb1692948e7bc1fa8c95a990205cf8f4108538a Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Mon, 19 Jan 2026 12:00:50 +0100 Subject: [PATCH] rec: followup to 16662: more cases of tsan annotations Signed-off-by: Otto Moerbeek --- pdns/recursordist/pdns_recursor.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pdns/recursordist/pdns_recursor.cc b/pdns/recursordist/pdns_recursor.cc index b0f2757d3a..df1be5b6a4 100644 --- a/pdns/recursordist/pdns_recursor.cc +++ b/pdns/recursordist/pdns_recursor.cc @@ -2124,7 +2124,10 @@ void requestWipeCaches(const DNSName& canon) ThreadMSG* tmsg = new ThreadMSG(); // NOLINT: pointer owner tmsg->func = [=] { return pleaseWipeCaches(canon, true, 0xffff); }; tmsg->wantAnswer = false; + __tsan_release(tmsg); + if (write(RecThreadInfo::info(0).getPipes().writeToThread, &tmsg, sizeof(tmsg)) != sizeof(tmsg)) { // NOLINT: correct sizeof + __tsan_acquire(tmsg); delete tmsg; // NOLINT: pointer owner unixDie("write to thread pipe returned wrong size or error"); @@ -2889,6 +2892,7 @@ void distributeAsyncFunction(const string& packet, const pipefunc_t& func) ThreadMSG* tmsg = new ThreadMSG(); // NOLINT: pointer ownership tmsg->func = func; tmsg->wantAnswer = false; + __tsan_release(tmsg); if (!trySendingQueryToWorker(target, tmsg)) { /* if this function failed but did not raise an exception, it means that the pipe @@ -2900,6 +2904,7 @@ void distributeAsyncFunction(const string& packet, const pipefunc_t& func) if (!trySendingQueryToWorker(newTarget, tmsg)) { t_Counters.at(rec::Counter::queryPipeFullDrops)++; + __tsan_acquire(tmsg); delete tmsg; // NOLINT: pointer ownership } } -- 2.47.3