Handle libuv calling epoll_ctl() after close().

TSAN errors are reported on epoll_ctl()/dup().  Add a lock around
uv_close() call and uv_accept() calls so that references to the
file descriptor being closed are cleaned up before accept()/dup()
return the same descriptor.
74 jobs for !4185 with 2161-threadsanitizer-data-race-in-dup in 21 minutes (queued for 7 seconds)
latest detached
Status Job ID Name Coverage
  Autoconf
passed #1192960
amd64 linux
autoreconf

00:00:16

 
  Precheck
passed #1192962
amd64 linux
clang-format

00:00:18

passed #1192963
amd64 linux
coccinelle

00:03:46

passed #1192964
amd64 linux
danger

00:00:12

passed #1192961
amd64 linux
misc

00:00:12

passed #1192965
amd64 linux
tarball-create

00:01:18

 
  Build
passed #1192978
amd64 linux
clang:asan

00:01:58

passed #1192982
amd64 linux
clang:buster:amd64

00:00:59

passed #1192985
amd64 libvirt
clang:freebsd11:amd64

00:01:10

passed #1192986
amd64 libvirt
clang:freebsd12:amd64

00:01:06

passed #1192987
amd64 libvirt
clang:openbsd:amd64

00:02:18

passed #1192980
amd64 linux
clang:tsan

00:01:08

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

00:00:52

passed #1192977
amd64 linux
gcc:asan

00:01:30

passed #1192970
amd64 linux
gcc:buster:amd64

00:00:51

passed #1192967
amd64 linux
gcc:centos7:amd64

00:00:44

passed #1192968
amd64 linux
gcc:centos8:amd64

00:00:48

passed #1192976
amd64 linux
gcc:focal:amd64

00:00:47

passed #1192981
amd64 linux
gcc:mutexatomics

00:00:49

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

00:00:53

passed #1192971
amd64 linux
gcc:sid:amd64

00:00:58

passed #1192973
i386 linux
gcc:sid:i386

00:00:50

passed #1192983
amd64 linux
gcc:softhsm2.4

00:00:51

passed #1192984
amd64 linux
gcc:softhsm2.6

00:00:52

passed #1192969
amd64 linux
gcc:stretch:amd64

00:00:56

passed #1192979
amd64 linux
gcc:tsan

00:01:02

passed #1192974
amd64 linux
gcc:tumbleweed:amd64

00:00:48

passed #1192975
amd64 linux
gcc:xenial:amd64

00:00:47

passed #1192988
amd64 windows
msvc:windows:amd64

00:00:42

 
  Unit
passed #1193000
amd64 linux
unit:clang:asan

00:01:16

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

00:00:58

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

00:01:18

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

00:01:17

passed #1193002
amd64 linux
unit:clang:tsan

00:03:09

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

00:01:02

passed #1192999
amd64 linux
unit:gcc:asan

00:01:24

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

00:01:02

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

00:00:59

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

00:01:00

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

00:00:56

passed #1193003
amd64 linux
unit:gcc:mutexatomics

00:00:57

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

00:00:57

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

00:00:59

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

00:00:56

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

00:00:58

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

00:00:57

passed #1193001
amd64 linux
unit:gcc:tsan

00:04:12

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

00:00:53

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

00:00:58

 
  System
passed #1193020
amd64 linux
system:clang:asan

00:12:17

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

00:10:41

failed #1193027
amd64 libvirt
system:clang:freebsd11:amd64

00:10:57

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

00:10:14

passed #1193022
amd64 linux
system:clang:tsan

00:13:37

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

00:11:24

passed #1193019
amd64 linux
system:gcc:asan

00:12:26

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

00:10:20

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

00:11:04

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

00:11:43

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

00:11:20

passed #1193023
amd64 linux
system:gcc:mutexatomics

00:10:09

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

00:10:01

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

00:11:22

failed #1193025
amd64 linux
system:gcc:softhsm2.4

00:11:15

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

00:11:20

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

00:11:21

passed #1193021
amd64 linux
system:gcc:tsan

00:14:00

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

00:10:59

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

00:10:58

 
  Docs
passed #1193029
amd64 linux
docs

00:00:33

 
  Postcheck
passed #1193033
amd64 linux
cppcheck

00:00:45

passed #1193030
amd64 linux
flake8

00:00:20

passed #1193031
amd64 linux
pylint

00:00:23

passed #1193032
amd64 linux
scan-build

00:03:54

 
Name Stage Failure
failed
system:gcc:softhsm2.4 System
FAIL autosign (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 2018 files

Uploading artifacts as "archive" to coordinator... ok
id=1193025 responseStatus=201 Created token=syUpvXBW
Cleaning up file based variables
ERROR: Job failed: exit code 1
failed
system:clang:freebsd11:amd64 System
$ test -n "${OUT_OF_TREE_WORKSPACE}" && mv "${OUT_OF_TREE_WORKSPACE}" "${CI_PROJECT_DIR}"
Uploading artifacts for failed job
Uploading artifacts...
Runtime platform
arch=amd64 os=freebsd pid=48284 revision=86ad88ea version=13.3.0
untracked: found 1517 files

Uploading artifacts as "archive" to coordinator... ok
id=1193027 responseStatus=201 Created token=sgotxR6T
Cleaning up file based variables
Unsupported run stage 'cleanup_file_variables'
ERROR: Job failed: exit status 1