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

r6207 - in glibc-package/trunk/debian: . patches/kfreebsd testsuite-checking



Author: ps-guest
Date: 2014-07-12 10:47:31 +0000 (Sat, 12 Jul 2014)
New Revision: 6207

Modified:
   glibc-package/trunk/debian/changelog
   glibc-package/trunk/debian/patches/kfreebsd/local-fbtl.diff
   glibc-package/trunk/debian/patches/kfreebsd/local-sysdeps.diff
   glibc-package/trunk/debian/testsuite-checking/expected-results-i586-kfreebsd-gnu-libc
   glibc-package/trunk/debian/testsuite-checking/expected-results-i686-kfreebsd-gnu-i386
   glibc-package/trunk/debian/testsuite-checking/expected-results-i686-kfreebsd-gnu-i686
   glibc-package/trunk/debian/testsuite-checking/expected-results-x86_64-kfreebsd-gnu-libc
Log:
* kfreebsd/local-sysdeps.diff: update to revision 5490 (from glibc-bsd).
* kfreebsd/local-fbtl.diff: likewise.
* update testsuite-checking/expected-results-*-kfreebsd-gnu-*



Modified: glibc-package/trunk/debian/changelog
===================================================================
--- glibc-package/trunk/debian/changelog	2014-07-10 21:12:23 UTC (rev 6206)
+++ glibc-package/trunk/debian/changelog	2014-07-12 10:47:31 UTC (rev 6207)
@@ -14,6 +14,11 @@
   * debian/rules.d/debhelper.mk: fix dh_strip call in stage1.  Closes: 
     #754350.
 
+  [ Petr Salinger ]
+  * kfreebsd/local-sysdeps.diff: update to revision 5490 (from glibc-bsd).
+  * kfreebsd/local-fbtl.diff: likewise.
+  * update testsuite-checking/expected-results-*-kfreebsd-gnu-*
+
  -- Aurelien Jarno <aurel32@debian.org>  Sun, 06 Jul 2014 22:34:19 +0200
 
 glibc (2.19-5) unstable; urgency=medium

Modified: glibc-package/trunk/debian/patches/kfreebsd/local-fbtl.diff
===================================================================
--- glibc-package/trunk/debian/patches/kfreebsd/local-fbtl.diff	2014-07-10 21:12:23 UTC (rev 6206)
+++ glibc-package/trunk/debian/patches/kfreebsd/local-fbtl.diff	2014-07-12 10:47:31 UTC (rev 6207)
@@ -22114,7 +22114,7 @@
 +#endif
 --- /dev/null
 +++ b/fbtl/pthread_cond_broadcast.c
-@@ -0,0 +1,97 @@
+@@ -0,0 +1,98 @@
 +/* Copyright (C) 2003-2013 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
 +   Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
@@ -22202,6 +22202,7 @@
 +#endif
 +wake_all:
 +      lll_futex_wake (&cond->__data.__futex, INT_MAX, pshared);
++      return 0;
 +    }
 +
 +  /* We are done.  */
@@ -41128,7 +41129,7 @@
 +#include "../test-skeleton.c"
 --- /dev/null
 +++ b/fbtl/tst-cancel-wrappers.sh
-@@ -0,0 +1,93 @@
+@@ -0,0 +1,92 @@
 +#! /bin/sh
 +# Test whether all cancelable functions are cancelable.
 +# Copyright (C) 2002-2013 Free Software Foundation, Inc.
@@ -41185,7 +41186,6 @@
 +C["sigsuspend"]=1
 +C["sigwait"]=1
 +C["sigwaitinfo"]=1
-+C["system"]=1
 +C["tcdrain"]=1
 +C["wait"]=1
 +C["waitid"]=1

