]> Cypherpunks repositories - gostls13.git/commit
syscall: handle undefined r2 value on linux-ppc64x
authorAndrew G. Morgan <agm@google.com>
Wed, 28 Oct 2020 20:35:57 +0000 (13:35 -0700)
committerIan Lance Taylor <iant@golang.org>
Thu, 29 Oct 2020 17:53:57 +0000 (17:53 +0000)
commit3a819e8998af1db3bdd34eb2ab059a3c534c6def
tree8fd6d218b9b85f82dab1ada0c9ca9699ba0ee6b0
parent4fb429138881e3fe171e4c2e958ed0da26ddfd9c
syscall: handle undefined r2 value on linux-ppc64x

This change fixes two failng tests on linux-ppc64x:

- TestAllThreadsSyscall() exposed a real bug in the ppc64x support:
  - It turns out that the r2 syscall return value is not defined
    on all architectures. Notably linux-ppc64x so address that by
    introducing a private architectural constant in the syscall
    package, archHonorsR2: true if r2 has a determanistic value.

- TestSetuidEtc() was sensitive to /proc/<PID>/status content:
  - The amount of padding space has changed with kernel vintage.
  - Stress testing revealed a race with /proc files disappearing.

Fixes #42178

Change-Id: Ie6fc0b8f2f94a409ac0e5756e73bfce113274709
Reviewed-on: https://go-review.googlesource.com/c/go/+/266202
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
src/syscall/syscall_linux.go
src/syscall/syscall_linux_386.go
src/syscall/syscall_linux_amd64.go
src/syscall/syscall_linux_arm.go
src/syscall/syscall_linux_arm64.go
src/syscall/syscall_linux_mips64x.go
src/syscall/syscall_linux_mipsx.go
src/syscall/syscall_linux_ppc64x.go
src/syscall/syscall_linux_riscv64.go
src/syscall/syscall_linux_s390x.go
src/syscall/syscall_linux_test.go