Hold qid->lock when calling deref_portentry() as

socket_search() need portentry to be unchanging.

    WARNING: ThreadSanitizer: data race
    Write of size 8 at 0x000000000001 by thread T1 (mutexes: write M1):
    #0 deref_portentry lib/dns/dispatch.c:630
    #1 deactivate_dispsocket lib/dns/dispatch.c:861
    #2 udp_recv lib/dns/dispatch.c:1105
    #3 udp_exrecv lib/dns/dispatch.c:1028
    #4 dispatch lib/isc/task.c:1152
    #5 run lib/isc/task.c:1344
    #6 <null> <null>

    Previous read of size 8 at 0x000000000001 by thread T2 (mutexes: write M1, write M2):
    #0 socket_search lib/dns/dispatch.c:661
    #1 get_dispsocket lib/dns/dispatch.c:744
    #2 dns_dispatch_addresponse lib/dns/dispatch.c:3120
    #3 resquery_send lib/dns/resolver.c:2467
    #4 fctx_query lib/dns/resolver.c:2217
    #5 fctx_try lib/dns/resolver.c:4245
    #6 fctx_timeout lib/dns/resolver.c:4570
    #7 dispatch lib/isc/task.c:1152
    #8 run lib/isc/task.c:1344
    #9 <null> <null>
76 jobs for !4286 with 2226-tsan-error-in-dispatch-c in 23 minutes and 54 seconds (queued for 23 seconds)
detached
Status Job ID Name Coverage
  Autoconf
passed #1245069
amd64 linux
autoreconf

00:00:16

 
  Precheck
passed #1245071
amd64 linux
clang-format

00:00:16

passed #1245072
amd64 linux
coccinelle

00:03:30

passed #1245073
amd64 linux
danger

00:00:13

passed #1245070
amd64 linux
misc

00:00:11

passed #1245074
amd64 linux
tarball-create

00:01:20

 
  Build
passed #1245087
amd64 linux
clang:asan

00:01:59

passed #1245091
amd64 linux
clang:buster:amd64

00:00:58

passed #1245094
amd64 libvirt
clang:freebsd11:amd64

00:01:07

passed #1245095
amd64 libvirt
clang:freebsd12:amd64

00:01:04

passed #1245096
amd64 libvirt
clang:openbsd:amd64

00:02:19

passed #1245089
amd64 linux
clang:tsan

00:01:08

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

00:00:59

passed #1245086
amd64 linux
gcc:asan

00:01:37

passed #1245079
amd64 linux
gcc:buster:amd64

00:00:46

passed #1245076
amd64 linux
gcc:centos7:amd64

00:00:57

passed #1245077
amd64 linux
gcc:centos8:amd64

00:00:45

passed #1245085
amd64 linux
gcc:focal:amd64

00:00:45

passed #1245090
amd64 linux
gcc:mutexatomics

00:00:48

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

00:00:53

passed #1245080
amd64 linux
gcc:sid:amd64

00:01:01

passed #1245082
i386 linux
gcc:sid:i386

00:00:47

passed #1245092
amd64 linux
gcc:softhsm2.4

00:00:44

passed #1245093
amd64 linux
gcc:softhsm2.6

00:00:49

passed #1245078
amd64 linux
gcc:stretch:amd64

00:01:02

passed #1245088
amd64 linux
gcc:tsan

00:01:00

passed #1245083
amd64 linux
gcc:tumbleweed:amd64

00:00:53

passed #1245084
amd64 linux
gcc:xenial:amd64

00:00:57

passed #1245097
amd64 windows
msvc:windows:amd64

00:01:59

 
  Unit
passed #1245109
amd64 linux
unit:clang:asan

00:01:21

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

00:00:56

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

00:01:26

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

00:01:17

passed #1245118
amd64 libvirt
unit:clang:openbsd:amd64

00:03:05

passed #1245111
amd64 linux
unit:clang:tsan

00:03:04

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

00:01:01

passed #1245108
amd64 linux
unit:gcc:asan

00:01:23

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

00:02:08

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

00:00:58

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

00:00:56

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

00:00:58

passed #1245112
amd64 linux
unit:gcc:mutexatomics

00:00:55

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

00:00:55

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

00:00:52

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

00:00:57

failed #1245115
amd64 linux
unit:gcc:softhsm2.6

00:01:02

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

00:00:59

passed #1245110
amd64 linux
unit:gcc:tsan

00:04:02

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

00:00:55

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

00:00:55

 
  System
passed #1245130
amd64 linux
system:clang:asan

00:12:20

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

00:11:10

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

00:10:45

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

00:10:18

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

00:14:33

failed #1245119
amd64 linux
system:gcc:alpine3.12:amd64

00:12:09

passed #1245129
amd64 linux
system:gcc:asan

00:13:03

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

00:12:33

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

00:11:38

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

00:11:38

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

00:11:37

passed #1245133
amd64 linux
system:gcc:mutexatomics

00:10:22

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

00:11:28

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

00:11:15

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

00:11:38

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

00:11:48

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

00:10:30

passed #1245131
amd64 linux
system:gcc:tsan

00:14:52

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

00:11:09

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

00:10:00

 
  Docs
passed #1245139
amd64 linux
docs

00:00:35

 
  Postcheck
passed #1245143
amd64 linux
cppcheck

00:00:42

passed #1245140
amd64 linux
flake8

00:00:19

passed #1245144
amd64 linux
gcov

00:00:32

77.0%
passed #1245141
amd64 linux
pylint

00:00:22

passed #1245142
amd64 linux
scan-build

00:04:32

 
Name Stage Failure
failed
system:clang:tsan System
FAIL legacy (exit status: 1)

$ find bin -name 'tsan.*' -exec python3 util/parse_tsan.py {} \;
Uploading artifacts for failed job
Uploading artifacts...
untracked: found 1558 files

Uploading artifacts as "archive" to coordinator... ok
id=1245132 responseStatus=201 Created token=cuqnxE37
Cleaning up file based variables
ERROR: Job failed: exit code 1
failed
system:gcc:alpine3.12:amd64 System
FAIL legacy (exit status: 1)

$ test -n "${OUT_OF_TREE_WORKSPACE}" && mv "${OUT_OF_TREE_WORKSPACE}" "${CI_PROJECT_DIR}"
Uploading artifacts for failed job
Uploading artifacts...
untracked: found 1578 files

Uploading artifacts as "archive" to coordinator... ok
id=1245119 responseStatus=201 Created token=qDqk8xC9
Cleaning up file based variables
ERROR: Job failed: exit code 1
failed
unit:gcc:softhsm2.6 Unit
make[1]: Leaving directory '/builds/isc-projects/bind9/fuzz'
make: *** [Makefile:649: unit-recursive] Error 1
make: Target 'unit' not remade because of errors.
Uploading artifacts for failed job
Uploading artifacts...
untracked: found 1680 files

Uploading artifacts as "archive" to coordinator... ok
id=1245115 responseStatus=201 Created token=zWXLyyrW
Cleaning up file based variables
ERROR: Job failed: exit code 1