From 6addb61a1659cd2f2fefb4e3ab238f49b8f99d1a2855360039eb0f12b77a500a Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Mon, 7 Apr 2014 13:52:06 +0000 Subject: [PATCH] Accepting request 229286 from home:Andreas_Schwab:Factory - pthread-mutex-destroy.patch: Remove - pthread-mutex-trylock-elision.patch: Properly handle forced elision in pthread_mutex_trylock (bnc#865968, BZ #16657) OBS-URL: https://build.opensuse.org/request/show/229286 OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=358 --- glibc-testsuite.changes | 7 ++++ glibc-testsuite.spec | 4 +- glibc-utils.changes | 7 ++++ glibc-utils.spec | 4 +- glibc.changes | 7 ++++ glibc.spec | 4 +- pthread-mutex-destroy.patch | 61 ----------------------------- pthread-mutex-trylock-elision.patch | 53 +++++++++++++++++++++++++ 8 files changed, 80 insertions(+), 67 deletions(-) delete mode 100644 pthread-mutex-destroy.patch create mode 100644 pthread-mutex-trylock-elision.patch diff --git a/glibc-testsuite.changes b/glibc-testsuite.changes index f346b76..a98fc17 100644 --- a/glibc-testsuite.changes +++ b/glibc-testsuite.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Apr 7 09:06:32 UTC 2014 - schwab@suse.de + +- pthread-mutex-destroy.patch: Remove +- pthread-mutex-trylock-elision.patch: Properly handle forced elision in + pthread_mutex_trylock (bnc#865968, BZ #16657) + ------------------------------------------------------------------- Thu Apr 3 07:32:24 UTC 2014 - schwab@suse.de diff --git a/glibc-testsuite.spec b/glibc-testsuite.spec index ca9740b..c99df16 100644 --- a/glibc-testsuite.spec +++ b/glibc-testsuite.spec @@ -260,8 +260,8 @@ Patch2001: resolv-dont-ignore-second-answer.patch Patch2002: ldd-system-interp.patch # PATCH-FIX-UPSTREAM Don't close or flush stdio streams on abort (BZ #15436) Patch2003: abort-no-flush.patch -# PATCH-FIX-UPSTREAM Skip checks in pthread_mutex_destroy when doing elision -Patch2004: pthread-mutex-destroy.patch +# PATCH-FIX-UPSTREAM Properly handle forced elision in pthread_mutex_trylock (BZ #16657) +Patch2004: pthread-mutex-trylock-elision.patch # PATCH-FIX-UPSTREAM Fix aarch64 setcontext clobbering alternate signal stack (BZ #16629) Patch2005: aarch64-setcontext.patch diff --git a/glibc-utils.changes b/glibc-utils.changes index f346b76..a98fc17 100644 --- a/glibc-utils.changes +++ b/glibc-utils.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Apr 7 09:06:32 UTC 2014 - schwab@suse.de + +- pthread-mutex-destroy.patch: Remove +- pthread-mutex-trylock-elision.patch: Properly handle forced elision in + pthread_mutex_trylock (bnc#865968, BZ #16657) + ------------------------------------------------------------------- Thu Apr 3 07:32:24 UTC 2014 - schwab@suse.de diff --git a/glibc-utils.spec b/glibc-utils.spec index 92ce4d9..2c981c9 100644 --- a/glibc-utils.spec +++ b/glibc-utils.spec @@ -259,8 +259,8 @@ Patch2001: resolv-dont-ignore-second-answer.patch Patch2002: ldd-system-interp.patch # PATCH-FIX-UPSTREAM Don't close or flush stdio streams on abort (BZ #15436) Patch2003: abort-no-flush.patch -# PATCH-FIX-UPSTREAM Skip checks in pthread_mutex_destroy when doing elision -Patch2004: pthread-mutex-destroy.patch +# PATCH-FIX-UPSTREAM Properly handle forced elision in pthread_mutex_trylock (BZ #16657) +Patch2004: pthread-mutex-trylock-elision.patch # PATCH-FIX-UPSTREAM Fix aarch64 setcontext clobbering alternate signal stack (BZ #16629) Patch2005: aarch64-setcontext.patch diff --git a/glibc.changes b/glibc.changes index f346b76..a98fc17 100644 --- a/glibc.changes +++ b/glibc.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Apr 7 09:06:32 UTC 2014 - schwab@suse.de + +- pthread-mutex-destroy.patch: Remove +- pthread-mutex-trylock-elision.patch: Properly handle forced elision in + pthread_mutex_trylock (bnc#865968, BZ #16657) + ------------------------------------------------------------------- Thu Apr 3 07:32:24 UTC 2014 - schwab@suse.de diff --git a/glibc.spec b/glibc.spec index 720f07a..3ea5f0c 100644 --- a/glibc.spec +++ b/glibc.spec @@ -260,8 +260,8 @@ Patch2001: resolv-dont-ignore-second-answer.patch Patch2002: ldd-system-interp.patch # PATCH-FIX-UPSTREAM Don't close or flush stdio streams on abort (BZ #15436) Patch2003: abort-no-flush.patch -# PATCH-FIX-UPSTREAM Skip checks in pthread_mutex_destroy when doing elision -Patch2004: pthread-mutex-destroy.patch +# PATCH-FIX-UPSTREAM Properly handle forced elision in pthread_mutex_trylock (BZ #16657) +Patch2004: pthread-mutex-trylock-elision.patch # PATCH-FIX-UPSTREAM Fix aarch64 setcontext clobbering alternate signal stack (BZ #16629) Patch2005: aarch64-setcontext.patch diff --git a/pthread-mutex-destroy.patch b/pthread-mutex-destroy.patch deleted file mode 100644 index 4ecd866..0000000 --- a/pthread-mutex-destroy.patch +++ /dev/null @@ -1,61 +0,0 @@ -[PATCH] Skip checks in pthread_mutex_destroy when doing elision - -When doing elisison the __nusers field is not updated, thus can have an -arbitrary value. - - [BZ #16657] - * nptl/pthread_mutex_destroy.c (__pthread_mutex_destroy): Skip - checks when doing elision. - * nptl/sysdeps/unix/sysv/linux/x86/pthread_mutex_destroy.c: New file. - -Index: glibc-2.18/nptl/pthread_mutex_destroy.c -=================================================================== ---- glibc-2.18.orig/nptl/pthread_mutex_destroy.c -+++ glibc-2.18/nptl/pthread_mutex_destroy.c -@@ -21,6 +21,9 @@ - - #include - -+#ifndef DO_ELISION -+# define DO_ELISION(m) 0 -+#endif - - int - __pthread_mutex_destroy (mutex) -@@ -28,7 +31,8 @@ __pthread_mutex_destroy (mutex) - { - LIBC_PROBE (mutex_destroy, 1, mutex); - -- if ((mutex->__data.__kind & PTHREAD_MUTEX_ROBUST_NORMAL_NP) == 0 -+ if (!DO_ELISION (mutex) -+ && (mutex->__data.__kind & PTHREAD_MUTEX_ROBUST_NORMAL_NP) == 0 - && mutex->__data.__nusers != 0) - return EBUSY; - -Index: glibc-2.18/nptl/sysdeps/unix/sysv/linux/x86/pthread_mutex_destroy.c -=================================================================== ---- /dev/null -+++ glibc-2.18/nptl/sysdeps/unix/sysv/linux/x86/pthread_mutex_destroy.c -@@ -0,0 +1,22 @@ -+/* Elided version of pthread_mutex_destroy. -+ Copyright (C) 2014 Free Software Foundation, Inc. -+ This file is part of the GNU C Library. -+ -+ The GNU C Library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ The GNU C Library is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with the GNU C Library; if not, see -+ . */ -+ -+#include -+#include "force-elision.h" -+ -+#include "nptl/pthread_mutex_destroy.c" diff --git a/pthread-mutex-trylock-elision.patch b/pthread-mutex-trylock-elision.patch new file mode 100644 index 0000000..6886125 --- /dev/null +++ b/pthread-mutex-trylock-elision.patch @@ -0,0 +1,53 @@ +[PATCH] Properly handle forced elision in pthread_mutex_trylock + + BZ #16657 + * pthread_mutex_trylock.c (__pthread_mutex_trylock): Use + FORCE_ELISION instead of DO_ELISION. + * sysdeps/unix/sysv/linux/x86/force-elision.h (DO_ELISION): + Remove. +--- + nptl/pthread_mutex_trylock.c | 7 +++---- + nptl/sysdeps/unix/sysv/linux/x86/force-elision.h | 5 ----- + 2 files changed, 3 insertions(+), 9 deletions(-) + +Index: glibc-2.19/nptl/pthread_mutex_trylock.c +=================================================================== +--- glibc-2.19.orig/nptl/pthread_mutex_trylock.c ++++ glibc-2.19/nptl/pthread_mutex_trylock.c +@@ -26,8 +26,8 @@ + #define lll_trylock_elision(a,t) lll_trylock(a) + #endif + +-#ifndef DO_ELISION +-#define DO_ELISION(m) 0 ++#ifndef FORCE_ELISION ++#define FORCE_ELISION(m, s) + #endif + + /* We don't force elision in trylock, because this can lead to inconsistent +@@ -77,8 +77,7 @@ __pthread_mutex_trylock (mutex) + return 0; + + case PTHREAD_MUTEX_TIMED_NP: +- if (DO_ELISION (mutex)) +- goto elision; ++ FORCE_ELISION (mutex, goto elision); + /*FALL THROUGH*/ + case PTHREAD_MUTEX_ADAPTIVE_NP: + case PTHREAD_MUTEX_ERRORCHECK_NP: +Index: glibc-2.19/nptl/sysdeps/unix/sysv/linux/x86/force-elision.h +=================================================================== +--- glibc-2.19.orig/nptl/sysdeps/unix/sysv/linux/x86/force-elision.h ++++ glibc-2.19/nptl/sysdeps/unix/sysv/linux/x86/force-elision.h +@@ -16,11 +16,6 @@ + License along with the GNU C Library; if not, see + . */ + +-/* Check for elision on this lock without upgrading. */ +-#define DO_ELISION(m) \ +- (__pthread_force_elision \ +- && (m->__data.__kind & PTHREAD_MUTEX_NO_ELISION_NP) == 0) \ +- + /* Automatically enable elision for existing user lock kinds. */ + #define FORCE_ELISION(m, s) \ + if (__pthread_force_elision \