Modified: glibc-package/trunk/debian/patches/kfreebsd/local-sysdeps.diff
===================================================================
--- glibc-package/trunk/debian/patches/kfreebsd/local-sysdeps.diff	2014-07-10 21:12:23 UTC (rev 6206)
+++ glibc-package/trunk/debian/patches/kfreebsd/local-sysdeps.diff	2014-07-12 10:47:31 UTC (rev 6207)
@@ -9994,8 +9994,8 @@
 +#include <fbtl/pthread_mutex_lock.c>
 --- /dev/null
 +++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/pthread_once.c
-@@ -0,0 +1,93 @@
-+/* Copyright (C) 2003-2013 Free Software Foundation, Inc.
+@@ -0,0 +1,131 @@
++/* Copyright (C) 2003-2014 Free Software Foundation, Inc.
 +   This file is part of the GNU C Library.
 +   Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
 +
@@ -10015,6 +10015,7 @@
 +
 +#include "pthreadP.h"
 +#include <lowlevellock.h>
++#include <atomic.h>
 +
 +
 +unsigned long int __fork_generation attribute_hidden;
@@ -10025,11 +10026,33 @@
 +{
 +  pthread_once_t *once_control = (pthread_once_t *) arg;
 +
++  /* Reset to the uninitialized state here.  We don't need a stronger memory
++     order because we do not need to make any other of our writes visible to
++     other threads that see this value: This function will be called if we
++     get interrupted (see __pthread_once), so all we need to relay to other
++     threads is the state being reset again.  */
 +  *once_control = 0;
 +  lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE);
 +}
 +
 +
++/* This is similar to a lock implementation, but we distinguish between three
++   states: not yet initialized (0), initialization finished (2), and
++   initialization in progress (__fork_generation | 1).  If in the first state,
++   threads will try to run the initialization by moving to the second state;
++   the first thread to do so via a CAS on once_control runs init_routine,
++   other threads block.
++   When forking the process, some threads can be interrupted during the second
++   state; they won't be present in the forked child, so we need to restart
++   initialization in the child.  To distinguish an in-progress initialization
++   from an interrupted initialization (in which case we need to reclaim the
++   lock), we look at the fork generation that's part of the second state: We
++   can reclaim iff it differs from the current fork generation.
++   XXX: This algorithm has an ABA issue on the fork generation: If an
++   initialization is interrupted, we then fork 2^30 times (30 bits of
++   once_control are used for the fork generation), and try to initialize
++   again, we can deadlock because we can't distinguish the in-progress and
++   interrupted cases anymore.  */
 +int
 +__pthread_once (once_control, init_routine)
 +     pthread_once_t *once_control;
