1
0
mirror of https://github.com/golang/go synced 2024-09-29 14:24:32 -06:00
go/misc/cgo/test
Andrew G. Morgan f2e58c6d42 syscall: improve TestSetuidEtc() /proc/ parsing against races
TestSetuidEtc() was failing sporadically on linux-ppc64. From the
three https://build.golang.org/ logs, it looked like the logged
errors could be associated with threads dying, but proc reads
were, in some way, racing with their demise.

Exploring ways to increase thread demise, revealed that races
of this type can happen on non-ppc64 systems, and that
os.IsNotExist(err) was not a sufficient error condition test
for a thread's status file disappearing. This change includes a
fix for that to.

The actual issue on linux-ppc64 appears to be tied to PID reaping
and reuse latency on whatever the build test environment is for
linux-ppc64-buildlet. I suspect this can happen on any linux
system, however, especially where the container has a limited PID
range.

The fix for this, limited to the test (the runtime syscall support
is unchanged), is to confirm that the Pid for the interrogated
thread's /proc/<TID>/status file confirms that it is still
associated with the test-process' PID.

linux-ppc64-buildlet:
  go/bin/go test syscall -run=TestSetuidEtc -count=10000
  ok      syscall 104.285s

Fixes #42462

Change-Id: I55c84ab8361003570a405fa52ffec4949bf91113
Reviewed-on: https://go-review.googlesource.com/c/go/+/268717
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Tobias Klauser <tobias.klauser@gmail.com>
2020-11-11 20:49:53 +00:00
..
testdata cmd/dist,cmd/go,runtime: add support for cgo on linux/riscv64 2020-11-03 12:59:51 +00:00
backdoor.go
buildid_linux.go
callback_c_gc.c
callback_c_gccgo.c
callback_c.c
callback.go runtime,cmd/cgo: simplify C -> Go call path 2020-10-26 14:50:32 +00:00
cgo_linux_test.go syscall: support POSIX semantics for Linux syscalls 2020-10-23 20:53:14 +00:00
cgo_stubs_android_test.go misc/cgo/test: consolidate tests into fewer cgo source files 2019-05-22 12:52:33 +00:00
cgo_test.go misc/cgo/test: test C.enum_* 2020-10-27 18:13:59 +00:00
cgo_thread_lock.go
cgo_unix_test.go
cthread_unix.c cmd/dist, misc/cgo: enable tests for aix/ppc64 2019-03-20 14:38:44 +00:00
cthread_windows.c
issue1435.go syscall: improve TestSetuidEtc() /proc/ parsing against races 2020-11-11 20:49:53 +00:00
issue4029.c cmd/link: support cgo internal/linking on darwin/arm64 2020-10-20 02:25:52 +00:00
issue4029.go cmd/link: support cgo internal/linking on darwin/arm64 2020-10-20 02:25:52 +00:00
issue4029w.go cmd/link: support cgo internal/linking on darwin/arm64 2020-10-20 02:25:52 +00:00
issue4273.c
issue4273b.c
issue4339.c
issue4339.h
issue5548_c.c
issue5740a.c
issue5740b.c
issue6833_c.c
issue6907export_c.c
issue6997_linux.c
issue6997_linux.go
issue7234_test.go
issue8148.go
issue8331.h
issue8517_windows.c
issue8517_windows.go
issue8517.go
issue8694.go
issue8811.c
issue18146.go all: add GOOS=ios 2020-09-23 18:12:59 +00:00
issue20910.c
issue21897.go misc/cgo/test: re-enable darwin cgo tests in race mode 2020-01-10 10:04:49 +00:00
issue21897b.go misc/cgo/test: re-enable darwin cgo tests in race mode 2020-01-10 10:04:49 +00:00
issue31891.c cmd/cgo: build unique C type cache keys from parent names 2019-10-05 00:16:04 +00:00
overlaydir_test.go misc: remove use of relative directories in overlayDir functions 2019-11-25 16:26:15 +00:00
pkg_test.go all: add GOOS=ios 2020-09-23 18:12:59 +00:00
setgid_linux.go
sigaltstack.go runtime: use sigaltstack on macOS/ARM64 2020-10-06 21:25:42 +00:00
sigprocmask.c
sigprocmask.go
test_unix.go misc/cgo/test: consolidate tests into fewer cgo source files 2019-05-22 12:52:33 +00:00
test_windows.go misc/cgo/test: consolidate tests into fewer cgo source files 2019-05-22 12:52:33 +00:00
test.go misc/cgo/test: test C.enum_* 2020-10-27 18:13:59 +00:00
testx.go all: add GOOS=ios 2020-09-23 18:12:59 +00:00