Lock zone before calling zone_namerd_tostr()

    WARNING: ThreadSanitizer: data race
    Read of size 8 at 0x000000000001 by thread T1:
    #0 inline_raw lib/dns/zone.c:1375
    #1 zone_namerd_tostr lib/dns/zone.c:15316
    #2 dns_zone_name lib/dns/zone.c:15391
    #3 xfrin_log lib/dns/xfrin.c:1605
    #4 xfrin_destroy lib/dns/xfrin.c:1477
    #5 dns_xfrin_detach lib/dns/xfrin.c:739
    #6 xfrin_connect_done lib/dns/xfrin.c:970
    #7 tcpdnsconnect_cb netmgr/tcpdns.c:786
    #8 tcp_connect_cb netmgr/tcp.c:292
    #9 <null> <null>
    #10 <null> <null>

    Previous write of size 8 at 0x000000000001 by thread T2 (mutexes: write M1):
    #0 zone_shutdown lib/dns/zone.c:14462
    #1 dispatch lib/isc/task.c:1152
    #2 run lib/isc/task.c:1344
    #3 <null> <null>

    Location is heap block of size 2769 at 0x000000000013 allocated by thread T3:
    #0 malloc <null>
    #1 default_memalloc lib/isc/mem.c:713
    #2 mem_get lib/isc/mem.c:622
    #3 mem_allocateunlocked lib/isc/mem.c:1268
    #4 isc___mem_allocate lib/isc/mem.c:1288
    #5 isc__mem_allocate lib/isc/mem.c:2453
    #6 isc___mem_get lib/isc/mem.c:1037
    #7 isc__mem_get lib/isc/mem.c:2432
    #8 dns_zone_create lib/dns/zone.c:984
    #9 configure_zone bin/named/server.c:6502
    #10 do_addzone bin/named/server.c:13391
    #11 named_server_changezone bin/named/server.c:13788
    #12 named_control_docommand bin/named/control.c:207
    #13 control_command bin/named/controlconf.c:392
    #14 dispatch lib/isc/task.c:1152
    #15 run lib/isc/task.c:1344
    #16 <null> <null>

(cherry picked from commit 84f43903)
83 jobs for !4378 with 2259-zone_namerd_tostr-called-w-o-lock-being-held-v9_11 in 37 minutes and 6 seconds (queued for 1 minute and 12 seconds)
detached
Status Job ID Name Coverage
  Precheck
passed #1286746
amd64 linux
autoreconf

00:00:16

passed #1286752
amd64 linux
clang-format

00:00:07

passed #1286755
amd64 linux
coccinelle

00:01:02

passed #1286758
amd64 linux
danger

00:00:14

passed #1286749
amd64 linux
misc

00:00:14

 
  Build
passed #1286804
amd64 linux
clang:asan

00:04:25

passed #1286819
amd64 linux
clang:buster:amd64

00:02:08

passed #1286825
amd64 libvirt
clang:freebsd11:amd64

00:01:52

passed #1286828
amd64 libvirt
clang:freebsd12:amd64

00:01:52

passed #1286831
amd64 libvirt
clang:openbsd:amd64

00:04:00

passed #1286809
amd64 linux
clang:tsan

00:02:29

passed #1286761
amd64 linux
gcc:alpine3.12:amd64

00:01:46

passed #1286801
amd64 linux
gcc:asan

00:03:31

passed #1286777
amd64 linux
gcc:buster:amd64

00:01:30

passed #1286764
amd64 linux
gcc:centos6:amd64

00:01:21

passed #1286767
amd64 linux
gcc:centos7:amd64

00:01:27

passed #1286770
amd64 linux
gcc:centos8:amd64

00:01:40

passed #1286792
amd64 linux
gcc:fedora33:amd64

00:01:43

passed #1286798
amd64 linux
gcc:focal:amd64

00:01:37

passed #1286813
amd64 linux
gcc:mutexatomics

00:01:52

passed #1286816
amd64 linux
gcc:noatomics

00:02:05

passed #1286783
amd64 linux
gcc:out-of-tree

00:01:38

passed #1286822
amd64 linux
gcc:pkcs11

00:01:44

passed #1286780
amd64 linux
gcc:sid:amd64

00:02:25

passed #1286785
i386 linux
gcc:sid:i386

00:01:47

passed #1286774
amd64 linux
gcc:stretch:amd64

00:01:50

passed #1286807
amd64 linux
gcc:tsan

00:02:05

passed #1286789
amd64 linux
gcc:tumbleweed:amd64

00:01:42

passed #1286795
amd64 linux
gcc:xenial:amd64

00:01:48

passed #1286837
amd64 windows
msvc:windows:amd64

00:01:08

passed #1286834
amd64 linux
nolibtool:sid:amd64

00:02:14

 
  Unit
passed #1286880
amd64 linux
unit:clang:asan

00:01:15

passed #1286894
amd64 linux
unit:clang:buster:amd64

00:00:32

passed #1286900
amd64 libvirt
unit:clang:freebsd11:amd64

00:01:07

passed #1286903
amd64 libvirt
unit:clang:freebsd12:amd64

00:00:54

passed #1286887
amd64 linux
unit:clang:tsan

00:04:14

passed #1286840
amd64 linux
unit:gcc:alpine3.12:amd64

00:00:35

passed #1286877
amd64 linux
unit:gcc:asan

00:01:18

passed #1286855
amd64 linux
unit:gcc:buster:amd64

00:01:08

passed #1286843
amd64 linux
unit:gcc:centos6:amd64

00:00:43

passed #1286847
amd64 linux
unit:gcc:centos7:amd64

00:00:35

passed #1286850
amd64 linux
unit:gcc:centos8:amd64

00:00:34

passed #1286867
amd64 linux
unit:gcc:fedora33:amd64

00:00:39

passed #1286874
amd64 linux
unit:gcc:focal:amd64

00:00:36

passed #1286888
amd64 linux
unit:gcc:mutexatomics

00:00:32

passed #1286891
amd64 linux
unit:gcc:noatomics

00:00:38

passed #1286897
amd64 linux
unit:gcc:pkcs11

00:00:42

passed #1286858
amd64 linux
unit:gcc:sid:amd64

00:00:34

passed #1286862
i386 linux
unit:gcc:sid:i386

00:00:31

passed #1286854
amd64 linux
unit:gcc:stretch:amd64

00:00:35

passed #1286883
amd64 linux
unit:gcc:tsan

00:05:01

passed #1286864
amd64 linux
unit:gcc:tumbleweed:amd64

00:00:38

passed #1286871
amd64 linux
unit:gcc:xenial:amd64

00:00:41

passed #1286906
amd64 linux
unit:nolibtool:sid:amd64

00:00:46

 
  System
passed #1286950
amd64 linux
system:clang:asan

00:09:09

passed #1286963
amd64 linux
system:clang:buster:amd64

00:07:37

passed #1286967
amd64 libvirt
system:clang:freebsd11:amd64

00:08:21

passed #1286969
amd64 libvirt
system:clang:freebsd12:amd64

00:08:13

passed #1286956
amd64 linux
system:clang:tsan

00:11:30

passed #1286909
amd64 linux
system:gcc:alpine3.12:amd64

00:07:23

passed #1286947
amd64 linux
system:gcc:asan

00:09:18

passed #1286925
amd64 linux
system:gcc:buster:amd64

00:08:08

passed #1286912
amd64 linux
system:gcc:centos6:amd64

00:07:17

passed #1286916
amd64 linux
system:gcc:centos7:amd64

00:07:22

passed #1286918
amd64 linux
system:gcc:centos8:amd64

00:07:13

passed #1286937
amd64 linux
system:gcc:fedora33:amd64

00:07:12

passed #1286944
amd64 linux
system:gcc:focal:amd64

00:07:11

passed #1286959
amd64 linux
system:gcc:mutexatomics

00:07:15

passed #1286961
amd64 linux
system:gcc:noatomics

00:07:23

passed #1286964
amd64 linux
system:gcc:pkcs11

00:07:53

passed #1286929
amd64 linux
system:gcc:sid:amd64

00:07:03

passed #1286932
i386 linux
system:gcc:sid:i386

00:06:44

passed #1286922
amd64 linux
system:gcc:stretch:amd64

00:07:21

passed #1286953
amd64 linux
system:gcc:tsan

00:12:36

passed #1286934
amd64 linux
system:gcc:tumbleweed:amd64

00:07:02

passed #1286941
amd64 linux
system:gcc:xenial:amd64

00:06:46

passed #1286970
amd64 linux
system:nolibtool:sid:amd64

00:07:11

 
  Docs
passed #1286972
amd64 linux
docs

00:00:28

 
  Postcheck
passed #1286981
amd64 linux
cppcheck

00:00:26

passed #1286974
amd64 linux
flake8

00:00:21

passed #1286982
amd64 linux
gcov

00:00:35

74.0%
passed #1286976
amd64 linux
pylint

00:00:22

passed #1286978
amd64 linux
scan-build

00:08:33