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

via libc-commits libc-commits at lists.llvm.org
Tue Jan 30 15:16:37 PST 2024


Author: Nick Desaulniers
Date: 2024-01-30T15:16:32-08:00
New Revision: 16c15b5f84836d81084e9987701ca011da5a864f

URL: https://github.com/llvm/llvm-project/commit/16c15b5f84836d81084e9987701ca011da5a864f
DIFF: https://github.com/llvm/llvm-project/commit/16c15b5f84836d81084e9987701ca011da5a864f.diff

LOG: [libc] disable mlockall w/ MCL_ONFAULT (#80075)

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

Added: 
    

Modified: 
    libc/test/src/sys/mman/linux/mlock_test.cpp

Removed: 
    


################################################################################
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);
 }


        


More information about the libc-commits mailing list