summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2018-07-20 15:51:40 -0400
committerAustin Clements <austin@google.com>2018-07-23 15:16:01 +0000
commit30d7e6449fd7fb18415f9b3889309f2d24559ada (patch)
tree120d31928bc8cff9a7d1de44d3bcbd71c1efdb1b /misc
parent48c79734ffc69c7137d5944eb6403b47075cfb77 (diff)
downloadgo-git-30d7e6449fd7fb18415f9b3889309f2d24559ada.tar.gz
misc/cgo/test: disable some Darwin tests in cgo mode
For unknown reasons, linking against CoreFoundation on macOS 10.10 sometimes causes mmap to ignore the hint address, which makes the Go allocator incompatible with TSAN. Currently, the effect of this is to run the allocator out of arena hints on the very first allocation, causing a "too many address space collisions for -race mode" panic. This CL skips the cgo tests that link against CoreFoundation in race mode. Updates #26475. Updates #26513. Change-Id: I52ec638c99acf5d4966e68ff0054f7679680dac6 Reviewed-on: https://go-review.googlesource.com/125304 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'misc')
-rw-r--r--misc/cgo/test/issue21897.go11
-rw-r--r--misc/cgo/test/issue21897b.go2
-rw-r--r--misc/cgo/test/issue24161_darwin_test.go8
3 files changed, 19 insertions, 2 deletions
diff --git a/misc/cgo/test/issue21897.go b/misc/cgo/test/issue21897.go
index d13246bd84..454a141827 100644
--- a/misc/cgo/test/issue21897.go
+++ b/misc/cgo/test/issue21897.go
@@ -2,7 +2,16 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build darwin,cgo,!internal
+// We skip this test in race mode because, for unknown reasons,
+// linking against CoreFoundation on macOS 10.10 causes mmap to ignore
+// the hint address, which makes the Go allocator incompatible with
+// TSAN. See golang.org/issue/26475.
+//
+// TODO(austin): Once support for macOS 10.10 is dropped, remove the
+// race constraint (and the one in issue21897b.go). See
+// golang.org/issue/26513.
+
+// +build darwin,cgo,!internal,!race
package cgotest
diff --git a/misc/cgo/test/issue21897b.go b/misc/cgo/test/issue21897b.go
index 08b5f4d808..e143bad086 100644
--- a/misc/cgo/test/issue21897b.go
+++ b/misc/cgo/test/issue21897b.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build !darwin !cgo internal
+// +build !darwin !cgo internal race
package cgotest
diff --git a/misc/cgo/test/issue24161_darwin_test.go b/misc/cgo/test/issue24161_darwin_test.go
index 10fdfbd1bc..48072ff121 100644
--- a/misc/cgo/test/issue24161_darwin_test.go
+++ b/misc/cgo/test/issue24161_darwin_test.go
@@ -2,6 +2,14 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// See issue21897.go and golang.org/issue/26475 for why this is
+// skipped in race mode.
+//
+// TODO(austin): Once support for macOS 10.10 is dropped, remove the
+// race constraint. See golang.org/issue/26513.
+
+// +build !race
+
package cgotest
import (