From 17b71b05e5f6ceec097028313a95b2fe9dad44f1 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Wed, 6 Nov 2019 11:15:30 +0100 Subject: [PATCH] Avoid mthread race when using the set of rootNSZones. --- pdns/reczones.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pdns/reczones.cc b/pdns/reczones.cc index c811b0c989..cade82750a 100644 --- a/pdns/reczones.cc +++ b/pdns/reczones.cc @@ -127,7 +127,11 @@ void primeRootNSZones(bool dnssecmode) sr.setDoDNSSEC(true); sr.setDNSSECValidationRequested(true); } - for (const auto & qname: t_rootNSZones) { + + // beginResolve() can yield to another mthread that could trigger t_rootNSZones updates, + // so make a local copy + set copy(t_rootNSZones); + for (const auto & qname: copy) { t_RC->doWipeCache(qname, false, QType::NS); vector ret; sr.beginResolve(qname, QType(QType::NS), QClass::IN, ret); -- 2.47.2