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

[commits] r4125 - in /fsf/trunk/libc: ./ iconv/ iconvdata/ localedata/ localedata/locales/ nptl/ sysdeps/x86_64/



Author: eglibc
Date: Thu Nov  8 00:03:05 2007
New Revision: 4125

Log:
Import glibc-mainline for 2007-11-08

Added:
    fsf/trunk/libc/iconvdata/bug-iconv6.c
    fsf/trunk/libc/nptl/tst-basic7.c
Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/iconv/loop.c
    fsf/trunk/libc/iconvdata/Makefile
    fsf/trunk/libc/localedata/ChangeLog
    fsf/trunk/libc/localedata/locales/lo_LA
    fsf/trunk/libc/localedata/locales/ug_CN
    fsf/trunk/libc/nptl/ChangeLog
    fsf/trunk/libc/nptl/Makefile
    fsf/trunk/libc/nptl/allocatestack.c
    fsf/trunk/libc/sysdeps/x86_64/memset.S

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Thu Nov  8 00:03:05 2007
@@ -1,3 +1,15 @@
+2007-11-07  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+	* sysdeps/x86_64/memset.S: Add sfence after movnti.
+
+2007-11-07  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	[BZ #5277]
+	* iconv/loop.c (STANDARD_TO_LOOP_ERR_HANDLER): If conversion failed
+	because output buffer is too small break, don't loop.
+	* iconvdata/Makefile (tests): Add bug-iconv6.
+	* iconvdata/bug-iconv6.c: New file.
+
 2007-11-06  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	* stdio-common/vfprintf.c (vfprintf): Compute necessary buffer size

Modified: fsf/trunk/libc/iconv/loop.c
==============================================================================
--- fsf/trunk/libc/iconv/loop.c (original)
+++ fsf/trunk/libc/iconv/loop.c Thu Nov  8 00:03:05 2007
@@ -225,7 +225,12 @@
       }									      \
     /* If any of them recognized the input continue with the loop.  */	      \
     if (result != __GCONV_ILLEGAL_INPUT)				      \
-      continue;								      \
+      {									      \
+	if (__builtin_expect (result == __GCONV_FULL_OUTPUT, 0))	      \
+	  break;							      \
+									      \
+	continue;							      \
+      }									      \
 									      \
     /* Next see whether we have to ignore the error.  If not, stop.  */	      \
     if (! ignore_errors_p ())						      \

Modified: fsf/trunk/libc/iconvdata/Makefile
==============================================================================
--- fsf/trunk/libc/iconvdata/Makefile (original)
+++ fsf/trunk/libc/iconvdata/Makefile Thu Nov  8 00:03:05 2007
@@ -67,7 +67,7 @@
 
 ifeq (yes,$(build-shared))
 tests = bug-iconv1 bug-iconv2 tst-loading tst-e2big tst-iconv4 bug-iconv4 \
-	tst-iconv6 bug-iconv5
+	tst-iconv6 bug-iconv5 bug-iconv6
 ifeq ($(have-thread-library),yes)
 tests += bug-iconv3
 endif

