From ced137fad48ad18518cdd4ed3a77e75d5e58c78c Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 2 Nov 2016 16:33:33 -0400 Subject: [PATCH] misc/cgo/testsanitizers: skip tests when vm.overcommit_memory=2 Fixes #17689. Change-Id: I45a14e6bf4b2647431105f3e0b63b7076b6655d2 Reviewed-on: https://go-review.googlesource.com/32635 Run-TryBot: Russ Cox Reviewed-by: Brad Fitzpatrick Reviewed-by: Ian Lance Taylor --- misc/cgo/testsanitizers/test.bash | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/misc/cgo/testsanitizers/test.bash b/misc/cgo/testsanitizers/test.bash index d1d2dc6ae2..abbfb27d4b 100755 --- a/misc/cgo/testsanitizers/test.bash +++ b/misc/cgo/testsanitizers/test.bash @@ -15,6 +15,11 @@ if test -x "$(type -p clang)"; then fi export CC +if [ "$(sysctl -n vm.overcommit_memory)" = 2 ]; then + echo "skipping msan/tsan tests: vm.overcommit_memory=2" >&2 + exit 0 +fi + msan=yes TMPDIR=${TMPDIR:-/tmp}