Skip to content

[libc] remove unstable mincore test for invalid vec #79348

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

SchrodingerZhu
Copy link
Contributor

The faults on invalid vec range in mincore seems to be handled differently by the OS (it is an erroneous edge case after all). Remove the tests for now.

@llvmbot
Copy link
Member

llvmbot commented Jan 24, 2024

@llvm/pr-subscribers-libc

Author: Schrodinger ZHU Yifan (SchrodingerZhu)

Changes

The faults on invalid vec range in mincore seems to be handled differently by the OS (it is an erroneous edge case after all). Remove the tests for now.


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

1 Files Affected:

  • (modified) libc/test/src/sys/mman/linux/mincore_test.cpp (-8)
diff --git a/libc/test/src/sys/mman/linux/mincore_test.cpp b/libc/test/src/sys/mman/linux/mincore_test.cpp
index 52fc7bcf44f78f..493d748f2c98e6 100644
--- a/libc/test/src/sys/mman/linux/mincore_test.cpp
+++ b/libc/test/src/sys/mman/linux/mincore_test.cpp
@@ -52,14 +52,6 @@ TEST(LlvmLibcMincoreTest, InvalidVec) {
   libc_errno = 0;
   int res = LIBC_NAMESPACE::mincore(addr, 1, nullptr);
   EXPECT_THAT(res, Fails(EFAULT, -1));
-  void *area = LIBC_NAMESPACE::mmap(nullptr, page_size, PROT_READ | PROT_WRITE,
-                                    MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
-  EXPECT_NE(area, MAP_FAILED);
-  unsigned char *ptr = static_cast<unsigned char *>(area) + page_size - 3;
-  res = LIBC_NAMESPACE::mincore(addr, 4 * page_size, ptr);
-  EXPECT_THAT(res, Fails(EFAULT, -1));
-  EXPECT_THAT(LIBC_NAMESPACE::munmap(addr, page_size), Succeeds());
-  EXPECT_THAT(LIBC_NAMESPACE::munmap(area, 2), Succeeds());
 }
 
 TEST(LlvmLibcMincoreTest, NoError) {

Copy link
Member

@nickdesaulniers nickdesaulniers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we'll need to revisit this again in the future...

@SchrodingerZhu
Copy link
Contributor Author

Hopefully not, I wish 😃.

@SchrodingerZhu SchrodingerZhu merged commit 7b11c08 into llvm:main Jan 24, 2024
@SchrodingerZhu SchrodingerZhu deleted the libc/mincore-remove-unstable-test branch January 24, 2024 19:11
@SchrodingerZhu SchrodingerZhu restored the libc/mincore-remove-unstable-test branch January 24, 2024 19:14
@SchrodingerZhu SchrodingerZhu deleted the libc/mincore-remove-unstable-test branch January 24, 2024 19:14
@SchrodingerZhu
Copy link
Contributor Author

I guess I need to keep watching the CI for a while, to see if it will shake out anything else.

@nickdesaulniers
Copy link
Member

CI seems green now (modulo WIP for the GCC builds)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants