[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

r6241 - in glibc-package/trunk/debian: . patches/hurd-i386



Author: sthibault
Date: 2014-08-19 20:25:18 +0000 (Tue, 19 Aug 2014)
New Revision: 6241

Modified:
   glibc-package/trunk/debian/changelog
   glibc-package/trunk/debian/patches/hurd-i386/cvs-libpthread_guardsize.diff
Log:
patches/hurd-i386/cvs-libpthread_guardsize.diff: Fix guard size computation.
Fixes the creation of thousands of threads, and thus pulseaudio testsuite.


Modified: glibc-package/trunk/debian/changelog
===================================================================
--- glibc-package/trunk/debian/changelog	2014-08-14 23:42:51 UTC (rev 6240)
+++ glibc-package/trunk/debian/changelog	2014-08-19 20:25:18 UTC (rev 6241)
@@ -6,6 +6,10 @@
     gcc-4.8 (>= 4.8.3-8) to make sure to get the new i586 GNU triplet on
     i386, hurd-i386 and kfreebsd-i386.
 
+  [ Samuel Thibault ]
+  * patches/hurd-i386/cvs-libpthread_guardsize.diff: Fix guard size computation.
+    Fixes the creation of thousands of threads, and thus pulseaudio testsuite.
+
  -- Aurelien Jarno <aurel32@debian.org>  Thu, 14 Aug 2014 18:26:45 +0200
 
 glibc (2.19-9) unstable; urgency=medium

Modified: glibc-package/trunk/debian/patches/hurd-i386/cvs-libpthread_guardsize.diff
===================================================================
--- glibc-package/trunk/debian/patches/hurd-i386/cvs-libpthread_guardsize.diff	2014-08-14 23:42:51 UTC (rev 6240)
+++ glibc-package/trunk/debian/patches/hurd-i386/cvs-libpthread_guardsize.diff	2014-08-19 20:25:18 UTC (rev 6241)
@@ -1,5 +1,5 @@
 diff --git a/libpthread/pthread/pt-create.c b/libpthread/pthread/pt-create.c
-index c2c84b1..00884b5 100644
+index c2c84b1..78dd17e 100644
 --- a/libpthread/pthread/pt-create.c
 +++ b/libpthread/pthread/pt-create.c
 @@ -118,12 +118,13 @@ __pthread_create_internal (struct __pthread **thread,
@@ -19,6 +19,18 @@
        pthread->stack = 1;
      }
  
+@@ -226,7 +227,10 @@ __pthread_create_internal (struct __pthread **thread,
+   goto failed;
+  failed_thread_alloc:
+   if (pthread->stack)
+-    __pthread_stack_dealloc (pthread->stackaddr, pthread->stacksize);
++    __pthread_stack_dealloc (pthread->stackaddr,
++			     ((setup->guardsize + __vm_page_size-1)
++			      / __vm_page_size) * __vm_page_size
++			     + pthread->stacksize);
+  failed_stack_alloc:
+   __pthread_dealloc (pthread);
+  failed:
 diff --git a/libpthread/pthread/pt-internal.h b/libpthread/pthread/pt-internal.h
 index eca63a1..79db55c 100644
 --- a/libpthread/pthread/pt-internal.h
@@ -67,3 +79,18 @@
  
    if (start_routine)
      {
+diff --git a/libpthread/sysdeps/mach/pt-thread-terminate.c b/libpthread/sysdeps/mach/pt-thread-terminate.c
+index 6672065..cb9e26a 100644
+--- a/libpthread/sysdeps/mach/pt-thread-terminate.c
++++ b/libpthread/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
+     {


Reply to: