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

[Commits] r22780 - in /fsf/trunk/libc: ./ benchtests/ math/ sysdeps/i386/fpu/ sysdeps/ieee754/dbl-64/ sysdeps/posix/ sysdeps/powerpc/ ...



Author: eglibc
Date: Thu Apr  4 00:02:06 2013
New Revision: 22780

Log:
Import glibc-mainline for 2013-04-04

Added:
    fsf/trunk/libc/benchtests/atan-inputs
    fsf/trunk/libc/benchtests/slowatan-inputs
    fsf/trunk/libc/benchtests/slowatan.c
Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/NEWS
    fsf/trunk/libc/Rules
    fsf/trunk/libc/benchtests/Makefile
    fsf/trunk/libc/math/libm-test.inc
    fsf/trunk/libc/math/s_cexp.c
    fsf/trunk/libc/math/s_cexpf.c
    fsf/trunk/libc/math/s_cexpl.c
    fsf/trunk/libc/sysdeps/i386/fpu/math-tests.h
    fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpa.h
    fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpatan.c
    fsf/trunk/libc/sysdeps/posix/getaddrinfo.c
    fsf/trunk/libc/sysdeps/powerpc/math-tests.h
    fsf/trunk/libc/sysdeps/unix/sysv/linux/kernel-features.h
    fsf/trunk/libc/sysdeps/unix/sysv/linux/pathconf.c

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Thu Apr  4 00:02:06 2013
@@ -1,3 +1,48 @@
+2013-04-03  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	[BZ #14478]
+	* math/s_cexp.c (__cexp): Ensure underflow exception occurs for
+	underflowed result.
+	* math/s_cexpf.c (__cexpf): Likewise.
+	* math/s_cexpl.c (__cexpl): Likewise.
+	* math/libm-test.inc (cexp_test): Add more tests.
+
+2013-04-03  Andreas Schwab  <schwab@xxxxxxx>
+
+	[BZ #15330]
+	* sysdeps/posix/getaddrinfo.c (getaddrinfo): Allocate results and
+	order arrays from heap if bigger than alloca cutoff.
+
+2013-04-03  Thomas Schwinge  <thomas@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/i386/fpu/math-tests.h (SNAN_TESTS_float)
+	(SNAN_TESTS_double): Refer to GCC PR56831.
+	* sysdeps/powerpc/math-tests.h (SNAN_TESTS_TYPE_CAST): Refer to
+	GCC PR56828.
+
+2013-04-03  Siddhesh Poyarekar  <siddhesh@xxxxxxxxxx>
+
+	* Rules (bench): Move bench.out after the run is complete.
+
+	* Rules (bench): Echo currently running benchmark.
+
+	* benchtests/Makefile (bench): Add atan and slowatan.
+	* benchtests/atan-inputs: New file.
+	* benchtests/slowatan-inputs: New file.
+	* benchtests/slowatan.c: New file.
+
+	* sysdeps/ieee754/dbl-64/mpa.h (TWO): Remove definition.
+	* sysdeps/ieee754/dbl-64/mpatan.c (__mpatan): Replace TWO with
+	its value.
+
+	[BZ #15305]
+	* sysdeps/unix/sysv/linux/kernel-features.h
+	[__LINUX_KERNEL_VERSION >= 0x02061d]: Define
+	__ASSUME_XFS_RESTRICTED_CHOWN.
+	* sysdeps/unix/sysv/linux/pathconf.c
+	(__statfs_chown_restricted) [!__ASSUME_XFS_RESTRICTED_CHOWN]:
+	Save and restore errno.
+
 2013-04-02  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
 
 	[BZ #15327]

Modified: fsf/trunk/libc/NEWS
==============================================================================
--- fsf/trunk/libc/NEWS (original)
+++ fsf/trunk/libc/NEWS Thu Apr  4 00:02:06 2013
@@ -10,9 +10,16 @@
 * The following bugs are resolved with this release:
 
   10357, 11120, 11561, 12723, 13550, 13889, 13951, 14142, 14176, 14200,
-  14317, 14327, 14496, 14812, 14920, 14964, 14981, 14982, 14985, 14994,
-  14996, 15003, 15006, 15020, 15023, 15036, 15054, 15055, 15062, 15078,
-  15160, 15214, 15232, 15234, 15283, 15285, 15287, 15304, 15307, 15327.
+  14317, 14327, 14478, 14496, 14812, 14920, 14964, 14981, 14982, 14985,
+  14994, 14996, 15003, 15006, 15020, 15023, 15036, 15054, 15055, 15062,
+  15078, 15160, 15214, 15232, 15234, 15283, 15285, 15287, 15304, 15305,
+  15307, 15327, 15330.
+
+* CVE-2013-0242 Buffer overrun in regexp matcher has been fixed (Bugzilla
+  #15078).
+
+* CVE-2013-1914 Stack overflow in getaddrinfo with many results has been
+  fixed (Bugzilla #15330).
 
 * Add support for calling C++11 thread_local object destructors on thread
   and program exit.  This needs compiler support for offloading C++11

Modified: fsf/trunk/libc/Rules
==============================================================================
--- fsf/trunk/libc/Rules (original)
+++ fsf/trunk/libc/Rules Thu Apr  4 00:02:06 2013
@@ -197,12 +197,14 @@
 	    $($*-ENV) $(run-via-rtld-prefix) $${run}
 
 bench: $(binaries-bench)
+	for run in $^; do \
+	  echo "Running $${run}"; \
+	  eval $(run-bench) >>  $(objpfx)bench.out-tmp; \
+	done; \
 	if [ -f $(objpfx)bench.out ]; then \
 	  mv -f $(objpfx)bench.out $(objpfx)bench.out.old; \
-	fi
-	for run in $^; do \
-	  eval $(run-bench) >>  $(objpfx)bench.out; \
-	done
+	fi; \
+	mv -f $(objpfx)bench.out-tmp $(objpfx)bench.out
 
 $(binaries-bench): %: %.o \
   $(sort $(filter $(common-objpfx)lib%,$(link-libc))) \

Modified: fsf/trunk/libc/benchtests/Makefile
==============================================================================
--- fsf/trunk/libc/benchtests/Makefile (original)
+++ fsf/trunk/libc/benchtests/Makefile Thu Apr  4 00:02:06 2013
@@ -45,7 +45,7 @@
 #   See pow-inputs for an example.
 
 subdir := benchtests
-bench := exp pow rint sin slowexp slowpow slowsin
+bench := exp pow rint sin atan slowexp slowpow slowsin slowatan
 
 # exp function fast path
 exp-ITER = 5e8
@@ -77,6 +77,12 @@
 sin-RET = double
 LDFLAGS-bench-sin = -lm
 
+# atan function fast path
+atan-ITER = 6e9
+atan-ARGLIST = double
+atan-RET = double
+LDFLAGS-bench-atan = -lm
+
 # pow function slowest path
 slowpow-ITER = 1e5
 slowpow-ARGLIST = double:double
@@ -91,5 +97,12 @@
 slowsin-INCLUDE = slowsin.c
 LDFLAGS-bench-slowsin = -lm
 
+# atan function slowest path
+slowatan-ITER = 3e8
+slowatan-ARGLIST = double
+slowatan-RET = double
+slowatan-INCLUDE = slowatan.c
+LDFLAGS-bench-slowatan = -lm
+
 include ../Makeconfig
 include ../Rules

Added: fsf/trunk/libc/benchtests/atan-inputs
==============================================================================
--- fsf/trunk/libc/benchtests/atan-inputs (added)
+++ fsf/trunk/libc/benchtests/atan-inputs Thu Apr  4 00:02:06 2013
@@ -1,0 +1,3 @@
+0x1.000000c5cba86p0
+0x1.000001883003ap0
+0x1.00000dfb2b674p0

Added: fsf/trunk/libc/benchtests/slowatan-inputs
==============================================================================
--- fsf/trunk/libc/benchtests/slowatan-inputs (added)
+++ fsf/trunk/libc/benchtests/slowatan-inputs Thu Apr  4 00:02:06 2013
@@ -1,0 +1,3 @@
+0x1.000000c5cba87p0
+0x1.000001883003bp0
+0x1.00000dfb2b675p0

Added: fsf/trunk/libc/benchtests/slowatan.c
==============================================================================
--- fsf/trunk/libc/benchtests/slowatan.c (added)
+++ fsf/trunk/libc/benchtests/slowatan.c Thu Apr  4 00:02:06 2013
@@ -1,0 +1,19 @@
+/* Define slowatan.
+   Copyright (C) 2013 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
+   <http://www.gnu.org/licenses/>.  */
+
+#define slowatan atan

Modified: fsf/trunk/libc/math/libm-test.inc
==============================================================================
--- fsf/trunk/libc/math/libm-test.inc (original)
+++ fsf/trunk/libc/math/libm-test.inc Thu Apr  4 00:02:06 2013
@@ -4794,6 +4794,9 @@
   TEST_c_c (cexp, 1e6, min_value, plus_infty, plus_infty, OVERFLOW_EXCEPTION);
   TEST_c_c (cexp, 1e6, -min_value, plus_infty, minus_infty, OVERFLOW_EXCEPTION);
 
+  TEST_c_c (cexp, min_value, min_subnorm_value, 1.0, min_subnorm_value, UNDERFLOW_EXCEPTION);
+  TEST_c_c (cexp, min_value, -min_subnorm_value, 1.0, -min_subnorm_value, UNDERFLOW_EXCEPTION);
+
   END (cexp, complex);
 }
 

Modified: fsf/trunk/libc/math/s_cexp.c
==============================================================================
--- fsf/trunk/libc/math/s_cexp.c (original)
+++ fsf/trunk/libc/math/s_cexp.c Thu Apr  4 00:02:06 2013
@@ -74,6 +74,18 @@
 	      __real__ retval = exp_val * cosix;
 	      __imag__ retval = exp_val * sinix;
 	    }
+	  if (fabs (__real__ retval) < DBL_MIN)
+	    {
+	      volatile double force_underflow
+		= __real__ retval * __real__ retval;
+	      (void) force_underflow;
+	    }
+	  if (fabs (__imag__ retval) < DBL_MIN)
+	    {
+	      volatile double force_underflow
+		= __imag__ retval * __imag__ retval;
+	      (void) force_underflow;
+	    }
 	}
       else
 	{

Modified: fsf/trunk/libc/math/s_cexpf.c
==============================================================================
--- fsf/trunk/libc/math/s_cexpf.c (original)
+++ fsf/trunk/libc/math/s_cexpf.c Thu Apr  4 00:02:06 2013
@@ -74,6 +74,18 @@
 	      __real__ retval = exp_val * cosix;
 	      __imag__ retval = exp_val * sinix;
 	    }
+	  if (fabsf (__real__ retval) < FLT_MIN)
+	    {
+	      volatile float force_underflow
+		= __real__ retval * __real__ retval;
+	      (void) force_underflow;
+	    }
+	  if (fabsf (__imag__ retval) < FLT_MIN)
+	    {
+	      volatile float force_underflow
+		= __imag__ retval * __imag__ retval;
+	      (void) force_underflow;
+	    }
 	}
       else
 	{

Modified: fsf/trunk/libc/math/s_cexpl.c
==============================================================================
--- fsf/trunk/libc/math/s_cexpl.c (original)
+++ fsf/trunk/libc/math/s_cexpl.c Thu Apr  4 00:02:06 2013
@@ -74,6 +74,18 @@
 	      __real__ retval = exp_val * cosix;
 	      __imag__ retval = exp_val * sinix;
 	    }
+	  if (fabsl (__real__ retval) < LDBL_MIN)
+	    {
+	      volatile long double force_underflow
+		= __real__ retval * __real__ retval;
+	      (void) force_underflow;
+	    }
+	  if (fabsl (__imag__ retval) < LDBL_MIN)
+	    {
+	      volatile long double force_underflow
+		= __imag__ retval * __imag__ retval;
+	      (void) force_underflow;
+	    }
 	}
       else
 	{

Modified: fsf/trunk/libc/sysdeps/i386/fpu/math-tests.h
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/fpu/math-tests.h (original)
+++ fsf/trunk/libc/sysdeps/i386/fpu/math-tests.h Thu Apr  4 00:02:06 2013
@@ -19,7 +19,8 @@
 /* On 32-bit x86, versions of GCC up to at least 4.8 are happy to use FPU load
    instructions for sNaN values, and loading a float or double sNaN value will
    already raise an INVALID exception as well as turn the sNaN into a qNaN,
-   rendering certain tests infeasible in this scenario.  */
+   rendering certain tests infeasible in this scenario.
+   <http://gcc.gnu.org/PR56831>.  */
 #define SNAN_TESTS_float	0
 #define SNAN_TESTS_double	0
 

Modified: fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpa.h
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpa.h (original)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpa.h Thu Apr  4 00:02:06 2013
@@ -91,8 +91,6 @@
 # define  TWO52     0x1.0p52		/* 2^52    */
 #endif
 
-#define  TWO       2.0			/*  2      */
-
 #define  TWO5      TWOPOW (5)		/* 2^5     */
 #define  TWO8      TWOPOW (8)		/* 2^52    */
 #define  TWO10     TWOPOW (10)		/* 2^10    */

Modified: fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpatan.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpatan.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/mpatan.c Thu Apr  4 00:02:06 2013
@@ -102,7 +102,7 @@
   __dvd (&mpsm, &mptwoim1, &mpt, p);
   for (i = n - 1; i > 1; i--)
     {
-      mptwoim1.d[1] -= TWO;
+      mptwoim1.d[1] -= 2;
       __dvd (&mpsm, &mptwoim1, &mpt1, p);
       __mul (&mpsm, &mpt, &mpt2, p);
       __sub (&mpt1, &mpt2, &mpt, p);

Modified: fsf/trunk/libc/sysdeps/posix/getaddrinfo.c
==============================================================================
--- fsf/trunk/libc/sysdeps/posix/getaddrinfo.c (original)
+++ fsf/trunk/libc/sysdeps/posix/getaddrinfo.c Thu Apr  4 00:02:06 2013
@@ -2489,11 +2489,27 @@
       __typeof (once) old_once = once;
       __libc_once (once, gaiconf_init);
       /* Sort results according to RFC 3484.  */
-      struct sort_result results[nresults];
-      size_t order[nresults];
+      struct sort_result *results;
+      size_t *order;
       struct addrinfo *q;
       struct addrinfo *last = NULL;
       char *canonname = NULL;
+      bool malloc_results;
+
+      malloc_results
+	= !__libc_use_alloca (nresults * (sizeof (*results) + sizeof (size_t)));
+      if (malloc_results)
+	{
+	  results = malloc (nresults * (sizeof (*results) + sizeof (size_t)));
+	  if (results == NULL)
+	    {
+	      __free_in6ai (in6ai);
+	      return EAI_MEMORY;
+	    }
+	}
+      else
+	results = alloca (nresults * (sizeof (*results) + sizeof (size_t)));
+      order = (size_t *) (results + nresults);
 
       /* Now we definitely need the interface information.  */
       if (! check_pf_called)
@@ -2664,6 +2680,9 @@
 
       /* Fill in the canonical name into the new first entry.  */
       p->ai_canonname = canonname;
+
+      if (malloc_results)
+	free (results);
     }
 
   __free_in6ai (in6ai);

Modified: fsf/trunk/libc/sysdeps/powerpc/math-tests.h
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/math-tests.h (original)
+++ fsf/trunk/libc/sysdeps/powerpc/math-tests.h Thu Apr  4 00:02:06 2013
@@ -20,7 +20,8 @@
    a IEEE 754-2008 general-computational convertFormat operation (IEEE
    754-2008, 5.4.2) -- does not turn a sNaN into a qNaN (whilst raising an
    INVALID exception), which is contrary to IEEE 754-2008 5.1 and 7.2.  This
-   renders certain tests infeasible in this scenario.  */
+   renders certain tests infeasible in this scenario.
+   <http://gcc.gnu.org/PR56828>.  */
 #define SNAN_TESTS_TYPE_CAST	0
 
 #include_next <math-tests.h>

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/kernel-features.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/kernel-features.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/kernel-features.h Thu Apr  4 00:02:06 2013
@@ -221,3 +221,9 @@
 #if defined __x86_64__ && __LINUX_KERNEL_VERSION >= 0x030100
 # define __ASSUME_GETCPU_SYSCALL	1
 #endif
+
+/* 2.6.29 removed the XFS restricted_chown sysctl, so it is pointless looking
+   for it in newer kernels.  */
+#if __LINUX_KERNEL_VERSION >= 0x02061d
+# define __ASSUME_XFS_RESTRICTED_CHOWN 1
+#endif

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/pathconf.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/pathconf.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/pathconf.c Thu Apr  4 00:02:06 2013
@@ -289,11 +289,16 @@
       return -1;
     }
 
+#if __ASSUME_XFS_RESTRICTED_CHOWN
+  return 1;
+#else
   int fd;
+  int save_errno;
   long int retval = 1;
   switch (fsbuf->f_type)
     {
     case XFS_SUPER_MAGIC:
+      save_errno = errno;
       /* Read the value from /proc/sys/fs/xfs/restrict_chown.  If we cannot
 	 read it default to assume the restriction is in place.  */
       fd = open_not_cancel_2 ("/proc/sys/fs/xfs/restrict_chown", O_RDONLY);
@@ -306,6 +311,7 @@
 
 	  close_not_cancel_no_status (fd);
 	}
+      __set_errno (save_errno);
       break;
 
     default:
@@ -313,4 +319,5 @@
     }
 
   return retval;
-}
+#endif
+}

_______________________________________________
Commits mailing list
Commits@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/commits