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.16-ports-merge-72-g77b3227


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  77b32274e92bfaa289f240fa216204cbf13ad4dd (commit)
      from  354691b7b55d014b9a4d3a94e2f8f934870b6bff (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://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=77b32274e92bfaa289f240fa216204cbf13ad4dd

commit 77b32274e92bfaa289f240fa216204cbf13ad4dd
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Wed Jul 25 20:41:32 2012 +0530

    Revert fix to tst-pthread-getattr since it fails on sparc

diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 0a1c10f..71f8e95 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,7 @@
+2012-07-25  Siddhesh Poyarekar  <siddhesh@redhat.com>
+
+	* tst-pthread-getattr.c: Revert last change.
+
 2012-07-20  Siddhesh Poyarekar  <siddhesh@redhat.com>
 
 	* tst-pthread-getattr.c (MAX_STACK_SIZE): New max cap for stack
diff --git a/nptl/tst-pthread-getattr.c b/nptl/tst-pthread-getattr.c
index 692bce4..6f2cfc6 100644
--- a/nptl/tst-pthread-getattr.c
+++ b/nptl/tst-pthread-getattr.c
@@ -23,38 +23,16 @@
 #include <sys/resource.h>
 #include <pthread.h>
 #include <alloca.h>
-#include <assert.h>
-
-/* There is an obscure bug in the kernel due to which RLIMIT_STACK is sometimes
-   returned as unlimited when it is not, which may cause this test to fail.
-   There is also the other case where RLIMIT_STACK is intentionally set as
-   unlimited or very high, which may result in a vma that is too large and again
-   results in a test case failure.  To avoid these problems, we cap the stack
-   size to one less than 8M.  See the following mailing list threads for more
-   information about this problem:
-   <http://sourceware.org/ml/libc-alpha/2012-06/msg00599.html>
-   <http://sourceware.org/ml/libc-alpha/2012-06/msg00713.html>.  */
-#define MAX_STACK_SIZE (8192 * 1024 - 1)
-
-#define _MIN(l,o) ((l) < (o) ? (l) : (o))
 
 /* Move the stack pointer so that stackaddr is accessible and then check if it
    really is accessible.  This will segfault if it fails.  */
-static void *
+static void
 allocate_and_test (void *stackaddr)
 {
   void *mem = &mem;
-  /* FIXME:  mem >= stackaddr for _STACK_GROWSUP.  */
+  /* FIXME:  The difference will be negative for _STACK_GROWSUP.  */
   mem = alloca ((size_t) (mem - stackaddr));
-  assert (mem <= stackaddr);
-
-  /* We don't access mem here because the compiler may move the stack pointer
-     beyond what we expect, thus making our alloca send the stack pointer
-     beyond stackaddr.  Using only stackaddr without the assert may make the
-     compiler think that this instruction is independent of the above alloca
-     and hence reshuffle to do this dereference before the alloca.  */
-  *(int *)stackaddr = 42;
-  return stackaddr;
+  *(int *)(mem) = 0;
 }
 
 static int
@@ -99,20 +77,17 @@ check_stack_top (void)
       return 1;
     }
 
-  printf ("current rlimit_stack is %zu\n", stack_limit.rlim_cur);
-
   if (get_self_pthread_attr ("check_stack_top", &stackaddr, &stacksize))
     return 1;
 
-  /* Reduce the rlimit to a page less that what is currently being returned
-     (subject to a maximum of MAX_STACK_SIZE) so that we ensure that
-     pthread_getattr_np uses rlimit.  The figure is intentionally unaligned so
-     to verify that pthread_getattr_np returns an aligned stacksize that
-     correctly fits into the rlimit.  We don't bother about the case where the
-     stack is limited by the vma below it and not by the rlimit because the
-     stacksize returned in that case is computed from the end of that vma and is
-     hence safe.  */
-  stack_limit.rlim_cur = _MIN(stacksize - 4095, MAX_STACK_SIZE);
+  /* Reduce the rlimit to a page less that what is currently being returned so
+     that we ensure that pthread_getattr_np uses rlimit.  The figure is
+     intentionally unaligned so to verify that pthread_getattr_np returns an
+     aligned stacksize that correctly fits into the rlimit.  We don't bother
+     about the case where the stack is limited by the vma below it and not by
+     the rlimit because the stacksize returned in that case is computed from
+     the end of that vma and is hence safe.  */
+  stack_limit.rlim_cur = stacksize - 4095;
   printf ("Adjusting RLIMIT_STACK to %zu\n", stack_limit.rlim_cur);
   if ((ret = setrlimit (RLIMIT_STACK, &stack_limit)))
     {
@@ -125,10 +100,7 @@ check_stack_top (void)
 
   printf ("Adjusted rlimit: stacksize=%zu, stackaddr=%p\n", stacksize,
           stackaddr);
-
-  /* So that the compiler does not optimize out this call.  */
-  stackaddr = allocate_and_test (stackaddr);
-  assert (*(int *)stackaddr == 42);
+  allocate_and_test (stackaddr);
 
   puts ("Stack top tests done");
 

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

Summary of changes:
 nptl/ChangeLog             |    4 +++
 nptl/tst-pthread-getattr.c |   52 ++++++++++---------------------------------
 2 files changed, 16 insertions(+), 40 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]