From 20f508efc0122173980fc9607ccd694938ddf79f Mon Sep 17 00:00:00 2001 From: Mitch Phillips <31459023+hctim@users.noreply.github.com> Date: Thu, 27 Feb 2020 14:15:09 -0800 Subject: [PATCH] Update Sanitizer tests for Android R. Summary: Sanitizer tests don't entirely pass on an R device. Fix up all the incompatibilities with the new system. Reviewers: eugenis, pcc Reviewed By: eugenis Subscribers: #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D75303 --- compiler-rt/test/asan/TestCases/Posix/no-fd.cpp | 5 +++++ compiler-rt/test/asan/TestCases/strstr_strict.c | 6 ++++++ .../sanitizer_common/TestCases/Posix/feof_fileno_ferror.cpp | 4 ++++ 3 files changed, 15 insertions(+) diff --git a/compiler-rt/test/asan/TestCases/Posix/no-fd.cpp b/compiler-rt/test/asan/TestCases/Posix/no-fd.cpp index 086b01412ddb..ee355b5dc101 100644 --- a/compiler-rt/test/asan/TestCases/Posix/no-fd.cpp +++ b/compiler-rt/test/asan/TestCases/Posix/no-fd.cpp @@ -4,6 +4,11 @@ // Test ASan initialization +// This test closes the 0, 1, and 2 file descriptors before an exec() and relies +// on them remaining closed across an execve(). This is not the case on newer +// versions of Android. +// UNSUPPORTED: android + #include #include #include diff --git a/compiler-rt/test/asan/TestCases/strstr_strict.c b/compiler-rt/test/asan/TestCases/strstr_strict.c index 63e6b25a017c..7d2c4ec2f325 100644 --- a/compiler-rt/test/asan/TestCases/strstr_strict.c +++ b/compiler-rt/test/asan/TestCases/strstr_strict.c @@ -1,6 +1,12 @@ // Test strict_string_checks option in strstr function // RUN: %clang_asan %s -o %t && %run %t 2>&1 + +// Newer versions of Android's strstr() uses memchr() internally, which actually +// does trigger a heap-buffer-overflow (as it tries to find the +// null-terminator). +// UNSUPPORTED: android // RUN: %env_asan_opts=strict_string_checks=false %run %t 2>&1 + // RUN: %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s #include diff --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/feof_fileno_ferror.cpp b/compiler-rt/test/sanitizer_common/TestCases/Posix/feof_fileno_ferror.cpp index cfcf0e3970a4..b8c1a5f04575 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/Posix/feof_fileno_ferror.cpp +++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/feof_fileno_ferror.cpp @@ -1,5 +1,9 @@ // RUN: %clangxx -g %s -o %t && %run %t +// Newer versions of Android have FDSan, and will fail this test as FDSan will +// catch the error instead. +// UNSUPPORTED: android + #include #include #include