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-317-g739e14f


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  739e14f9009ff91e4a8d01776e7269fc8cbd0293 (commit)
       via  ce193f551ec21df85c934626a21730881484dcf0 (commit)
      from  ae9166f2b8936304ea347a98519372804963447f (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=739e14f9009ff91e4a8d01776e7269fc8cbd0293

commit 739e14f9009ff91e4a8d01776e7269fc8cbd0293
Author: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
Date:   Fri Oct 28 18:31:24 2016 -0200

    Document a behavior of an elided pthread_rwlock_unlock
    
    Explain that pthread_rwlock_unlock may crash if called on a lock not
    held by the current thread.

diff --git a/ChangeLog b/ChangeLog
index 4f76008..d5b3f7b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2016-10-28  Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>
 
+	* nptl/pthread_rwlock_unlock.c: Add a comment explaining its
+	behavior when eliding a lock not held by the current thread.
+	* sysdeps/powerpc/nptl/elide.h: Likewise.
+
+2016-10-28  Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>
+
 	[BZ #20728]
 	* sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: Replace a
 	branch to _exit() by a function call.
diff --git a/nptl/pthread_rwlock_unlock.c b/nptl/pthread_rwlock_unlock.c
index a6cadd4..112f748 100644
--- a/nptl/pthread_rwlock_unlock.c
+++ b/nptl/pthread_rwlock_unlock.c
@@ -35,6 +35,10 @@ __pthread_rwlock_unlock (pthread_rwlock_t *rwlock)
 
   LIBC_PROBE (rwlock_unlock, 1, rwlock);
 
+  /* Trying to elide an unlocked lock may crash the process.  This
+     is expected and is compatible with POSIX.1-2008: "results are
+     undefined if the read-write lock rwlock is not held by the
+     calling thread".  */
   if (ELIDE_UNLOCK (rwlock->__data.__writer == 0
 		    && rwlock->__data.__nr_readers == 0))
     return 0;
diff --git a/sysdeps/powerpc/nptl/elide.h b/sysdeps/powerpc/nptl/elide.h
index 77bd82e..835fd92 100644
--- a/sysdeps/powerpc/nptl/elide.h
+++ b/sysdeps/powerpc/nptl/elide.h
@@ -102,6 +102,9 @@ __elide_unlock (int is_lock_free)
 {
   if (is_lock_free)
     {
+      /* This code is expected to crash when trying to unlock a lock not
+	 held by this thread.  More information is available in the
+	 __pthread_rwlock_unlock() implementation.  */
       __libc_tend (0);
       return true;
     }

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

commit ce193f551ec21df85c934626a21730881484dcf0
Author: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
Date:   Fri Oct 21 15:19:10 2016 -0200

    powerpc: Fix TOC stub on powerpc64 clone()
    
    Use a function call to _exit() so that the linker can create a TOC stub
    instead of just a branch.
    
    Tested on powerpc64.

diff --git a/ChangeLog b/ChangeLog
index 27a0194..4f76008 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-10-28  Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>
+
+	[BZ #20728]
+	* sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: Replace a
+	branch to _exit() by a function call.
+
 2016-10-28  Florian Weimer  <fweimer@redhat.com>
 
 	* malloc/malloc.c: Update chunk layout comments.
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S
index 7c59b9b..df824f5 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S
@@ -97,7 +97,7 @@ L(oldpid):
 #ifdef SHARED
 	b	JUMPTARGET(__GI__exit)
 #else
-	b	JUMPTARGET(_exit)
+	bl	JUMPTARGET(_exit)
 	/* We won't ever get here but provide a nop so that the linker
 	   will insert a toc adjusting stub if necessary.  */
 	nop

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

Summary of changes:
 ChangeLog                                         |   12 ++++++++++++
 nptl/pthread_rwlock_unlock.c                      |    4 ++++
 sysdeps/powerpc/nptl/elide.h                      |    3 +++
 sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S |    2 +-
 4 files changed, 20 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]