[libc-commits] [libc] [libc] disable mlockall w/ MCL_ONFAULT (PR #80075)

via libc-commits libc-commits at lists.llvm.org
Tue Jan 30 14:56:09 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Nick Desaulniers (nickdesaulniers)

<details>
<summary>Changes</summary>

I suspect this is a bug in linux 4.19, as the test passes as written on my
linux 6.5 machine.

Let's revisit this after the build bots are upgraded.

Link: #<!-- -->80073


---
Full diff: https://github.com/llvm/llvm-project/pull/80075.diff


1 Files Affected:

- (modified) libc/test/src/sys/mman/linux/mlock_test.cpp (+7-1) 


``````````diff
diff --git a/libc/test/src/sys/mman/linux/mlock_test.cpp b/libc/test/src/sys/mman/linux/mlock_test.cpp
index a182a00d12f44..a4e1682ff32bc 100644
--- a/libc/test/src/sys/mman/linux/mlock_test.cpp
+++ b/libc/test/src/sys/mman/linux/mlock_test.cpp
@@ -131,7 +131,13 @@ TEST(LlvmLibcMlockTest, InvalidFlag) {
 
   // Invalid mlockall flags.
   EXPECT_THAT(LIBC_NAMESPACE::mlockall(1234), Fails(EINVAL));
-  EXPECT_THAT(LIBC_NAMESPACE::mlockall(MCL_ONFAULT), Fails(EINVAL));
+
+  // man 2 mlockall says EINVAL is a valid return code when MCL_ONFAULT was
+  // specified without MCL_FUTURE or MCL_CURRENT, but this seems to fail on
+  // Linux 4.19.y (EOL).
+  // TODO(ndesaulniers) re-enable after
+  // https://github.com/llvm/llvm-project/issues/80073 is fixed.
+  // EXPECT_THAT(LIBC_NAMESPACE::mlockall(MCL_ONFAULT), Fails(EINVAL));
 
   LIBC_NAMESPACE::munmap(addr, alloc_size);
 }

``````````

</details>


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


More information about the libc-commits mailing list