go: gccgo: MemmoveAtomicity fails on ppc64x since it uses C's memmove

In the testing of gccgo runtime package on ppc64le and ppc64 we are seeing this error:

[New Thread 0x7fffbeb8eff0 (LWP 166699)]
--- FAIL: TestMemmoveAtomicity (0.01s)
    --- FAIL: TestMemmoveAtomicity/24-backward (0.00s)
        memmove_test.go:267: got partially updated pointer 0xc000000000 at dst[0], want either nil or 0xc00028a088
    --- FAIL: TestMemmoveAtomicity/32-backward (0.00s)
        memmove_test.go:267: got partially updated pointer 0xc000000000 at dst[0], want either nil or 0xc00028a088
    --- FAIL: TestMemmoveAtomicity/48-backward (0.00s)
        memmove_test.go:267: got partially updated pointer 0xc000000000 at dst[0], want either nil or 0xc00028a088
    --- FAIL: TestMemmoveAtomicity/24-forward (0.00s)
        memmove_test.go:267: got partially updated pointer 0x28a088 at dst[2], want either nil or 0xc00028a088
FAIL

This has been happening since the addition of the MemmoveAtomicity test, but has been hidden because of a segv in other runtime tests which prevented all the runtime tests from running. For some reason this now shows up intermittently in the libgo.log.

According to this CL https://go-review.googlesource.com/c/go/+/213418/ it is understood that while Go’s memmove copies pointers atomically, but C’s memmove does not have that guarantee, and gccgo is using libc’s memmove at least on ppc64le/ppc64.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 33 (28 by maintainers)

Commits related to this issue

Most upvoted comments

@laboger You have to use an unpatched version of autoconf 2.69. Unfortunately distros often patch autoconf, so you can’t use a distro autoconf, you have to build it yourself. That said, I can fix this up for you.

@tkdlqm2 I’m leaving this for @laboger .