Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/sys/unix: TestSysvSharedMemory consistently failing on multiple builders #48708

Closed
bcmills opened this issue Sep 30, 2021 · 5 comments
Closed
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker Soon This needs to be done soon. (regressions, serious bugs, outages)
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented Sep 30, 2021

TestSysvSharedMemory, added for #46084 in CL 327830, is consistently failing on several of the linux builders for less-common architectures:

--- FAIL: TestSysvSharedMemory (0.00s)
    sysvshm_unix_test.go:30: SysvShmGet: function not implemented
FAIL
FAIL	golang.org/x/sys/unix	0.571s

It isn't obvious to me whether we expect SysvShmGet to work on those platforms. If not, the test should call Skip on platforms / kernels on which it is not supported.

Since these builders are consistently failing (and thus not providing useful feedback about other changes), this fix needs to happen soon — either by fixing the test, adding skips, or reverting CL 327830 until someone has more time to fix it.

CC @tklauser @virtuald

greplogs --dashboard -md -l -e 'FAIL: TestSysvSharedMemory'

2021-09-30T14:19:18-969570c/04242ac/linux-ppc64le-buildlet
2021-09-30T14:19:18-969570c/04242ac/linux-ppc64le-power9osu
2021-09-30T14:19:18-969570c/04242ac/linux-s390x-ibm
2021-09-30T14:19:18-969570c/205640e/linux-mips64-rtrk
2021-09-30T14:19:18-969570c/205640e/linux-ppc64le-buildlet
2021-09-30T14:19:18-969570c/205640e/linux-ppc64le-power9osu
2021-09-30T14:19:18-969570c/205640e/linux-s390x-ibm
2021-09-30T14:19:18-969570c/6b0026a/linux-ppc64le-buildlet
2021-09-30T14:19:18-969570c/6b0026a/linux-ppc64le-power9osu
2021-09-30T14:19:18-969570c/6b0026a/linux-s390x-ibm
2021-09-30T14:19:18-969570c/7162c4c/linux-mips64le-mengzhuo
2021-09-30T14:19:18-969570c/7162c4c/linux-ppc64le-buildlet
2021-09-30T14:19:18-969570c/7162c4c/linux-ppc64le-power9osu
2021-09-30T14:19:18-969570c/7162c4c/linux-s390x-ibm
2021-09-30T14:19:18-969570c/7d57324/linux-ppc64le-buildlet
2021-09-30T14:19:18-969570c/7d57324/linux-ppc64le-power9osu
2021-09-30T14:19:18-969570c/7d57324/linux-s390x-ibm
2021-09-30T14:19:18-969570c/9112d29/linux-mips64-rtrk
2021-09-30T14:19:18-969570c/9112d29/linux-mips64le-mengzhuo
2021-09-30T14:19:18-969570c/9112d29/linux-ppc64le-buildlet
2021-09-30T14:19:18-969570c/9112d29/linux-ppc64le-power9osu
2021-09-30T14:19:18-969570c/9112d29/linux-s390x-ibm
2021-09-30T14:19:18-969570c/b043d23/linux-mips64le-mengzhuo
2021-09-30T14:19:18-969570c/b043d23/linux-ppc64le-buildlet
2021-09-30T14:19:18-969570c/b043d23/linux-ppc64le-power9osu
2021-09-30T14:19:18-969570c/b043d23/linux-s390x-ibm
2021-09-30T14:19:18-969570c/bd8009d/linux-mips64-rtrk
2021-09-30T14:19:18-969570c/bd8009d/linux-mips64le-mengzhuo
2021-09-30T14:19:18-969570c/bd8009d/linux-ppc64le-buildlet
2021-09-30T14:19:18-969570c/bd8009d/linux-ppc64le-power9osu
2021-09-30T14:19:18-969570c/bd8009d/linux-s390x-ibm
2021-09-30T14:19:18-969570c/d4aed7e/linux-mips64le-mengzhuo
2021-09-30T14:19:18-969570c/d4aed7e/linux-s390x-ibm

