Skip to content

Commit

Permalink
[libc] Fix pthread_create_test for 32 bit systems (#66564)
Browse files Browse the repository at this point in the history
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 increase the size to 3 * (SIZE_MAX / 4) so it can also fail in 32-bit 
systems.
  • Loading branch information
mikhailramalho committed Sep 22, 2023
1 parent 8eed7fb commit 7db91b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libc/test/integration/src/pthread/pthread_create_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ 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(3 * (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
Expand Down

0 comments on commit 7db91b4

Please sign in to comment.