From 0660704b3efd251fd737589d0edba13ffebde0c1 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Fri, 23 May 2014 20:45:32 +0200 Subject: Fix guardsize computation * pthread/pt-create.c (__pthread_create_internal): Round guardsize up to page size. Fill `guardsize' field of thread structure. * sysdeps/mach/hurd/i386/pt-setup.c (stack_setup): Add guardsize to computation of the top of the stack. --- sysdeps/mach/hurd/i386/pt-setup.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sysdeps/mach') diff --git a/sysdeps/mach/hurd/i386/pt-setup.c b/sysdeps/mach/hurd/i386/pt-setup.c index c3abe91..4511463 100644 --- a/sysdeps/mach/hurd/i386/pt-setup.c +++ b/sysdeps/mach/hurd/i386/pt-setup.c @@ -46,7 +46,9 @@ stack_setup (struct __pthread *thread, /* Calculate the top of the new stack. */ bottom = thread->stackaddr; - top = (uintptr_t *) ((uintptr_t) bottom + thread->stacksize); + top = (uintptr_t *) ((uintptr_t) bottom + thread->stacksize + + ((thread->guardsize + __vm_page_size-1) + / __vm_page_size) * __vm_page_size); if (start_routine) { -- cgit v1.2.3