@bcmills bcmills added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker Soon This needs to be done soon. (regressions, serious bugs, outages) labels Sep 30, 2021
@bcmills bcmills added this to the Go1.18 milestone Sep 30, 2021
@gopherbot
Copy link

Change https://golang.org/cl/353392 mentions this issue: unix: skip TestSysvSharedMemory on ENOSYS

@gopherbot
Copy link

Change https://golang.org/cl/353398 mentions this issue: unix: SysvShmCtl use ipc_64 on mips64

gopherbot pushed a commit to golang/sys that referenced this issue Sep 30, 2021
Whether System V IPC is supported is a kernel configuration.

For golang/go#48708

Change-Id: Id0d23a5ede5f75f70ca6bb0b8abaec773b6adc74
Reviewed-on: https://go-review.googlesource.com/c/sys/+/353392
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
@virtuald
Copy link

I believe the combination of 353392 and 353398 should address the test failures. However, I don't really understand the IPC_64 thing in 353398... if there was someone else who understood linux syscalls a bit better then a better fix could be made.

@virtuald
Copy link

virtuald commented Oct 1, 2021

I am a bit surprised that the tests didn't fail on my original commit in gerrit, but I assume it was just that it didn't run on all the architectures? I do think I've identified what's going on here now, and I'll push a better fix soon I hope.

After Linux 5.1, a bunch of architectures got SYS_SHMxxx syscalls (torvalds/linux@0d6040d). However, prior to that they only supported using the SYS_IPC entrypoint. Looking through glibc's source, it doesn't bother trying to detect this at compile time, instead there are two different macros __ASSUME_SYSVIPC_DEFAULT_IPC_64 and __ASSUME_DIRECT_SYSVIPC_SYSCALLS that are defined in architecture specific configuration files (kernel-features.h).

In sysdeps/unix/sysv/linux/ipc_priv.h there is this:

#ifdef __ASSUME_SYSVIPC_DEFAULT_IPC_64
# define __IPC_64      0x0
#else
# define __IPC_64      0x100
#endif

And in glibc/sysdeps/unix/sysv/linux/kernel-features.h this is defined:

/* The generic default __IPC_64 value is 0x0, however some architectures
   require a different value of 0x100.  */
#define __ASSUME_SYSVIPC_DEFAULT_IPC_64		1

It appears that __ASSUME_SYSVIPC_DEFAULT_IPC_64 is #undef for these architectures/conditions:

  • alpha
  • arm
  • i386 (if __LINUX_KERNEL_VERSION < 0x050100)
  • microblaze
  • mips (if _MIPS_SIM == _ABIO32 && __LINUX_KERNEL_VERSION < 0x050100)
  • ppc (if __LINUX_KERNEL_VERSION < 0x050100)
  • s390 (if __LINUX_KERNEL_VERSION < 0x050100)
  • sh4 (if __LINUX_KERNEL_VERSION < 0x050100)
  • sparc (if __LINUX_KERNEL_VERSION < 0x050100)

__ASSUME_DIRECT_SYSVIPC_SYSCALLS is often disabled as well under similar conditions.

gopherbot pushed a commit to golang/sys that referenced this issue Oct 1, 2021
For golang/go#48708

Change-Id: Ieb5fdb5eb571af836268b69d3f1066ef8497a7b7
GitHub-Last-Rev: 59e24d8
GitHub-Pull-Request: #118
Reviewed-on: https://go-review.googlesource.com/c/sys/+/353398
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
@bcmills
Copy link
Contributor Author

bcmills commented Oct 1, 2021

I believe the combination of 353392 and 353398 should address the test failures.

Looks like the builder failures have indeed cleared.

@bcmills bcmills closed this as completed Oct 1, 2021
@golang golang locked and limited conversation to collaborators Oct 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker Soon This needs to be done soon. (regressions, serious bugs, outages)
Projects
None yet
Development

No branches or pull requests

3 participants