Added: fsf/trunk/libc/iconvdata/bug-iconv6.c
==============================================================================
--- fsf/trunk/libc/iconvdata/bug-iconv6.c (added)
+++ fsf/trunk/libc/iconvdata/bug-iconv6.c Thu Nov  8 00:03:05 2007
@@ -1,0 +1,52 @@
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <iconv.h>
+#include <locale.h>
+
+static const char testbuf[] = {
+	0xEF, 0xBE, 0x9F, 0xD0, 0xB4, 0xEF, 0xBE, 0x9F, 0x29, 0xEF, 0xBE, 0x8E,
+	0xEF, 0xBE, 0x9F, 0xEF, 0xBD, 0xB6, 0xEF, 0xBD, 0xB0, 0xEF, 0xBE, 0x9D
+};
+
+static int
+do_test (void)
+{
+  setlocale (LC_ALL, "en_US.UTF-8");
+  iconv_t ic = iconv_open ("ISO-2022-JP//TRANSLIT", "UTF-8");
+  if (ic == (iconv_t) -1)
+    {
+      puts ("iconv_open failed");
+      return 1;
+    }
+  size_t outremain = sizeof testbuf;
+  char outbuf[outremain];
+  char *inp = (char *) testbuf;
+  char *outp = outbuf;
+  size_t inremain = sizeof testbuf;
+
+  int ret = iconv (ic, &inp, &inremain, &outp, &outremain);
+
+  int result = 0;
+  if (ret == (size_t) -1)
+    {
+      if (errno == E2BIG)
+	puts ("buffer too small reported.  OK");
+      else
+	{
+	  printf ("iconv failed with %d (%m)\n", errno);
+	  result = 0;
+	}
+    }
+  else
+    {
+      printf ("iconv returned %d\n", ret);
+      result = 1;
+    }
+
+  return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"

Modified: fsf/trunk/libc/localedata/ChangeLog
==============================================================================
--- fsf/trunk/libc/localedata/ChangeLog (original)
+++ fsf/trunk/libc/localedata/ChangeLog Thu Nov  8 00:03:05 2007
@@ -1,3 +1,11 @@
+2007-11-07  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	[BZ #5238]
+	* locales/ug_CN: Fix typo in collating symbol definition.
+
+	[BZ #5237]
+	* locales/lo_LA: Fix typos in collation symbols.
+
 2007-11-06  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	* locales/dz_BT: Fix representation of data.

Modified: fsf/trunk/libc/localedata/locales/lo_LA
==============================================================================
--- fsf/trunk/libc/localedata/locales/lo_LA (original)
+++ fsf/trunk/libc/localedata/locales/lo_LA Thu Nov  8 00:03:05 2007
@@ -602,10 +602,10 @@
 
 <U0EDD>        <U0EDC>;<BLANK>;<BLANK>;<BLANK> % Lao CHARACTER HHOr
 <mhor-e>           "<U0EDD><U0EC0>";<BLANK>;<BLANK>;<BLANK>
-<mor-ae>           "<U0EDD><U0EC1>";<BLANK>;<BLANK>;<BLANK>
-<mor-o>            "<U0EDD><U0EC2>";<BLANK>;<BLANK>;<BLANK>
-<mor-ai-maimuan>   "<U0EDD><U0EC3>";<BLANK>;<BLANK>;<BLANK>
-<mor-ai-maimalai>  "<U0EDD><U0EC4>";<BLANK>;<BLANK>;<BLANK>
+<mhor-ae>          "<U0EDD><U0EC1>";<BLANK>;<BLANK>;<BLANK>
+<mhor-o>           "<U0EDD><U0EC2>";<BLANK>;<BLANK>;<BLANK>
+<mhor-ai-maimuan>  "<U0EDD><U0EC3>";<BLANK>;<BLANK>;<BLANK>
+<mhor-ai-maimalai> "<U0EDD><U0EC4>";<BLANK>;<BLANK>;<BLANK>
 
 
 % order of Lao vowels

Modified: fsf/trunk/libc/localedata/locales/ug_CN
==============================================================================
--- fsf/trunk/libc/localedata/locales/ug_CN (original)
+++ fsf/trunk/libc/localedata/locales/ug_CN Thu Nov  8 00:03:05 2007
@@ -2,7 +2,7 @@
 comment_char %
 %
 % Uyghur language locale for China
-% Source: 
+% Source:
 % Contact: Pablo Saratxaga
 % Email: pablo@xxxxxxxxxxxx
 % Language: ug
@@ -56,8 +56,8 @@
 % U+0224, U+0225 are also similar to ztail and are sorted the same.
 %
 % new arabic writting uses some extra letters too.
-% all vowels are noted, and in beginning of the word there is a 
-% "yeh with hamza" (U+0626) in the front; should it be ignored 
+% all vowels are noted, and in beginning of the word there is a
+% "yeh with hamza" (U+0626) in the front; should it be ignored
 % in sorting?
 %
 % arabic     old latin       turkic (from azeri, which has same phonemes)
@@ -107,7 +107,7 @@
 collating-symbol  <ktail>
 collating-symbol  <ztail>
 collating-symbol  <obar>
-collating-symbol  <udiaresis>
+collating-symbol  <udiaeresis>
 
 collating-element <h,> from "<U0068><U0321>"
 collating-element <H,> from "<U0048><U0321>"
@@ -238,7 +238,7 @@
 <U06D0> <ar_e>;<BAS>;<MIN>;IGNORE
 <U06CC> <ar_i>;<BAS>;<MIN>;IGNORE
 <U064A> <ar_y>;<BAS>;<MIN>;IGNORE
- 
+
 reorder-end
 
 END LC_COLLATE
@@ -330,4 +330,3 @@
 % FIXME
 copy "en_DK"
 END LC_ADDRESS
-

Modified: fsf/trunk/libc/nptl/ChangeLog
==============================================================================
--- fsf/trunk/libc/nptl/ChangeLog (original)
+++ fsf/trunk/libc/nptl/ChangeLog Thu Nov  8 00:03:05 2007
@@ -1,3 +1,11 @@
+2007-11-07  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	[BZ #5245]
+	* allocatestack.c (allocate_stack): Change ENOMEM error in case
+	mmap failed to EAGAIN.
+	* Makefile (tests): Add tst-basic7.
+	* tst-basic7.c: New file.
+
 2007-11-05  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	* sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):

Modified: fsf/trunk/libc/nptl/Makefile
==============================================================================
--- fsf/trunk/libc/nptl/Makefile (original)
+++ fsf/trunk/libc/nptl/Makefile Thu Nov  8 00:03:05 2007
@@ -222,6 +222,7 @@
 	tst-barrier1 tst-barrier2 tst-barrier3 tst-barrier4 \
 	tst-align tst-align2 tst-align3 \
 	tst-basic1 tst-basic2 tst-basic3 tst-basic4 tst-basic5 tst-basic6 \
+	tst-basic7 \
 	tst-kill1 tst-kill2 tst-kill3 tst-kill4 tst-kill5 tst-kill6 \
 	tst-raise1 \
 	tst-join1 tst-join2 tst-join3 tst-join4 tst-join5 tst-join6 \

Modified: fsf/trunk/libc/nptl/allocatestack.c
==============================================================================
--- fsf/trunk/libc/nptl/allocatestack.c (original)
+++ fsf/trunk/libc/nptl/allocatestack.c Thu Nov  8 00:03:05 2007
@@ -462,7 +462,12 @@
 	      mem = ARCH_RETRY_MMAP (size);
 	      if (__builtin_expect (mem == MAP_FAILED, 0))
 #endif
-		return errno;
+		{
+		  if (errno == ENOMEM)
+		    errno = EAGAIN;
+
+		  return errno;
+		}
 	    }
 
 	  /* SIZE is guaranteed to be greater than zero.

Added: fsf/trunk/libc/nptl/tst-basic7.c
==============================================================================
--- fsf/trunk/libc/nptl/tst-basic7.c (added)
+++ fsf/trunk/libc/nptl/tst-basic7.c Thu Nov  8 00:03:05 2007
@@ -1,0 +1,56 @@
+#include <errno.h>
+#include <pthread.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/mman.h>
+#include <sys/resource.h>
+
+static void
+use_up_memory (void)
+{
+  struct rlimit rl;
+  getrlimit (RLIMIT_AS, &rl);
+  rl.rlim_cur = 10 * 1024 * 1024;
+  setrlimit (RLIMIT_AS, &rl);
+
+  char *c;
+  int PAGESIZE = getpagesize ();
+  while (1)
+    {
+      c = mmap (NULL, PAGESIZE, PROT_NONE, MAP_ANON | MAP_PRIVATE, -1, 0);
+      if (c == MAP_FAILED)
+	break;
+    }
+}
+
+static void *
+child (void *arg)
+{
+  sleep (1);
+  return arg;
+}
+
+static int
+do_test (void)
+{
+  int err;
+  pthread_t tid;
+
+  use_up_memory ();
+
+  err = pthread_create (&tid, NULL, child, NULL);
+  if (err != 0)
+    {
+      printf ("pthread_create returns %d: %s\n", err,
+	      err == EAGAIN ? "OK" : "FAIL");
+      return err != EAGAIN;
+    }
+
+  /* We did not fail to allocate memory despite the preparation.  Oh well.  */
+  return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"

Modified: fsf/trunk/libc/sysdeps/x86_64/memset.S
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/memset.S (original)
+++ fsf/trunk/libc/sysdeps/x86_64/memset.S Thu Nov  8 00:03:05 2007
@@ -127,6 +127,7 @@
 	add	$0x40,%rcx
 	dec	%rax
 	jne	11b
+	sfence
 	jmp	4b
 
 END (memset)