ncw/swift

Go tests fail on i686 and armv7 architectures

eclipseo opened this issue · 2 comments

logs:

It's the same error repeated in each test:

+ go test -compiler gc -ldflags '' github.com/ncw/swift
Waiting for server to start . Started
2017/07/28 14:16:45 http: panic serving 127.0.0.1:60710: runtime error: invalid memory address or nil pointer dereference
goroutine 156 [running]:
net/http.(*conn).serve.func1(0x11a18180)
	/usr/lib/golang/src/net/http/server.go:1693 +0x9c
panic(0x2d2768, 0x49d178)
	/usr/lib/golang/src/runtime/panic.go:491 +0x204
sync/atomic.loadUint64(0x11a7410c, 0x119f6380, 0x11a68144)
	/usr/lib/golang/src/sync/atomic/64bit_arm.go:10 +0x3c
github.com/ncw/swift/swifttest.(*SwiftServer).serveHTTP(0x11a740f0, 0x472fd8, 0x11a20360, 0x119e6200)
	/builddir/build/BUILDROOT/golang-github-ncw-swift-0-0.8.gite3042b2.fc27.arm/usr/share/gocode/src/github.com/ncw/swift/swifttest/server.go:768 +0x90
github.com/ncw/swift/swifttest.NewSwiftServer.func1(0x472fd8, 0x11a20360, 0x119e6200)
	/builddir/build/BUILDROOT/golang-github-ncw-swift-0-0.8.gite3042b2.fc27.arm/usr/share/gocode/src/github.com/ncw/swift/swifttest/server.go:1093 +0x34
net/http.HandlerFunc.ServeHTTP(0x119ec050, 0x472fd8, 0x11a20360, 0x119e6200)
	/usr/lib/golang/src/net/http/server.go:1914 +0x34
net/http.serverHandler.ServeHTTP(0x11a04000, 0x472fd8, 0x11a20360, 0x119e6200)
	/usr/lib/golang/src/net/http/server.go:2610 +0x74
net/http.(*conn).serve(0x11a18180, 0x473528, 0x119f66c0)
	/usr/lib/golang/src/net/http/server.go:1797 +0x57c
created by net/http.(*Server).Serve
	/usr/lib/golang/src/net/http/server.go:2711 +0x208
--- FAIL: TestTransport (0.00s)
	swift_test.go:321: Auth failed Get http://127.0.0.1:33877/v1.0: EOF

The tests work fine in other arches like ppc64le or x86_64.

Any idea of what could be causing this?

Related to this bug I believe golang/go#13868

This is documented in the Bugs section at the very bottom of the page:

On both ARM and x86-32, it is the caller's responsibility to arrange for 64-bit alignment of 64-bit words accessed atomically. The first word in a global variable or in an allocated struct or slice can be relied upon to be 64-bit aligned.

It's easy to miss, though.

The patched version successfully builds on all platforms. See https://koji.fedoraproject.org/koji/taskinfo?taskID=20860955