We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2fc1b3d commit e3a638cCopy full SHA for e3a638c
compiler-rt/lib/gwp_asan/tests/basic.cpp
@@ -65,11 +65,12 @@ TEST_F(DefaultGuardedPoolAllocator, NonPowerOfTwoAlignment) {
65
66
// Added multi-page slots? You'll need to expand this test.
67
TEST_F(DefaultGuardedPoolAllocator, TooBigForSinglePageSlots) {
68
- EXPECT_EQ(nullptr, GPA.allocate(0x1001, 0));
69
- EXPECT_EQ(nullptr, GPA.allocate(0x1001, 1));
70
- EXPECT_EQ(nullptr, GPA.allocate(0x1001, 0x1000));
71
- EXPECT_EQ(nullptr, GPA.allocate(1, 0x2000));
72
- EXPECT_EQ(nullptr, GPA.allocate(0, 0x2000));
+ size_t PageSize = sysconf(_SC_PAGESIZE);
+ EXPECT_EQ(nullptr, GPA.allocate(PageSize + 1, 0));
+ EXPECT_EQ(nullptr, GPA.allocate(PageSize + 1, 1));
+ EXPECT_EQ(nullptr, GPA.allocate(PageSize + 1, PageSize));
+ EXPECT_EQ(nullptr, GPA.allocate(1, 2 * PageSize));
73
+ EXPECT_EQ(nullptr, GPA.allocate(0, 2 * PageSize));
74
}
75
76
TEST_F(CustomGuardedPoolAllocator, AllocAllSlots) {
compiler-rt/lib/gwp_asan/tests/never_allocated.cpp
@@ -13,8 +13,10 @@
13
#include "gwp_asan/tests/harness.h"
14
15
TEST_P(BacktraceGuardedPoolAllocatorDeathTest, NeverAllocated) {
16
17
+
18
SCOPED_TRACE("");
- void *Ptr = GPA.allocate(0x1000);
19
+ void *Ptr = GPA.allocate(PageSize);
20
GPA.deallocate(Ptr);
21
22
std::string DeathNeedle =
@@ -23,7 +25,7 @@ TEST_P(BacktraceGuardedPoolAllocatorDeathTest, NeverAllocated) {
23
25
// Trigger a guard page in a completely different slot that's never allocated.
24
26
// Previously, there was a bug that this would result in nullptr-dereference
27
// in the posix crash handler.
- char *volatile NeverAllocatedPtr = static_cast<char *>(Ptr) + 0x3000;
28
+ char *volatile NeverAllocatedPtr = static_cast<char *>(Ptr) + 3 * PageSize;
29
if (!Recoverable) {
30
EXPECT_DEATH(*NeverAllocatedPtr = 0, DeathNeedle);
31
return;
@@ -37,8 +39,8 @@ TEST_P(BacktraceGuardedPoolAllocatorDeathTest, NeverAllocated) {
37
39
GetOutputBuffer().clear();
38
40
for (size_t i = 0; i < 100; ++i) {
41
*NeverAllocatedPtr = 0;
- *(NeverAllocatedPtr + 0x2000) = 0;
- *(NeverAllocatedPtr + 0x3000) = 0;
42
+ *(NeverAllocatedPtr + 2 * PageSize) = 0;
43
+ *(NeverAllocatedPtr + 3 * PageSize) = 0;
44
ASSERT_TRUE(GetOutputBuffer().empty());
45
46
compiler-rt/test/asan/TestCases/Linux/release_to_os_test.cpp
@@ -6,6 +6,7 @@
6
// RUN: %env_asan_opts=allocator_release_to_os_interval_ms=-1 %run %t force 2>&1 | FileCheck %s --check-prefix=FORCE_RELEASE
7
8
// REQUIRES: x86_64-target-arch
9
+// REQUIRES: page-size-4096
10
11
#include <algorithm>
12
#include <assert.h>
compiler-rt/test/cfi/cross-dso/lit.local.cfg.py
@@ -12,3 +12,7 @@ def getRoot(config):
# Android O (API level 26) has support for cross-dso cfi in libdl.so.
if config.android and "android-26" not in config.available_features:
config.unsupported = True
+# The runtime library only supports 4K pages.
+if "page-size-4096" not in config.available_features:
+ config.unsupported = True
compiler-rt/test/lit.common.cfg.py
@@ -965,6 +965,16 @@ def is_windows_lto_supported():
965
else:
966
config.available_features.add("memprof-shadow-scale-3")
967
968
+def target_page_size():
969
+ try:
970
+ proc = subprocess.Popen(f"{emulator or ""} python3", shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
971
+ out, err = proc.communicate(b'import os; print(os.sysconf("SC_PAGESIZE"))')
972
+ return int(out)
973
+ except:
974
+ return 4096
975
976
+config.available_features.add(f"page-size-{target_page_size()}")
977
978
if config.expensive_checks:
979
config.available_features.add("expensive_checks")
980
compiler-rt/test/msan/dtls_test.c
@@ -11,6 +11,7 @@
// Reports use-of-uninitialized-value, not analyzed
XFAIL: target={{.*netbsd.*}}
+ XFAIL: aarch64-target-arch
*/
compiler-rt/test/sanitizer_common/TestCases/Linux/odd_stack_size.cpp
@@ -1,4 +1,5 @@
1
// RUN: %clangxx -O1 %s -o %t && %run %t
2
3
// UNSUPPORTED: android
4
5
// Fail on powerpc64 bots with:
compiler-rt/test/sanitizer_common/TestCases/Linux/release_to_os_test.cpp
@@ -11,6 +11,9 @@
// FIXME: This mode uses 32bit allocator without purge.
// UNSUPPORTED: hwasan-aliasing
+// Page size is hardcoded below, but test still fails even if not hardcoded.
#include <fcntl.h>
compiler-rt/test/sanitizer_common/TestCases/Linux/resize_tls_dynamic.cpp
// FIXME: Investigate
// UNSUPPORTED: target=powerpc64{{.*}}
+// Fails because AArch64 uses TLSDESC instead of __tls_get_addr.
+// UNSUPPORTED: aarch64-target-arch
#include <string.h>
#ifndef BUILD_DSO
compiler-rt/test/sanitizer_common/TestCases/Linux/tls_get_addr.c
@@ -13,6 +13,9 @@
// FIXME: Fails for unknown reasons.
// UNSUPPORTED: powerpc64le-target-arch
#ifndef BUILD_SO
# include <assert.h>
# include <dlfcn.h>
0 commit comments