@@ -10039,26 +10062,38 @@
 +    {
 +      int oldval, val, newval;
 +
++      /* We need acquire memory order for this load because if the value
++         signals that initialization has finished, we need to be see any
++         data modifications done during initialization.  */
 +      val = *once_control;
++      atomic_read_barrier();
 +      do
 +	{
-+	  /* Check if the initialized has already been done.  */
-+	  if ((val & 2) != 0)
++	  /* Check if the initialization has already been done.  */
++	  if (__glibc_likely ((val & 2) != 0))
 +	    return 0;
 +
 +	  oldval = val;
-+	  newval = (oldval & 3) | __fork_generation | 1;
++	  /* We try to set the state to in-progress and having the current
++	     fork generation.  We don't need atomic accesses for the fork
++	     generation because it's immutable in a particular process, and
++	     forked child processes start with a single thread that modified
++	     the generation.  */
++	  newval = __fork_generation | 1;
++	  /* We need acquire memory order here for the same reason as for the
++	     load from once_control above.  */
 +	  val = atomic_compare_and_exchange_val_acq (once_control, newval,
 +						     oldval);
 +	}
-+      while (__builtin_expect (val != oldval, 0));
++      while (__glibc_unlikely (val != oldval));
 +
 +      /* Check if another thread already runs the initializer.	*/
 +      if ((oldval & 1) != 0)
 +	{
-+	  /* Check whether the initializer execution was interrupted
-+	     by a fork.	 */
-+	  if (((oldval ^ newval) & -4) == 0)
++	  /* Check whether the initializer execution was interrupted by a
++	     fork.  We know that for both values, bit 0 is set and bit 1 is
++	     not.  */
++	  if (oldval == newval)
 +	    {
 +	      /* Same generation, some other thread was faster. Wait.  */
 +	      lll_futex_wait (once_control, newval, LLL_PRIVATE);
@@ -10076,8 +10111,11 @@
 +      pthread_cleanup_pop (0);
 +
 +
-+      /* Add one to *once_control.  */
-+      atomic_increment (once_control);
++      /* Mark *once_control as having finished the initialization.  We need
++         release memory order here because we need to synchronize with other
++         threads that want to use the initialized data.  */
++      atomic_write_barrier();
++      *once_control = 2;
 +
 +      /* Wake up all other threads.  */
 +      lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE);

Modified: glibc-package/trunk/debian/testsuite-checking/expected-results-i586-kfreebsd-gnu-libc
===================================================================
--- glibc-package/trunk/debian/testsuite-checking/expected-results-i586-kfreebsd-gnu-libc	2014-07-10 21:12:23 UTC (rev 6206)
+++ glibc-package/trunk/debian/testsuite-checking/expected-results-i586-kfreebsd-gnu-libc	2014-07-12 10:47:31 UTC (rev 6207)
@@ -33,8 +33,6 @@
 #
 #   AT_EXECFN is unsupported
 tst-auxv.o, Error 1
-#   system() is only partially wrapped, the fork is not cancel point
-tst-cancel-wrappers.out, Error 1
 #   probably due to kernel
 tst-shm.out, Error 1
 #

Modified: glibc-package/trunk/debian/testsuite-checking/expected-results-i686-kfreebsd-gnu-i386
===================================================================
--- glibc-package/trunk/debian/testsuite-checking/expected-results-i686-kfreebsd-gnu-i386	2014-07-10 21:12:23 UTC (rev 6206)
+++ glibc-package/trunk/debian/testsuite-checking/expected-results-i686-kfreebsd-gnu-i386	2014-07-12 10:47:31 UTC (rev 6207)
@@ -35,8 +35,6 @@
 #
 #   AT_EXECFN is unsupported
 tst-auxv.o, Error 1
-#   system() is only partially wrapped, the fork is not cancel point
-tst-cancel-wrappers.out, Error 1
 #   probably due to kernel
 tst-shm.out, Error 1
 #

Modified: glibc-package/trunk/debian/testsuite-checking/expected-results-i686-kfreebsd-gnu-i686
===================================================================
--- glibc-package/trunk/debian/testsuite-checking/expected-results-i686-kfreebsd-gnu-i686	2014-07-10 21:12:23 UTC (rev 6206)
+++ glibc-package/trunk/debian/testsuite-checking/expected-results-i686-kfreebsd-gnu-i686	2014-07-12 10:47:31 UTC (rev 6207)
@@ -33,8 +33,6 @@
 #
 #   AT_EXECFN is unsupported
 tst-auxv.o, Error 1
-#   system() is only partially wrapped, the fork is not cancel point
-tst-cancel-wrappers.out, Error 1
 #   probably due to kernel
 tst-shm.out, Error 1
 #

Modified: glibc-package/trunk/debian/testsuite-checking/expected-results-x86_64-kfreebsd-gnu-libc
===================================================================
--- glibc-package/trunk/debian/testsuite-checking/expected-results-x86_64-kfreebsd-gnu-libc	2014-07-10 21:12:23 UTC (rev 6206)
+++ glibc-package/trunk/debian/testsuite-checking/expected-results-x86_64-kfreebsd-gnu-libc	2014-07-12 10:47:31 UTC (rev 6207)
@@ -34,8 +34,6 @@
 #
 #   AT_EXECFN is unsupported
 tst-auxv.o, Error 1
-#   system() is only partially wrapped, the fork is not cancel point
-tst-cancel-wrappers.out, Error 1
 #   probably due to kernel
 tst-shm.out, Error 1
 #


Reply to: