@@ -1103,6 +1103,13 @@ func (t *tester) runPending(nextTest *distTest) {
1103
1103
} else {
1104
1104
timelog ("start" , w .dt .name )
1105
1105
w .out , w .err = w .cmd .CombinedOutput ()
1106
+ if w .err != nil {
1107
+ if isUnsupportedVMASize (w ) {
1108
+ timelog ("skip" , w .dt .name )
1109
+ w .out = []byte (fmt .Sprintf ("skipped due to unsupported VMA\n " ))
1110
+ w .err = nil
1111
+ }
1112
+ }
1106
1113
}
1107
1114
timelog ("end" , w .dt .name )
1108
1115
w .end <- true
@@ -1383,6 +1390,11 @@ func (t *tester) packageHasBenchmarks(pkg string) bool {
1383
1390
// raceDetectorSupported is a copy of the function
1384
1391
// cmd/internal/sys.RaceDetectorSupported, which can't be used here
1385
1392
// because cmd/dist has to be buildable by Go 1.4.
1393
+ // The race detector only supports 48-bit VMA on arm64. But we don't have
1394
+ // a good solution to check VMA size(See https://golang.org/issue/29948)
1395
+ // raceDetectorSupported will always return true for arm64. But race
1396
+ // detector tests may abort on non 48-bit VMA configuration, the tests
1397
+ // will be marked as "skipped" in this case.
1386
1398
func raceDetectorSupported (goos , goarch string ) bool {
1387
1399
switch goos {
1388
1400
case "linux" :
@@ -1404,3 +1416,11 @@ func mSanSupported(goos, goarch string) bool {
1404
1416
return false
1405
1417
}
1406
1418
}
1419
+
1420
+ // isUnsupportedVMASize reports whether the failure is caused by an unsupported
1421
+ // VMA for the race detector (for example, running the race detector on an
1422
+ // arm64 machine configured with 39-bit VMA)
1423
+ func isUnsupportedVMASize (w * work ) bool {
1424
+ unsupportedVMA := []byte ("unsupported VMA range" )
1425
+ return w .dt .name == "race" && bytes .Contains (w .out , unsupportedVMA )
1426
+ }
0 commit comments