]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/dist: skip race detector test failure for unsupported VMA
authorFangming.Fang <fangming.fang@arm.com>
Sat, 2 Feb 2019 10:27:37 +0000 (10:27 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 24 Apr 2019 16:11:35 +0000 (16:11 +0000)
Fixes #29948

Change-Id: I01d041655d34a5de32701dec8b360e347593a45d
Reviewed-on: https://go-review.googlesource.com/c/go/+/160919
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/dist/test.go
src/cmd/internal/sys/supported.go

index df86ae72237bbab95d8099b3d0a25d4eee0baffc..577a20bf42db51f392acab4a8a4ca2edcff6eb7f 100644 (file)
@@ -1103,6 +1103,13 @@ func (t *tester) runPending(nextTest *distTest) {
                        } else {
                                timelog("start", w.dt.name)
                                w.out, w.err = w.cmd.CombinedOutput()
+                               if w.err != nil {
+                                       if isUnsupportedVMASize(w) {
+                                               timelog("skip", w.dt.name)
+                                               w.out = []byte(fmt.Sprintf("skipped due to unsupported VMA\n"))
+                                               w.err = nil
+                                       }
+                               }
                        }
                        timelog("end", w.dt.name)
                        w.end <- true
@@ -1383,6 +1390,11 @@ func (t *tester) packageHasBenchmarks(pkg string) bool {
 // raceDetectorSupported is a copy of the function
 // cmd/internal/sys.RaceDetectorSupported, which can't be used here
 // because cmd/dist has to be buildable by Go 1.4.
+// The race detector only supports 48-bit VMA on arm64. But we don't have
+// a good solution to check VMA size(See https://golang.org/issue/29948)
+// raceDetectorSupported will always return true for arm64. But race
+// detector tests may abort on non 48-bit VMA configuration, the tests
+// will be marked as "skipped" in this case.
 func raceDetectorSupported(goos, goarch string) bool {
        switch goos {
        case "linux":
@@ -1404,3 +1416,11 @@ func mSanSupported(goos, goarch string) bool {
                return false
        }
 }
+
+// isUnsupportedVMASize reports whether the failure is caused by an unsupported
+// VMA for the race detector (for example, running the race detector on an
+// arm64 machine configured with 39-bit VMA)
+func isUnsupportedVMASize(w *work) bool {
+       unsupportedVMA := []byte("unsupported VMA range")
+       return w.dt.name == "race" && bytes.Contains(w.out, unsupportedVMA)
+}
index c963971f59ae048e1e9fcc2ddc011bcc7202e1e5..df26f971f832c4cbb99c85be3238feeeb56163e4 100644 (file)
@@ -6,6 +6,9 @@ package sys
 
 // RaceDetectorSupported reports whether goos/goarch supports the race
 // detector. There is a copy of this function in cmd/dist/test.go.
+// Race detector only supports 48-bit VMA on arm64. But it will always
+// return true for arm64, because we don't have VMA size information during
+// the compile time.
 func RaceDetectorSupported(goos, goarch string) bool {
        switch goos {
        case "linux":