This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.24-53-gfc86a87


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  fc86a87d788596c6d418f0fa79c79fffc6cfd08f (commit)
      from  9e2ff6c9cc54c0b4402b8d49e4abe7000fde7617 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=fc86a87d788596c6d418f0fa79c79fffc6cfd08f

commit fc86a87d788596c6d418f0fa79c79fffc6cfd08f
Author: Florian Weimer <fweimer@redhat.com>
Date:   Tue Aug 16 11:06:13 2016 +0200

    nptl/tst-tls3-malloc: Force freeing of thread stacks
    
    It turns out that due to the reduced stack size in tst-tls3 and the
    (fixed) default stack cache size, allocated TLS variables are never
    freed, so the test coverage for tst-tls3-malloc is less than complete.
    This change increases the thread stack size for tst-tls3-malloc only,
    to make sure thread stacks and TLS variables are freed.

diff --git a/ChangeLog b/ChangeLog
index 62f60dc..505c558 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2016-08-16  Florian Weimer  <fweimer@redhat.com>
+
+	* nptl/tst-tls3.c (default_stack_size_in_mb, stack_size_in_mb):
+	New.
+	(do_test): Apply default_stack_size_in_mb if not set.
+	* nptl/tst-tls3-malloc.c (stack_size_in_mb): Override default.
+
 2016-08-15  Andreas Schwab  <schwab@suse.de>
 
 	[BZ #20435]
diff --git a/nptl/tst-tls3-malloc.c b/nptl/tst-tls3-malloc.c
index 5eab3cd..8a580fa 100644
--- a/nptl/tst-tls3-malloc.c
+++ b/nptl/tst-tls3-malloc.c
@@ -19,6 +19,11 @@
 /* Reuse the test.  */
 #include "tst-tls3.c"
 
+/* Increase the thread stack size to 10 MiB, so that some thread
+   stacks are actually freed.  (The stack cache size is currently
+   hard-wired to 40 MiB in allocatestack.c.)  */
+static long stack_size_in_mb = 10;
+
 #include <sys/mman.h>
 
 /* Interpose a minimal malloc implementation.  This implementation
diff --git a/nptl/tst-tls3.c b/nptl/tst-tls3.c
index 982c1fd..649cb8f 100644
--- a/nptl/tst-tls3.c
+++ b/nptl/tst-tls3.c
@@ -29,6 +29,11 @@
 
 #define THE_SIG SIGUSR1
 
+/* The stack size can be overriden.  With a sufficiently large stack
+   size, thread stacks for terminated threads are freed, but this does
+   not happen with the default size of 1 MiB.  */
+enum { default_stack_size_in_mb = 1 };
+static long stack_size_in_mb;
 
 #define N 10
 static pthread_t th[N];
@@ -72,6 +77,9 @@ int nsigs;
 int
 do_test (void)
 {
+  if (stack_size_in_mb == 0)
+    stack_size_in_mb = default_stack_size_in_mb;
+
   if ((uintptr_t) pthread_self () & (TCB_ALIGNMENT - 1))
     {
       puts ("initial thread's struct pthread not aligned enough");
@@ -127,7 +135,7 @@ do_test (void)
       exit (1);
     }
 
-  if (pthread_attr_setstacksize (&a, 1 * 1024 * 1024) != 0)
+  if (pthread_attr_setstacksize (&a, stack_size_in_mb * 1024 * 1024) != 0)
     {
       puts ("attr_setstacksize failed");
       return 1;

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog              |    7 +++++++
 nptl/tst-tls3-malloc.c |    5 +++++
 nptl/tst-tls3.c        |   10 +++++++++-
 3 files changed, 21 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]