[libc-commits] [libc] [libc][mincore] use correct page_size for test (PR #73984)

via libc-commits libc-commits at lists.llvm.org
Thu Nov 30 14:45:04 PST 2023


================
@@ -102,14 +106,14 @@ TEST(LlvmLibcMincoreTest, PageOut) {
   // page out the memory
   {
     libc_errno = 0;
-    EXPECT_THAT(LIBC_NAMESPACE::madvise(addr, EXEC_PAGESIZE, MADV_DONTNEED),
+    EXPECT_THAT(LIBC_NAMESPACE::madvise(addr, page_size, MADV_DONTNEED),
                 Succeeds());
 
     libc_errno = 0;
-    int res = LIBC_NAMESPACE::mincore(addr, EXEC_PAGESIZE, &vec);
+    int res = LIBC_NAMESPACE::mincore(addr, page_size, &vec);
----------------
lntue wrote:

Your suggestion of changing this to:
```
int res = LIBC_NAMESPACE::mincore(addr, 1, &vec);
```
does fix the segfault in AArch64.  Otherwise, it is consistently crashed on AArch64.

https://github.com/llvm/llvm-project/pull/73984


More information about the libc-commits mailing list