tsan: disable ASLR in Go test on NetBSD

Tsan does not support ASLR on NetBSD.
Disable ASLR in the Go test and extend
the error message to be more actionable.

Reported-by: Keith Randall (khr)
This commit is contained in:
Dmitry Vyukov 2020-04-11 09:46:45 +02:00
parent a517191a47
commit efeb35e195
2 changed files with 7 additions and 1 deletions

View File

@ -2130,7 +2130,9 @@ void CheckASLR() {
}
if (UNLIKELY(paxflags & CTL_PROC_PAXFLAGS_ASLR)) {
Printf("This sanitizer is not compatible with enabled ASLR\n");
Printf("This sanitizer is not compatible with enabled ASLR.\n"
"To disable ASLR, please run \"paxctl +a %s\" and try again.\n",
GetArgv()[0]);
Die();
}
#elif SANITIZER_PPC64V2

View File

@ -188,6 +188,10 @@ if [ "$DEPENDS_ON_LIBC" != "1" ]; then
fi
fi
if [ "`uname -a | grep NetBSD`" != "" ]; then
# Turn off ASLR in the test binary.
/usr/sbin/paxctl +a $DIR/test
fi
export GORACE="exitcode=0 atexit_sleep_ms=0"
if [ "$SILENT" != "1" ]; then
$DIR/test