From f36cd8dcb352f7978e9fceb1b512e08a4e296049 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Wed, 20 Aug 2014 21:07:27 +0200 Subject: Fix guard size computation * pthread/pt-create.c (__pthread_create_internal): On thread creation failure, take guard size into account when deallocating the stack. * sysdeps/mach/pt-thread-terminate.c (__pthread_thread_terminate): Take guard size into account when deallocating the stack. --- sysdeps/mach/pt-thread-terminate.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sysdeps/mach/pt-thread-terminate.c') diff --git a/sysdeps/mach/pt-thread-terminate.c b/sysdeps/mach/pt-thread-terminate.c index 6672065..cb9e26a 100644 --- a/sysdeps/mach/pt-thread-terminate.c +++ b/sysdeps/mach/pt-thread-terminate.c @@ -42,7 +42,9 @@ __pthread_thread_terminate (struct __pthread *thread) if (thread->stack) { stackaddr = thread->stackaddr; - stacksize = thread->stacksize; + stacksize = ((thread->guardsize + __vm_page_size-1) + / __vm_page_size) * __vm_page_size + + thread->stacksize; } else { -- cgit v1.2.3