Skip to content

Commit

Permalink
mmap18: Increase minimal stack mapping to PTHREAD_STACK_MIN
Browse files Browse the repository at this point in the history
The first testcase keeps segfaulting on older kernels with only 4KB initial
stack mapping. Pthread man pages say that stack must be at least
PTHREAD_STACK_MIN bytes in size but they're not clear how that relates
to growing stacks. Let's be on the safe side.

Signed-off-by: Martin Doucha <[email protected]>
Reviewed-by: Li Wang <[email protected]>
Reviewed-by: Cyril Hrubis <[email protected]>
  • Loading branch information
mdoucha authored and metan-ucw committed Sep 25, 2020
1 parent c277e7e commit 227210a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions testcases/kernel/syscalls/mmap/mmap18.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ static void run_test(void)
{
size_t stack_size = 8 * PTHREAD_STACK_MIN;

grow_stack_success(stack_size, page_size);
grow_stack_success(stack_size, PTHREAD_STACK_MIN);
grow_stack_success(stack_size, stack_size/2);
grow_stack_fail(stack_size, page_size);
grow_stack_fail(stack_size, PTHREAD_STACK_MIN);
grow_stack_fail(stack_size, stack_size/2);
}

Expand Down

0 comments on commit 227210a

Please sign in to comment.