Skip to content
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

[libc] Fix pthread_create_test for 32 bit systems #66564

Merged
merged 2 commits into from
Sep 22, 2023

Conversation

mikhailramalho
Copy link
Member

The test tries to set the guard_size and stack_size of a thread to SIZE_MAX / 4, which is a huge value in 64-bit systems but 1GB in 32-bit ones.

We remove this test since the previous line already sets a value that fails in both 64-bit and 32-bit systems.

The test tries to set the guard_size and stack_size of a thread to
SIZE_MAX / 4, which is a huge value in 64-bit systems but 1GB in 32-bit
ones.

We remove this test since the previous line already sets a value that
fails in both 64-bit and 32-bit systems.
@llvmbot
Copy link
Collaborator

llvmbot commented Sep 16, 2023

@llvm/pr-subscribers-libc

Changes

The test tries to set the guard_size and stack_size of a thread to SIZE_MAX / 4, which is a huge value in 64-bit systems but 1GB in 32-bit ones.

We remove this test since the previous line already sets a value that fails in both 64-bit and 32-bit systems.

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

1 Files Affected:

  • (modified) libc/test/integration/src/pthread/pthread_create_test.cpp (-1)
diff --git a/libc/test/integration/src/pthread/pthread_create_test.cpp b/libc/test/integration/src/pthread/pthread_create_test.cpp
index 20a1139efbfa1ed..33dfe19f5ec4aff 100644
--- a/libc/test/integration/src/pthread/pthread_create_test.cpp
+++ b/libc/test/integration/src/pthread/pthread_create_test.cpp
@@ -287,7 +287,6 @@ static void run_failure_tests() {
   run_failure_config(PTHREAD_STACK_MIN, SIZE_MAX);
   run_failure_config(PTHREAD_STACK_MIN, SIZE_MAX - PTHREAD_STACK_MIN);
   run_failure_config(SIZE_MAX / 2, SIZE_MAX / 2);
-  run_failure_config(SIZE_MAX / 4, SIZE_MAX / 4);
   run_failure_config(SIZE_MAX / 2 + 1234, SIZE_MAX / 2);
 
   // Test invalid parameters that are impossible to obtain via the

@goldsteinn
Copy link
Contributor

Maybe replace with 3 * (SIZE_MAX / 4) and SIZE_MAX / 4 IIRC and the issue is the overflow?

@mikhailramalho
Copy link
Member Author

Maybe replace with 3 * (SIZE_MAX / 4) and SIZE_MAX / 4 IIRC and the issue is the overflow?

alright, trying to set the guard size to 3 * (SIZE_MAX / 4) also fails in 32-bit systems.

@mikhailramalho mikhailramalho merged commit 7db91b4 into llvm:main Sep 22, 2023
2 of 3 checks passed
@mikhailramalho mikhailramalho deleted the fix-pthread-create-test-32 branch September 22, 2023 14:10
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.

None yet

4 participants