Lock access to control->symtab to prevent data race

    WARNING: ThreadSanitizer: data race
    Read of size 8 at 0x000000000001 by thread T1:
    #0 isccc_symtab_foreach lib/isccc/symtab.c:277:14
    #1 isccc_cc_cleansymtab lib/isccc/cc.c:954:2
    #2 control_recvmessage bin/named/controlconf.c:477:2
    #3 recv_data lib/isccc/ccmsg.c:110:2
    #4 read_cb lib/isc/netmgr/tcp.c:769:4
    #5 <null> <null>

    Previous write of size 8 at 0x000000000001 by thread T2:
    #0 isccc_symtab_define lib/isccc/symtab.c:242:2
    #1 isccc_cc_checkdup lib/isccc/cc.c:1026:11
    #2 control_recvmessage bin/named/controlconf.c:478:11
    #3 recv_data lib/isccc/ccmsg.c:110:2
    #4 read_cb lib/isc/netmgr/tcp.c:769:4
    #5 <null> <null>

    Location is heap block of size 190352 at 0x000000000011 allocated by main thread:
    #0 malloc <null>
    #1 isccc_symtab_create lib/isccc/symtab.c:76:18
    #2 isccc_cc_createsymtab lib/isccc/cc.c:948:10
    #3 named_controls_create bin/named/controlconf.c:1483:11
    #4 named_server_create bin/named/server.c:10057:2
    #5 setup bin/named/main.c:1256:2
    #6 main bin/named/main.c:1523:2

    Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_nm_start lib/isc/netmgr/netmgr.c:215:3
    #3 create_managers bin/named/main.c:909:15
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    Thread T2 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_nm_start lib/isc/netmgr/netmgr.c:215:3
    #3 create_managers bin/named/main.c:909:15
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    SUMMARY: ThreadSanitizer: data race lib/isccc/symtab.c:277:14 in isccc_symtab_foreach

(cherry picked from commit 0450acc1)
79 jobs for !4138 with 2131-tsan-data-race-in-accessing-controls-symtab-v9_16 in 27 minutes and 29 seconds (queued for 17 seconds)
latest detached
Status Job ID Name Coverage
  Precheck
passed #1162562
amd64 linux
autoreconf

00:00:15

passed #1162564
amd64 linux
clang-format

00:00:17

passed #1162565
amd64 linux
coccinelle

00:02:59

passed #1162566
amd64 linux
danger

00:00:13

passed #1162563
amd64 linux
misc

00:00:12

 
  Build
passed #1162580
amd64 linux
clang:asan

00:03:49

passed #1162584
amd64 linux
clang:buster:amd64

00:06:09

passed #1162587
amd64 libvirt
clang:freebsd11:amd64

00:01:49

passed #1162588
amd64 libvirt
clang:freebsd12:amd64

00:02:35

passed #1162589
amd64 libvirt
clang:openbsd:amd64

00:04:07

passed #1162582
amd64 linux
clang:tsan

00:02:31

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

00:01:30

passed #1162579
amd64 linux
gcc:asan

00:03:25

passed #1162572
amd64 linux
gcc:buster:amd64

00:01:27

passed #1162568
amd64 linux
gcc:centos6:amd64

00:01:21

passed #1162569
amd64 linux
gcc:centos7:amd64

00:01:28

passed #1162570
amd64 linux
gcc:centos8:amd64

00:01:38

passed #1162578
amd64 linux
gcc:focal:amd64

00:02:08

passed #1162583
amd64 linux
gcc:mutexatomics

00:01:30

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

00:01:25

passed #1162573
amd64 linux
gcc:sid:amd64

00:02:26

passed #1162575
i386 linux
gcc:sid:i386

00:01:29

passed #1162585
amd64 linux
gcc:softhsm2.4

00:06:22

passed #1162586
amd64 linux
gcc:softhsm2.6

00:01:36

passed #1162571
amd64 linux
gcc:stretch:amd64

00:02:12

passed #1162581
amd64 linux
gcc:tsan

00:02:01

passed #1162576
amd64 linux
gcc:tumbleweed:amd64

00:01:31

passed #1162577
amd64 linux
gcc:xenial:amd64

00:02:30

passed #1162591
amd64 windows
msvc:windows:amd64

00:00:59

passed #1162590
amd64 linux
nolibtool:sid:amd64

00:02:44

 
  Unit
passed #1162604
amd64 linux
unit:clang:asan

00:05:34

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

00:00:36

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

00:01:02

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

00:01:08

passed #1162606
amd64 linux
unit:clang:tsan

00:03:58

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

00:00:45

passed #1162603
amd64 linux
unit:gcc:asan

00:06:23

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

00:06:49

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

00:00:42

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

00:00:39

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

00:00:42

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

00:00:38

passed #1162607
amd64 linux
unit:gcc:mutexatomics

00:03:46

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

00:01:33

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

00:01:03

passed #1162609
amd64 linux
unit:gcc:softhsm2.4

00:00:36

passed #1162610
amd64 linux
unit:gcc:softhsm2.6

00:00:40

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

00:01:21

passed #1162605
amd64 linux
unit:gcc:tsan

00:08:43

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

00:01:02

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

00:00:43

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

00:01:29

 
  System
passed #1162626
amd64 linux
system:clang:asan

00:16:43

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

00:11:06

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

00:10:16

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

00:10:25

failed #1162628
amd64 linux allowed to fail
system:clang:tsan

00:20:26

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

00:12:10

passed #1162625
amd64 linux
system:gcc:asan

00:15:16

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

00:14:56

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

00:11:33

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

00:11:29

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

00:11:37

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

00:12:36

passed #1162629
amd64 linux
system:gcc:mutexatomics

00:16:01

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

00:10:58

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

00:10:28

passed #1162631
amd64 linux
system:gcc:softhsm2.4

00:10:57

passed #1162632
amd64 linux
system:gcc:softhsm2.6

00:11:01

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

00:11:42

failed #1162627
amd64 linux allowed to fail
system:gcc:tsan

00:20:25

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

00:11:33

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

00:10:06

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

00:12:43

 
  Docs
passed #1162636
amd64 linux
docs

00:02:07

 
  Postcheck
passed #1162640
amd64 linux
cppcheck

00:00:22

passed #1162637
amd64 linux
flake8

00:00:18

passed #1162638
amd64 linux
pylint

00:00:22

passed #1162639
amd64 linux
scan-build

00:09:11

 
Name Stage Failure
failed
system:clang:tsan System
make: *** [Makefile:491: test] Error 1
Running after_script
Running after script...
$ find bin -name 'tsan.*' -exec python3 util/parse_tsan.py {} \;
Uploading artifacts for failed job
Uploading artifacts...
untracked: found 9734 files

Uploading artifacts as "archive" to coordinator... ok
id=1162628 responseStatus=201 Created token=pXhP8Px7
ERROR: Job failed: exit code 1
failed
system:gcc:tsan System
make: *** [Makefile:491: test] Error 1
Running after_script
Running after script...
$ find bin -name 'tsan.*' -exec python3 util/parse_tsan.py {} \;
Uploading artifacts for failed job
Uploading artifacts...
untracked: found 9634 files

Uploading artifacts as "archive" to coordinator... ok
id=1162627 responseStatus=201 Created token=jUHsmzfr
ERROR: Job failed: exit code 1